예제 #1
0
        /// <summary>
        /// Create is used to generate a new token with the given parameters
        /// </summary>
        /// <param name="acl">The ACL entry to create</param>
        /// <param name="q">Customized write options</param>
        /// <returns>A write result containing the newly created ACL token</returns>
        public WriteResult <string> Create(ACLEntry acl, WriteOptions q)
        {
            var res = _client.CreateWrite <ACLEntry, ACLCreationResult>("/v1/acl/create", acl, q).Execute();

            return(new WriteResult <string>()
            {
                RequestTime = res.RequestTime,
                Response = res.Response.ID
            });
        }
예제 #2
0
 /// <summary>
 /// Update is used to update the rules of an existing token
 /// </summary>
 /// <param name="acl">The ACL entry to update</param>
 /// <param name="q">Customized write options</param>
 /// <returns>An empty write result</returns>
 public Task <WriteResult> Update(ACLEntry acl, WriteOptions q, CancellationToken ct = default(CancellationToken))
 {
     return(_client.Put("/v1/acl/update", acl, q).Execute(ct));
 }
예제 #3
0
 /// <summary>
 /// Update is used to update the rules of an existing token
 /// </summary>
 /// <param name="acl">The ACL entry to update</param>
 /// <returns>An empty write result</returns>
 public Task <WriteResult> Update(ACLEntry acl, CancellationToken ct = default(CancellationToken))
 {
     return(Update(acl, WriteOptions.Default, ct));
 }
예제 #4
0
        /// <summary>
        /// Create is used to generate a new token with the given parameters
        /// </summary>
        /// <param name="acl">The ACL entry to create</param>
        /// <param name="q">Customized write options</param>
        /// <returns>A write result containing the newly created ACL token</returns>
        public async Task <WriteResult <string> > Create(ACLEntry acl, WriteOptions q, CancellationToken ct = default(CancellationToken))
        {
            var res = await _client.Put <ACLEntry, ACLCreationResult>("/v1/acl/create", acl, q).Execute(ct).ConfigureAwait(false);

            return(new WriteResult <string>(res, res.Response.ID));
        }
예제 #5
0
 /// <summary>
 /// Create is used to generate a new token with the given parameters
 /// </summary>
 /// <param name="acl">The ACL entry to create</param>
 /// <returns>A write result containing the newly created ACL token</returns>
 public Task <WriteResult <string> > Create(ACLEntry acl, CancellationToken ct = default(CancellationToken))
 {
     return(Create(acl, WriteOptions.Default, ct));
 }
예제 #6
0
 /// <summary>
 /// Update is used to update the rules of an existing token
 /// </summary>
 /// <param name="acl">The ACL entry to update</param>
 /// <param name="q">Customized write options</param>
 /// <returns>An empty write result</returns>
 public Task <WriteResult> Update(ACLEntry acl, WriteOptions q)
 {
     return(_client.Put("/v1/acl/update", acl, q).Execute());
 }
예제 #7
0
 /// <summary>
 /// Update is used to update the rules of an existing token
 /// </summary>
 /// <param name="acl">The ACL entry to update</param>
 /// <returns>An empty write result</returns>
 public Task <WriteResult> Update(ACLEntry acl)
 {
     return(Update(acl, WriteOptions.Default));
 }
예제 #8
0
 /// <summary>
 /// Create is used to generate a new token with the given parameters
 /// </summary>
 /// <param name="acl">The ACL entry to create</param>
 /// <returns>A write result containing the newly created ACL token</returns>
 public Task <WriteResult <string> > Create(ACLEntry acl)
 {
     return(Create(acl, WriteOptions.Default));
 }
예제 #9
0
 /// <summary>
 /// Update is used to update the rules of an existing token
 /// </summary>
 /// <param name="acl">The ACL entry to update</param>
 /// <param name="q">Customized write options</param>
 /// <returns>An empty write result</returns>
 public WriteResult Update(ACLEntry acl, WriteOptions q)
 {
     return(_client.CreateInWrite <ACLEntry>("/v1/acl/update", acl, q).Execute());
 }
예제 #10
0
 /// <summary>
 /// Update is used to update the rules of an existing token
 /// </summary>
 /// <param name="acl">The ACL entry to update</param>
 /// <returns>An empty write result</returns>
 public WriteResult Update(ACLEntry acl)
 {
     return(Update(acl, WriteOptions.Empty));
 }
예제 #11
0
 /// <summary>
 /// Create is used to generate a new token with the given parameters
 /// </summary>
 /// <param name="acl">The ACL entry to create</param>
 /// <returns>A write result containing the newly created ACL token</returns>
 public WriteResult <string> Create(ACLEntry acl)
 {
     return(Create(acl, WriteOptions.Empty));
 }