/// <summary> /// Deletes an existing ACL Policy in Consul /// </summary> /// <param name="id">The ID of the ACL Policy to delete</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>Success (true) or failure (false)</returns> public async Task <WriteResult <bool> > Delete(string id, WriteOptions writeOptions, CancellationToken ct = default(CancellationToken)) { var res = await _client.DeleteReturning <bool>($"/v1/acl/policy/{id}", writeOptions).Execute(ct).ConfigureAwait(false); return(new WriteResult <bool>(res, res.Response)); }
/// <summary> /// Delete is used to delete a single key. /// </summary> /// <param name="key">The key name to delete</param> /// <param name="q">Customized write options</param> /// <returns>A write result indicating if the delete attempt succeeded</returns> public Task <WriteResult <bool> > Delete(string key, WriteOptions q, CancellationToken ct = default(CancellationToken)) { KVPair.ValidatePath(key); return(_client.DeleteReturning <bool>(string.Format("/v1/kv/{0}", key.TrimStart('/')), q).Execute(ct)); }
public async Task <WriteResult> Delete(string queryID, WriteOptions q, CancellationToken ct = default(CancellationToken)) { var res = await _client.DeleteReturning <string>(string.Format("/v1/query/{0}", queryID), q).Execute(ct); return(new WriteResult(res)); }
/// <summary> /// Deletes an existing ACL AuthMethod from Consul /// </summary> /// <param name="name">The name of the ACL AuthMethod to delete</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>Success (true) or failure (false)</returns> public Task <WriteResult <bool> > Delete(string name, WriteOptions writeOptions, CancellationToken ct = default(CancellationToken)) { return(_client.DeleteReturning <bool>($"/v1/acl/auth-method/{name}", writeOptions).Execute(ct)); }
/// <summary> /// Deletes an existing ACL Token from Consul /// </summary> /// <param name="id">The Accessor ID of the ACL Token to delete</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>Success (true) or failure (false)</returns> public Task <WriteResult <bool> > Delete(string id, WriteOptions writeOptions, CancellationToken ct = default(CancellationToken)) { return(_client.DeleteReturning <bool>($"/v1/acl/token/{id}", writeOptions).Execute(ct)); }