Beispiel #1
0
 /// <summary>
 /// Updates an existing ACL Role in Consul
 /// </summary>
 /// <param name="role">The modified ACL Role</param>
 /// <param name="ct">Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing</param>
 /// <returns>A write result containing the updated ACL Role</returns>
 public Task <WriteResult <RoleEntry> > Update(RoleEntry role, CancellationToken ct = default(CancellationToken))
 {
     return(Update(role, WriteOptions.Default, ct));
 }
Beispiel #2
0
        /// <summary>
        /// Updates an existing ACL Role in Consul
        /// </summary>
        /// <param name="role">The modified ACL Role</param>
        /// <param name="writeOptions">Customised write options</param>
        /// <param name="ct">Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing</param>
        /// <returns>A write result containing the updated ACL Role</returns>
        public async Task <WriteResult <RoleEntry> > Update(RoleEntry role, WriteOptions writeOptions, CancellationToken ct = default(CancellationToken))
        {
            var res = await _client.Put <RoleEntry, RoleActionResult>($"/v1/acl/role/{role.ID}", role, writeOptions).Execute(ct).ConfigureAwait(false);

            return(new WriteResult <RoleEntry>(res, res.Response));
        }
Beispiel #3
0
 /// <summary>
 /// Creates a new ACL Role in Consul
 /// </summary>
 /// <param name="policy">The new ACL Role</param>
 /// <param name="ct">Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing</param>
 /// <returns>A write result containing the created ACL Role</returns>
 public Task <WriteResult <RoleEntry> > Create(RoleEntry policy, CancellationToken ct = default(CancellationToken))
 {
     return(Create(policy, WriteOptions.Default, ct));
 }