The etcd3gw.lease Module

class etcd3gw.lease.Lease(id, client=None)[source]

Bases: object

keys()[source]

Get the keys associated with this lease.

Returns:

refresh()[source]

LeaseKeepAlive keeps the lease alive

By streaming keep alive requests from the client to the server and streaming keep alive responses from the server to the client. This method makes a synchronous HTTP request by default.

Returns:

returns new TTL for lease. If lease was already expired then TTL field is absent in response and the function returns -1 according to etcd documentation. https://etcd.io/docs/v3.5/dev-guide/apispec/swagger/rpc.swagger.json

revoke()[source]

LeaseRevoke revokes a lease.

All keys attached to the lease will expire and be deleted. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

Returns:

ttl()[source]

LeaseTimeToLive retrieves lease information.

This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

Returns: