Class Token
Namespace: Consul
Assembly: Consul.dll
Token is used to interact with ACL Tokens in Consul through the API
public class Token : ITokenEndpoint
Inheritance
Implements
Inherited Members
object.Equals(object) , object.Equals(object, object) , object.GetHashCode() , object.GetType() , object.MemberwiseClone() , object.ReferenceEquals(object, object) , object.ToString()
Methods
Bootstrap(CancellationToken)
Creates the initial Management ACL Token in Consul
public Task<WriteResult<TokenEntry>> Bootstrap(CancellationToken ct = default)
Parameters
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <WriteResult <TokenEntry >>
A write result containing the created ACL Token
Bootstrap(WriteOptions, CancellationToken)
Creates the initial Management ACL Token in Consul
public Task<WriteResult<TokenEntry>> Bootstrap(WriteOptions writeOptions, CancellationToken ct = default)
Parameters
writeOptions
WriteOptions
Customized write options
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <WriteResult <TokenEntry >>
A write result containing the created ACL Token
Clone(string, CancellationToken)
Clones an existing ACL Token in Consul
public Task<WriteResult<TokenEntry>> Clone(string id, CancellationToken ct = default)
Parameters
id
string
The Accessor ID of the ACL Token to clone
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <WriteResult <TokenEntry >>
A write result containing the created ACL token
Clone(string, WriteOptions, CancellationToken)
Clones an existing ACL Token in Consul
public Task<WriteResult<TokenEntry>> Clone(string id, WriteOptions writeOptions, CancellationToken ct = default)
Parameters
id
string
The Accessor ID of the ACL Token to clone
writeOptions
WriteOptions
Customized write options
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <WriteResult <TokenEntry >>
A write result containing the created ACL token
Clone(string, string, WriteOptions, CancellationToken)
Clones an existing ACL Token in Consul
public Task<WriteResult<TokenEntry>> Clone(string id, string description, WriteOptions writeOptions, CancellationToken ct = default)
Parameters
id
string
The Accessor ID of the ACL Token to clone
description
string
The description for the cloned ACL Token
writeOptions
WriteOptions
Customized write options
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <WriteResult <TokenEntry >>
A write result containing the created ACL token
Create(TokenEntry, CancellationToken)
Creates a new ACL Token in Consul
public Task<WriteResult<TokenEntry>> Create(TokenEntry token, CancellationToken ct = default)
Parameters
token
TokenEntry
The new ACL Token
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <WriteResult <TokenEntry >>
A write result containing the created ACL Token
Create(TokenEntry, WriteOptions, CancellationToken)
Creates a new ACL Token in Consul
public Task<WriteResult<TokenEntry>> Create(TokenEntry token, WriteOptions writeOptions, CancellationToken ct = default)
Parameters
token
TokenEntry
The new ACL Token
writeOptions
WriteOptions
Customized write options
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <WriteResult <TokenEntry >>
A write result containing the created ACL Token
Delete(string, CancellationToken)
Deletes an existing ACL Token from Consul
public Task<WriteResult<bool>> Delete(string id, CancellationToken ct = default)
Parameters
id
string
The Accessor ID of the ACL Token to delete
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <WriteResult <bool >>
Success (true) or failure (false)
Delete(string, WriteOptions, CancellationToken)
Deletes an existing ACL Token from Consul
public Task<WriteResult<bool>> Delete(string id, WriteOptions writeOptions, CancellationToken ct = default)
Parameters
id
string
The Accessor ID of the ACL Token to delete
writeOptions
WriteOptions
Customized write options
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <WriteResult <bool >>
Success (true) or failure (false)
List(CancellationToken)
Lists the existing ACL Tokens in Consul
public Task<QueryResult<TokenEntry[]>> List(CancellationToken ct = default)
Parameters
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <QueryResult <TokenEntry []>>
A query result containing an array of ACL Tokens
List(QueryOptions, CancellationToken)
Lists the existing ACL Tokens in Consul
public Task<QueryResult<TokenEntry[]>> List(QueryOptions queryOptions, CancellationToken ct = default)
Parameters
queryOptions
QueryOptions
Customized query options
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <QueryResult <TokenEntry []>>
A query result containing an array of ACL Tokens
Read(string, CancellationToken)
Gets an existing ACL Token from Consul
public Task<QueryResult<TokenEntry>> Read(string id, CancellationToken ct = default)
Parameters
id
string
The Accessor ID of the ACL Token to get
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <QueryResult <TokenEntry >>
A query result containing the requested ACL Token
Read(string, QueryOptions, CancellationToken)
Gets an existing ACL Token from Consul
public Task<QueryResult<TokenEntry>> Read(string id, QueryOptions queryOptions, CancellationToken ct = default)
Parameters
id
string
The Accessor ID of the ACL Token to get
queryOptions
QueryOptions
Customized query options
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <QueryResult <TokenEntry >>
A query result containing the requested ACL Token
Update(TokenEntry, CancellationToken)
Updates an existing ACL Token in Consul
public Task<WriteResult<TokenEntry>> Update(TokenEntry token, CancellationToken ct = default)
Parameters
token
TokenEntry
The modified ACL Token
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <WriteResult <TokenEntry >>
A write result containing the updated ACL Token
Update(TokenEntry, WriteOptions, CancellationToken)
Updates an existing ACL Token in Consul
public Task<WriteResult<TokenEntry>> Update(TokenEntry token, WriteOptions writeOptions, CancellationToken ct = default)
Parameters
token
TokenEntry
The modified ACL Token
writeOptions
WriteOptions
Customized write options
Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing
Returns
Task <WriteResult <TokenEntry >>
A write result containing the updated ACL Token