Skip to main content

users

Overview

Nameusers
TypeResource
Iddigitalocean.databases.users

Fields

NameDatatypeDescription
namestringThe name of a database user.
mysql_settingsobject
passwordstringA randomly generated password for the database user.
rolestringA string representing the database user's role. The value will be either
"primary" or "normal".

Methods

NameAccessible byRequired ParamsDescription
get_userSELECTdatabase_cluster_uuid, usernameTo show information about an existing database user, send a GET request to
/v2/databases/$DATABASE_ID/users/$USERNAME.

Note: User management is not supported for Redis clusters.

The response will be a JSON object with a user key. This will be set to an object
containing the standard database user attributes.

For MySQL clusters, additional options will be contained in the mysql_settings
object.
list_usersSELECTdatabase_cluster_uuidTo list all of the users for your database cluster, send a GET request to
/v2/databases/$DATABASE_ID/users.

Note: User management is not supported for Redis clusters.

The result will be a JSON object with a users key. This will be set to an array
of database user objects, each of which will contain the standard database user attributes.

For MySQL clusters, additional options will be contained in the mysql_settings object.
add_userINSERTdatabase_cluster_uuid, data__nameTo add a new database user, send a POST request to /v2/databases/$DATABASE_ID/users
with the desired username.

Note: User management is not supported for Redis clusters.

When adding a user to a MySQL cluster, additional options can be configured in the
mysql_settings object.

The response will be a JSON object with a key called user. The value of this will be an
object that contains the standard attributes associated with a database user including
its randomly generated password.
delete_userDELETEdatabase_cluster_uuid, usernameTo remove a specific database user, send a DELETE request to
/v2/databases/$DATABASE_ID/users/$USERNAME.

A status of 204 will be given. This indicates that the request was processed
successfully, but that no response body is needed.

Note: User management is not supported for Redis clusters.
_get_userEXECdatabase_cluster_uuid, usernameTo show information about an existing database user, send a GET request to
/v2/databases/$DATABASE_ID/users/$USERNAME.

Note: User management is not supported for Redis clusters.

The response will be a JSON object with a user key. This will be set to an object
containing the standard database user attributes.

For MySQL clusters, additional options will be contained in the mysql_settings
object.
_list_usersEXECdatabase_cluster_uuidTo list all of the users for your database cluster, send a GET request to
/v2/databases/$DATABASE_ID/users.

Note: User management is not supported for Redis clusters.

The result will be a JSON object with a users key. This will be set to an array
of database user objects, each of which will contain the standard database user attributes.

For MySQL clusters, additional options will be contained in the mysql_settings object.
reset_authEXECdatabase_cluster_uuid, usernameTo reset the password for a database user, send a POST request to
/v2/databases/$DATABASE_ID/users/$USERNAME/reset_auth.

For mysql databases, the authentication method can be specifying by
including a key in the JSON body called mysql_settings with the auth_plugin
value specified.

The response will be a JSON object with a user key. This will be set to an
object containing the standard database user attributes.