Ganeti confd client
Clients can use the confd client library to send requests to a group of master candidates running confd. The expected usage is through the asyncore framework, by sending queries, and asynchronously receiving replies through a callback.
This way the client library doesn't ever need to "wait" on a particular answer, and can proceed even if some udp packets are lost. It's up to the user to reschedule queries if they haven't received responses and they need them.
Example usage:
client = ConfdClient(...) # includes callback specification req = confd_client.ConfdClientRequest(type=constants.CONFD_REQ_PING) client.SendRequest(req) # then make sure your client calls asyncore.loop() or daemon.Mainloop.Run() # ... wait ... # And your callback will be called by asyncore, when your query gets a # response, or when it expires.
You can use the provided ConfdFilterCallback to act as a filter, only passing "newer" answer to your callback, and filtering out outdated ones, or ones confirming what you already got.
Class |
|
Confd udp asyncore client |
Class |
|
Send queries to confd, and get back answers. |
Class |
|
This is the client-side version of ConfdRequest. |
Class |
|
Callback that calls another callback, and counts the answers |
Class |
|
Callback that calls another callback, but filters duplicate results. |
Class |
|
Callback argument for confd replies |
Class |
|
Callback that simply stores the most recent answer. |
Function |
|
Return a client configured using the given callback. |
Constant | CONFD |
Undocumented |
Constant | UPCALL |
Undocumented |
Constant | UPCALL |
Undocumented |
Class | _ |
Request status structure. |
Return a client configured using the given callback.
This is handy to abstract the MC list and HMAC key reading.
Unknown Field: attention | |
This should only be called on nodes which are part of a cluster, since it depends on a valid (ganeti) data directory; for code running outside of a cluster, you need to create the client manually |