コード例 #1
0
        /// <summary>
        /// Updates an existing ACL Policy in Consul
        /// </summary>
        /// <param name="policy">The modified ACL Policy</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 policy</returns>
        public async Task <WriteResult <PolicyEntry> > Update(PolicyEntry policy, WriteOptions writeOptions, CancellationToken ct = default(CancellationToken))
        {
            var res = await _client.Put <PolicyEntry, PolicyActionResult>($"/v1/acl/policy/{policy.ID}", policy, writeOptions).Execute(ct).ConfigureAwait(false);

            return(new WriteResult <PolicyEntry>(res, res.Response));
        }
コード例 #2
0
 /// <summary>
 /// Updates an existing ACL Policy in Consul
 /// </summary>
 /// <param name="policy">The modified ACL Policy</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 Policy</returns>
 public Task <WriteResult <PolicyEntry> > Update(PolicyEntry policy, CancellationToken ct = default(CancellationToken))
 {
     return(Update(policy, WriteOptions.Default, ct));
 }