Class LeaseExtensions
Inheritance
Inherited Members
Namespace: ETCD.V3
Assembly: cs.temp.dll.dll
Syntax
public static class LeaseExtensions
Methods
CreateLeaseGrantRequest(Client, Int64, Int64)
Create LeaseGrantRequest.
Declaration
public static LeaseGrantRequest CreateLeaseGrantRequest(this Client client, long ttl, long id)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.Int64 | ttl | TTL is the advisory time-to-live in seconds. |
System.Int64 | id | ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID. |
Returns
Type | Description |
---|---|
LeaseGrantRequest | LeaseGrantRequest. |
CreateLeaseRevokeRequest(Client, Int64)
Create LeaseRevokeRequest.
Declaration
public static LeaseRevokeRequest CreateLeaseRevokeRequest(this Client client, long id)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.Int64 | id | ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted. |
Returns
Type | Description |
---|---|
LeaseRevokeRequest | The response received from the server. |
CreateLeaseTimeToLiveRequest(Client, Int64, Boolean)
Create LeaseTimeToLiveRequest.
Declaration
public static LeaseTimeToLiveRequest CreateLeaseTimeToLiveRequest(this Client client, long id, bool keys = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.Int64 | id | ID is the lease ID for the lease. |
System.Boolean | keys | keys is true to query all the keys attached to this lease. |
Returns
Type | Description |
---|---|
LeaseTimeToLiveRequest | LeaseTimeToLiveRequest. |
LeaseGrant(Client, Int64, Int64)
LeaseGrant creates a lease which expires if the server does not receive a keepAlive within a given time to live period. All keys attached to the lease will be expired and deleted if the lease expires. Each expired key generates a delete event in the event history.
Declaration
public static LeaseGrantResponse LeaseGrant(this Client client, long ttl, long id)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.Int64 | ttl | TTL is the advisory time-to-live in seconds. |
System.Int64 | id | ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID. |
Returns
Type | Description |
---|---|
LeaseGrantResponse | The response received from the server. |
LeaseGrantAsync(Client, Int64, Int64)
LeaseGrant creates a lease which expires if the server does not receive a keepAlive within a given time to live period. All keys attached to the lease will be expired and deleted if the lease expires. Each expired key generates a delete event in the event history.
Declaration
public static AsyncUnaryCall<LeaseGrantResponse> LeaseGrantAsync(this Client client, long ttl, long id)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.Int64 | ttl | TTL is the advisory time-to-live in seconds. |
System.Int64 | id | ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID. |
Returns
Type | Description |
---|---|
AsyncUnaryCall<LeaseGrantResponse> | The call object. |
LeaseKeepAlive(Client)
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.
Declaration
public static AsyncDuplexStreamingCall<LeaseKeepAliveRequest, LeaseKeepAliveResponse> LeaseKeepAlive(this Client client)
Parameters
Type | Name | Description |
---|---|---|
Client | client |
Returns
Type | Description |
---|---|
AsyncDuplexStreamingCall<LeaseKeepAliveRequest, LeaseKeepAliveResponse> | The call object. |
LeaseRevoke(Client, Int64)
LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted.
Declaration
public static LeaseRevokeResponse LeaseRevoke(this Client client, long id)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.Int64 | id | ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted. |
Returns
Type | Description |
---|---|
LeaseRevokeResponse | The response received from the server. |
LeaseRevokeAsync(Client, Int64)
LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted.
Declaration
public static AsyncUnaryCall<LeaseRevokeResponse> LeaseRevokeAsync(this Client client, long id)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.Int64 | id | ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted. |
Returns
Type | Description |
---|---|
AsyncUnaryCall<LeaseRevokeResponse> | The call object. |
LeaseTimeToLive(Client, Int64, Boolean)
LeaseTimeToLive retrieves lease information.
Declaration
public static LeaseTimeToLiveResponse LeaseTimeToLive(this Client client, long id, bool keys = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.Int64 | id | ID is the lease ID for the lease. |
System.Boolean | keys | keys is true to query all the keys attached to this lease. |
Returns
Type | Description |
---|---|
LeaseTimeToLiveResponse | The response received from the server. |
LeaseTimeToLiveAsync(Client, Int64, Boolean)
LeaseTimeToLive retrieves lease information.
Declaration
public static AsyncUnaryCall<LeaseTimeToLiveResponse> LeaseTimeToLiveAsync(this Client client, long id, bool keys = false)
Parameters
Type | Name | Description |
---|---|---|
Client | client | |
System.Int64 | id | ID is the lease ID for the lease. |
System.Boolean | keys | keys is true to query all the keys attached to this lease. |
Returns
Type | Description |
---|---|
AsyncUnaryCall<LeaseTimeToLiveResponse> | The call object. |