예제 #1
0
        /// <summary>
        /// Updates an existing ACL AuthMethod in Consul
        /// </summary>
        /// <param name="authMethod">The modified ACL AuthMethod</param>
        /// <param name="writeOptions">Customized 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 AuthMethod</returns>
        public async Task <WriteResult <AuthMethodEntry> > Update(AuthMethodEntry authMethod, WriteOptions writeOptions, CancellationToken ct = default(CancellationToken))
        {
            var res = await _client.Put <AuthMethodEntry, AuthMethodActionResult>($"/v1/acl/auth-method/{authMethod.Name}", authMethod, writeOptions).Execute(ct).ConfigureAwait(false);

            return(new WriteResult <AuthMethodEntry>(res, res.Response));
        }
예제 #2
0
 /// <summary>
 /// Updates and existing ACL AuthMethod in Consul
 /// </summary>
 /// <param name="authMethod">The modified ACL AuthMethod</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 AuthMethod</returns>
 public Task <WriteResult <AuthMethodEntry> > Update(AuthMethodEntry authMethod, CancellationToken ct = default(CancellationToken))
 {
     return(Update(authMethod, WriteOptions.Default, ct));
 }