Skip to main content

Class Role

Namespace: Consul
Assembly: Consul.dll

Role is used to interact with ACL Roles in Consul through the API

public class Role : IRoleEndpoint

Inheritance

objectRole

Implements

IRoleEndpoint

Inherited Members

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

Methods

Create(RoleEntry, CancellationToken)

Creates a new ACL Role in Consul

public Task<WriteResult<RoleEntry>> Create(RoleEntry policy, CancellationToken ct = default)

Parameters

policy RoleEntry

The new ACL Role

ct CancellationToken

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

Returns

Task <WriteResult <RoleEntry >>

A write result containing the created ACL Role

Create(RoleEntry, WriteOptions, CancellationToken)

Creates a new ACL Role in Consul

public Task<WriteResult<RoleEntry>> Create(RoleEntry policy, WriteOptions writeOptions, CancellationToken ct = default)

Parameters

policy RoleEntry

The new ACL Role

writeOptions WriteOptions

Customised 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 <RoleEntry >>

A write result containing the created ACL Role

Delete(string, CancellationToken)

Deletes and existing ACL Role from Consul

public Task<WriteResult<bool>> Delete(string id, CancellationToken ct = default)

Parameters

id string

The ID of the ACL Role 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 Role from Consul

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

Parameters

id string

The ID of the ACL Role to delete

writeOptions WriteOptions

Customised 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 Roles in Consul

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

A query result containing an array of ACL Roles

List(QueryOptions, CancellationToken)

Lists the existing ACL Roles in Consul

public Task<QueryResult<RoleEntry[]>> List(QueryOptions queryOptions, CancellationToken ct = default)

Parameters

queryOptions QueryOptions

Customised 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 <RoleEntry []>>

A query result containing an array of ACL Roles

Read(string, CancellationToken)

Gets the requested ACL Role from Consul

public Task<QueryResult<RoleEntry>> Read(string id, CancellationToken ct = default)

Parameters

id string

The ID of the ACL Role 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 <RoleEntry >>

A query result containing the requested ACL Role

Read(string, QueryOptions, CancellationToken)

Gets the requested ACL Role from Consul

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

Parameters

id string

The ID of the ACL Role to get

queryOptions QueryOptions

Customised 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 <RoleEntry >>

A query result containing the requested ACL Role

ReadByName(string, CancellationToken)

Gets the requested ACL Role from Consul

public Task<QueryResult<RoleEntry>> ReadByName(string name, CancellationToken ct = default)

Parameters

name string

The Name of the ACL Role 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 <RoleEntry >>

A query result containing the requested ACL Role

ReadByName(string, QueryOptions, CancellationToken)

Gets the requested ACL Role from Consul

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

Parameters

name string

The Name of the ACL Role to get

queryOptions QueryOptions

Customised 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 <RoleEntry >>

A query result containing the requested ACL Role

Update(RoleEntry, CancellationToken)

Updates an existing ACL Role in Consul

public Task<WriteResult<RoleEntry>> Update(RoleEntry role, CancellationToken ct = default)

Parameters

role RoleEntry

The modified ACL Role

ct CancellationToken

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

Returns

Task <WriteResult <RoleEntry >>

A write result containing the updated ACL Role

Update(RoleEntry, WriteOptions, CancellationToken)

Updates an existing ACL Role in Consul

public Task<WriteResult<RoleEntry>> Update(RoleEntry role, WriteOptions writeOptions, CancellationToken ct = default)

Parameters

role RoleEntry

The modified ACL Role

writeOptions WriteOptions

Customised 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 <RoleEntry >>

A write result containing the updated ACL Role

  • Methods
    • Create(RoleEntry, CancellationToken)
    • Create(RoleEntry, WriteOptions, CancellationToken)
    • Delete(string, CancellationToken)
    • Delete(string, WriteOptions, CancellationToken)
    • List(CancellationToken)
    • List(QueryOptions, CancellationToken)
    • Read(string, CancellationToken)
    • Read(string, QueryOptions, CancellationToken)
    • ReadByName(string, CancellationToken)
    • ReadByName(string, QueryOptions, CancellationToken)
    • Update(RoleEntry, CancellationToken)
    • Update(RoleEntry, WriteOptions, CancellationToken)