### Install etcd3-gateway in a virtual environment Source: https://github.com/openstack/etcd3gw/blob/master/doc/source/installation.md Installation commands for users utilizing virtualenvwrapper. ```default $ mkvirtualenv etcd3-gateway $ pip install etcd3-gateway ``` -------------------------------- ### Install etcd3-gateway via pip Source: https://github.com/openstack/etcd3gw/blob/master/doc/source/installation.md Standard installation command for the etcd3-gateway package. ```default $ pip install etcd3-gateway ``` -------------------------------- ### Perform basic etcd operations with etcd3gw Source: https://github.com/openstack/etcd3gw/blob/master/doc/source/usage.md Demonstrates connecting to an etcd server, performing CRUD operations on keys, managing leases, and setting up watches. ```python from etcd3gw.client import Etcd3Client client = Etcd3Client(host='localhost', port=2379) # Put key client.put(key='foo', value='bar') # Get key client.get(key='foo') # Get all keys client.get_all() # Create lease and use it lease = client.lease(ttl=100) client.put(key='foo', value='bar', lease=lease) # Get lease keys lease.keys() # Refresh lease lease.refresh() # Use watch watcher, watch_cancel = client.watch(key='KEY') for event in watcher: # blocks until event comes, cancel via watch_cancel() print(event) # modify event: {'kv': {'mod_revision': '8', 'version': '3', 'value': 'NEW_VAL', 'create_revision': '2', 'key': 'KEY', 'lease': '7587847878767953426'}} ``` -------------------------------- ### etcd3gw Modules Overview Source: https://github.com/openstack/etcd3gw/blob/master/doc/source/api/autoindex.md A summary of the primary modules provided by the etcd3gw library for interacting with etcd v3. ```APIDOC ## etcd3gw Modules ### Description The etcd3gw library is organized into several key modules to handle different aspects of etcd v3 interactions. ### Modules - **etcd3gw.client**: Provides the primary client interface for connecting to and interacting with the etcd server. - **etcd3gw.lease**: Contains functionality for managing etcd leases, which are used for TTL-based key expiration. - **etcd3gw.lock**: Implements distributed locking mechanisms using etcd primitives. - **etcd3gw.utils**: Includes various helper functions and utilities used across the library. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.