etcd.common_ops module

class etcd.common_ops.CommonOps(client)[source]

Bases: object

Base-class of ‘ops’ modules.

Parameters:client (etcd.client.Client) – Client instance.
compare_and_delete(path, is_dir, current_value=None, current_index=None, is_recursive=None)[source]

The base compare-and-delete function for atomic deletes. A combination of criteria may be used if necessary.

Parameters:
  • path (string) – Key
  • is_dir (bool) – If the node is a directory
  • current_value (string or None) – Current value to check
  • current_index (int or None) – Current index to check
Returns:

Response object

Return type:

etcd.response.ResponseV2

get_fq_node_path(path)[source]

Return the full path of the given key.

Parameters:path (string) – Key
get_text(reason, path, version=2)[source]

Execute a request that will return flat text.

Parameters:
  • reason (string) – Brief phrase describing the request
  • path (string) – URL path
  • version (int) – API version
Returns:

Response text

Return type:

string

validate_path(path)[source]

Validate the key that we were given.

Parameters:path (string) – Key
Raises:ValueError