module documentation

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 ConfdAsyncUDPClient Confd udp asyncore client
Class ConfdClient Send queries to confd, and get back answers.
Class ConfdClientRequest This is the client-side version of ConfdRequest.
Class ConfdCountingCallback Callback that calls another callback, and counts the answers
Class ConfdFilterCallback Callback that calls another callback, but filters duplicate results.
Class ConfdUpcallPayload Callback argument for confd replies
Class StoreResultCallback Callback that simply stores the most recent answer.
Function GetConfdClient Return a client configured using the given callback.
Constant CONFD_UPCALL_TYPES Undocumented
Constant UPCALL_EXPIRE Undocumented
Constant UPCALL_REPLY Undocumented
Class _Request Request status structure.
def GetConfdClient(callback):

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
CONFD_UPCALL_TYPES =
UPCALL_EXPIRE: int =

Undocumented

Value
2
UPCALL_REPLY: int =

Undocumented

Value
1