etcd3ref/client.py
def lease(self, ttl, lease_id=None):
        """
        Create a new lease.

        All keys attached to this lease will be expired and deleted if the
        lease expires. A lease can be sent keep alive messages to refresh the
        ttl.

        :param ttl: Requested time to live
        :param lease_id: Requested ID for the lease

        :returns: new lease
        :rtype: :class:`.Lease`
        """
        try:
            lease_grant_response = self.__lease(lease_id, ttl)
        except _InactiveRpcError as e:
            print("Exception {} happened, try to reconnect \n".format(e))
            self.reconnect()
            lease_grant_response = self.__lease(lease_id, ttl)

        return leases.Lease(lease_id=lease_grant_response.ID,
                            ttl=lease_grant_response.TTL,
                            etcd_client=self)

        Create a new lease.

        All keys attached to this lease will be expired and deleted if the
        lease expires. A lease can be sent keep alive messages to refresh the
        ttl.

        :param ttl: Requested time to live
        :param lease_id: Requested ID for the lease

        :returns: new lease
        :rtype: :class:`.Lease`
        
Create a new lease.
All keys attached to this lease will be expired and deleted if the
lease expires. A lease can be sent keep alive messages to refresh the
ttl.
Create a new lease . All keys attached to this lease will be expired and deleted if the lease expires . A lease can be sent keep alive messages to refresh the ttl .
def lease(self, ttl, lease_id=None):
        try:
            lease_grant_response = self.__lease(lease_id, ttl)
        except _InactiveRpcError as e:
            print("Exception {} happened, try to reconnect \n".format(e))
            self.reconnect()
            lease_grant_response = self.__lease(lease_id, ttl)
        return leases.Lease(lease_id=lease_grant_response.ID,
                            ttl=lease_grant_response.TTL,
                            etcd_client=self)
def lease ( self , ttl , lease_id = None ) : try : lease_grant_response = self . __lease ( lease_id , ttl ) except _InactiveRpcError as e : print ( "Exception {} happened, try to reconnect \n" . format ( e ) ) self . reconnect ( ) lease_grant_response = self . __lease ( lease_id , ttl ) return leases . Lease ( lease_id = lease_grant_response . ID , ttl = lease_grant_response . TTL , etcd_client = self )
Create a new lease.
Create a new lease .
"""
        Create a new lease.

        All keys attached to this lease will be expired and deleted if the
        lease expires. A lease can be sent keep alive messages to refresh the
        ttl.

        :param ttl: Requested time to live
        :param lease_id: Requested ID for the lease

        :returns: new lease
        :rtype: :class:`.Lease`
        """
None
:class:`.Lease`
self
ttl
Requested time to live
Requested time to live
lease_id
Requested ID for the lease
Requested ID for the lease