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​

object ← Role

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)

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)​

public Task<WriteResult<RoleEntry>> Create(RoleEntry policy)

Parameters​

policy RoleEntry

Returns​

Task <WriteResult <RoleEntry >>

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)

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)​

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

Parameters​

id string

Returns​

Task <WriteResult <bool >>

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)

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()​

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

Returns​

Task <QueryResult <RoleEntry []>>

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)

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)​

public Task<QueryResult<RoleEntry>> Read(string id)

Parameters​

id string

Returns​

Task <QueryResult <RoleEntry >>

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)

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)​

public Task<QueryResult<RoleEntry>> ReadByName(string name)

Parameters​

name string

Returns​

Task <QueryResult <RoleEntry >>

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)

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)​

public Task<WriteResult<RoleEntry>> Update(RoleEntry role)

Parameters​

role RoleEntry

Returns​

Task <WriteResult <RoleEntry >>

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)
    • Create(RoleEntry, WriteOptions, CancellationToken)
    • Delete(string, CancellationToken)
    • Delete(string)
    • Delete(string, WriteOptions, CancellationToken)
    • List(CancellationToken)
    • List()
    • List(QueryOptions, CancellationToken)
    • Read(string, CancellationToken)
    • Read(string)
    • Read(string, QueryOptions, CancellationToken)
    • ReadByName(string, CancellationToken)
    • ReadByName(string)
    • ReadByName(string, QueryOptions, CancellationToken)
    • Update(RoleEntry, CancellationToken)
    • Update(RoleEntry)
    • Update(RoleEntry, WriteOptions, CancellationToken)