Skip to main content

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

objectToken

Implements

ITokenEndpoint

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

ct CancellationToken

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

ct CancellationToken

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

ct CancellationToken

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

ct CancellationToken

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

ct CancellationToken

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

ct CancellationToken

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

ct CancellationToken

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

ct CancellationToken

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

ct CancellationToken

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

ct CancellationToken

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

ct CancellationToken

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

ct CancellationToken

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

ct CancellationToken

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

ct CancellationToken

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

ct CancellationToken

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

  • Methods
    • Bootstrap(CancellationToken)
    • Bootstrap(WriteOptions, CancellationToken)
    • Clone(string, CancellationToken)
    • Clone(string, WriteOptions, CancellationToken)
    • Clone(string, string, WriteOptions, CancellationToken)
    • Create(TokenEntry, CancellationToken)
    • Create(TokenEntry, WriteOptions, CancellationToken)
    • Delete(string, CancellationToken)
    • Delete(string, WriteOptions, CancellationToken)
    • List(CancellationToken)
    • List(QueryOptions, CancellationToken)
    • Read(string, CancellationToken)
    • Read(string, QueryOptions, CancellationToken)
    • Update(TokenEntry, CancellationToken)
    • Update(TokenEntry, WriteOptions, CancellationToken)