Skip to main content

Class AuthMethod

Namespace: Consul
Assembly: Consul.dll

AuthMethod can be used to query the ACL Auth Method endpoints

public class AuthMethod : IAuthMethodEndpoint

Inheritance​

object ← AuthMethod

Implements​

IAuthMethodEndpoint

Inherited Members​

object.Equals(object) , object.Equals(object, object) , object.GetHashCode() , object.GetType() , object.MemberwiseClone() , object.ReferenceEquals(object, object) , object.ToString()

Methods​

Create(AuthMethodEntry, CancellationToken)​

Creates a new ACL AuthMethod in Consul

public Task<WriteResult<AuthMethodEntry>> Create(AuthMethodEntry authMethod, CancellationToken ct)

Parameters​

authMethod AuthMethodEntry

The new ACL AuthMethod

ct CancellationToken

Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing

Returns​

Task <WriteResult <AuthMethodEntry >>

A write result containing the created ACL AuthMethod

Create(AuthMethodEntry)​

public Task<WriteResult<AuthMethodEntry>> Create(AuthMethodEntry authMethod)

Parameters​

authMethod AuthMethodEntry

Returns​

Task <WriteResult <AuthMethodEntry >>

Create(AuthMethodEntry, WriteOptions, CancellationToken)​

Creates a new ACL AuthMethod in Consul

public Task<WriteResult<AuthMethodEntry>> Create(AuthMethodEntry authMethod, WriteOptions writeOptions, CancellationToken ct = default)

Parameters​

authMethod AuthMethodEntry

The new ACL AuthMethod

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 <AuthMethodEntry >>

A write result containing the created ACL AuthMethod

Delete(string, CancellationToken)​

Deletes an existing ACL AuthMethod from Consul

public Task<WriteResult<bool>> Delete(string name, CancellationToken ct)

Parameters​

name string

The name of the ACL AuthMethod 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)​

public Task<WriteResult<bool>> Delete(string name)

Parameters​

name string

Returns​

Task <WriteResult <bool >>

Delete(string, WriteOptions, CancellationToken)​

Deletes an existing ACL AuthMethod from Consul

public Task<WriteResult<bool>> Delete(string name, WriteOptions writeOptions, CancellationToken ct = default)

Parameters​

name string

The name of the ACL AuthMethod 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 AuthMethods in Consul

public Task<QueryResult<AuthMethodEntry[]>> List(CancellationToken ct)

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 <AuthMethodEntry []>>

A query result containing an array of ACL AuthMethods

List()​

public Task<QueryResult<AuthMethodEntry[]>> List()

Returns​

Task <QueryResult <AuthMethodEntry []>>

List(QueryOptions, CancellationToken)​

Lists the existing ACL AuthMethods in Consul

public Task<QueryResult<AuthMethodEntry[]>> 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 <AuthMethodEntry []>>

A query result containing an array of ACL AuthMethods

Login(string, string, CancellationToken)​

Login to ACL Auth Method

public Task<WriteResult<TokenEntry>> Login(string authMethod, string bearerToken, CancellationToken ct)

Parameters​

authMethod string

The name of the auth method to use for login

bearerToken string

The bearer token to authenticate with

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 an ACL Token for the login

Login(string, string)​

public Task<WriteResult<TokenEntry>> Login(string authMethod, string bearerToken)

Parameters​

authMethod string

bearerToken string

Returns​

Task <WriteResult <TokenEntry >>

Login(string, string, WriteOptions, CancellationToken)​

Login to ACL Auth Method

public Task<WriteResult<TokenEntry>> Login(string authMethod, string bearerToken, WriteOptions writeOptions, CancellationToken ct = default)

Parameters​

authMethod string

The name of the auth method to use for login

bearerToken string

The bearer token to authenticate with

writeOptions WriteOptions

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 an ACL Token for the login

Logout(CancellationToken)​

Logout from ACL Auth Method

public Task<WriteResult> Logout(CancellationToken ct)

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 >

A write result

Logout()​

public Task<WriteResult> Logout()

Returns​

Task <WriteResult >

Logout(WriteOptions, CancellationToken)​

Logout from ACL Auth Method

public Task<WriteResult> Logout(WriteOptions writeOptions, CancellationToken ct = default)

Parameters​

writeOptions WriteOptions

ct CancellationToken

Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing

Returns​

Task <WriteResult >

A write result

Read(string, CancellationToken)​

Gets an existing ACL AuthMethod from Consul

public Task<QueryResult<AuthMethodEntry>> Read(string name, CancellationToken ct)

Parameters​

name string

The Name of the ACL AuthMethod 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 <AuthMethodEntry >>

A query result containing the requested ACL AuthMethod

Read(string)​

public Task<QueryResult<AuthMethodEntry>> Read(string name)

Parameters​

name string

Returns​

Task <QueryResult <AuthMethodEntry >>

Read(string, QueryOptions, CancellationToken)​

Gets an existing ACL AuthMethod from Consul

public Task<QueryResult<AuthMethodEntry>> Read(string name, QueryOptions queryOptions, CancellationToken ct = default)

Parameters​

name string

The Name of the ACL AuthMethod 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 <AuthMethodEntry >>

A query result containing the requested ACL AuthMethod

Update(AuthMethodEntry, CancellationToken)​

Updates and existing ACL AuthMethod in Consul

public Task<WriteResult<AuthMethodEntry>> Update(AuthMethodEntry authMethod, CancellationToken ct)

Parameters​

authMethod AuthMethodEntry

The modified ACL AuthMethod

ct CancellationToken

Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing

Returns​

Task <WriteResult <AuthMethodEntry >>

A write result containing the updated ACL AuthMethod

Update(AuthMethodEntry)​

public Task<WriteResult<AuthMethodEntry>> Update(AuthMethodEntry authMethod)

Parameters​

authMethod AuthMethodEntry

Returns​

Task <WriteResult <AuthMethodEntry >>

Update(AuthMethodEntry, WriteOptions, CancellationToken)​

Updates an existing ACL AuthMethod in Consul

public Task<WriteResult<AuthMethodEntry>> Update(AuthMethodEntry authMethod, WriteOptions writeOptions, CancellationToken ct = default)

Parameters​

authMethod AuthMethodEntry

The modified ACL AuthMethod

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 <AuthMethodEntry >>

A write result containing the updated ACL AuthMethod

  • Methods
    • Create(AuthMethodEntry, CancellationToken)
    • Create(AuthMethodEntry)
    • Create(AuthMethodEntry, WriteOptions, CancellationToken)
    • Delete(string, CancellationToken)
    • Delete(string)
    • Delete(string, WriteOptions, CancellationToken)
    • List(CancellationToken)
    • List()
    • List(QueryOptions, CancellationToken)
    • Login(string, string, CancellationToken)
    • Login(string, string)
    • Login(string, string, WriteOptions, CancellationToken)
    • Logout(CancellationToken)
    • Logout()
    • Logout(WriteOptions, CancellationToken)
    • Read(string, CancellationToken)
    • Read(string)
    • Read(string, QueryOptions, CancellationToken)
    • Update(AuthMethodEntry, CancellationToken)
    • Update(AuthMethodEntry)
    • Update(AuthMethodEntry, WriteOptions, CancellationToken)