etcd3gw.client
Module¶Bases: object
Atomically create the given key only if the key doesn’t exist.
This verifies that the create_revision of a key equales to 0, then creates the key with the value. This operation takes place in a transaction.
DeleteRange deletes the given range from the key-value store.
A delete request increments the revision of the key-value store and generates a delete event in the event history for every deleted key.
key –
kwargs –
Range gets the keys in the range from the key-value store.
key –
metadata –
sort_order – ‘ascend’ or ‘descend’ or None
sort_target – ‘key’ or ‘version’ or ‘create’ or ‘mod’ or ‘value’
kwargs –
Get all keys currently stored in etcd.
sequence of (value, metadata) tuples
Get a range of keys with a prefix.
sort_order – ‘ascend’ or ‘descend’ or None
key_prefix – first key in range
sequence of (value, metadata) tuples
Construct a full url to the v3 API given a specific path
path –
url
Create a Lease object given a timeout
ttl – timeout
Lease object
Create a Lock object given an ID and timeout
id – ID for the lock, creates a new uuid if not provided
ttl – timeout
Lock object
helper method for HTTP POST
args –
kwargs –
json response
Put puts the given key into the key-value store.
A put request increments the revision of the key-value store and generates one event in the event history.
key –
value –
lease –
boolean
Atomically replace the value of a key with a new value.
This compares the current value of a key, then replaces it with a new value if it is equal to a specified value. This operation takes place in a transaction.
Txn processes multiple requests in a single transaction.
A txn request increments the revision of the key-value store and generates events with the same revision for every completed request. It is not allowed to modify the same key several times within one txn.
txn –
Watch a key.
key – key to watch
tuple of events_iterator
and cancel
.
Use events_iterator
to get the events of key changes
and cancel
to cancel the watch request
Watch a key and stops after the first event.
key – key to watch
timeout – (optional) timeout in seconds.
event
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.