Exemplo n.º 1
0
 public InfluxDbGrant(string database, InfluxDbPrivileges privilege = InfluxDbPrivileges.None)
 {
     if (string.IsNullOrWhiteSpace(database))
     {
         throw new ArgumentNullException("database");
     }
     Database  = database;
     Privilege = privilege;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Revokes a privilege from a user for a given database.
 /// </summary>
 /// <param name="username">The user's name.</param>
 /// <param name="privilege">The privilege to revoke.</param>
 /// <param name="database">The name of the database the privilege should be revoked from.</param>
 /// <returns>The query response.</returns>
 public async override Task<InfluxDbApiResponse> RevokePrivilegeAsync(string username, 
     InfluxDbPrivileges privilege, string database)
 {
     if (string.IsNullOrWhiteSpace(username)) throw new ArgumentNullException("username");
     if (string.IsNullOrWhiteSpace(database)) throw new ArgumentNullException("database");
     var p = (InfluxData.Net.InfluxDb.Enums.Privileges)((int)(privilege));
     var response = await influx.User.RevokePrivilegeAsync(username, p, database).ConfigureAwait(false);
     return new InfluxDbApiResponse(response.Body, response.StatusCode, response.Success);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Revokes a privilege from a user for a given database.
 /// </summary>
 /// <param name="username">The user's name.</param>
 /// <param name="privilege">The privilege to revoke.</param>
 /// <param name="database">The name of the database the privilege should be revoked from.</param>
 /// <returns>The query response.</returns>
 public abstract Task <InfluxDbApiResponse> RevokePrivilegeAsync(string username, InfluxDbPrivileges privilege, string database);