Beispiel #1
0
        /// <summary>
        /// Create a new regular database user. Without any given permissions the new user is allowed to
        /// read and write to the database. The permission must be specified in regex which will match
        /// for the series. You have to specify either no permissions or both (readFrom and writeTo) permissions.
        /// </summary>
        /// <param name="database">The name of the database where this user is allowed.</param>
        /// <param name="name">The name of the new database user.</param>
        /// <param name="password">The password for this user.</param>
        /// <param name="permissions">An array of readFrom and writeTo permissions (in this order) and given in regex form.</param>
        /// <returns></returns>
        public async Task <InfluxDbApiResponse> CreateDatabaseUserAsync(string database, string name, string password, params string[] permissions)
        {
            var user = new User {
                Name = name, Password = password
            };

            user.SetPermissions(permissions);
            return(await _influxDbClient.CreateDatabaseUser(NoErrorHandlers, database, user));
        }
 public async Task <InfluxDbApiResponse> CreateDatabaseUser(IEnumerable <ApiResponseErrorHandlingDelegate> errorHandlers, string database, User user)
 {
     return(await _influxDbClient.CreateDatabaseUser(errorHandlers, database, user));
 }