users

Updates an existing user in a Cloud SQL instance.

put/v1/projects/{project}/instances/{instance}/users

Request

  • Base URL: https://sqladmin.googleapis.com
  • URL: https://sqladmin.googleapis.com/v1/projects/{project}/instances/{instance}/users
  • Auth: one of:
    • OAuth 2 (implicit, authorization URL https://accounts.google.com/o/oauth2/auth, scopes: https://www.googleapis.com/auth/cloud-platform) and OAuth 2 (authorization code, authorization URL https://accounts.google.com/o/oauth2/auth, token URL https://accounts.google.com/o/oauth2/token, scopes: https://www.googleapis.com/auth/cloud-platform)
    • OAuth 2 (implicit, authorization URL https://accounts.google.com/o/oauth2/auth, scopes: https://www.googleapis.com/auth/sqlservice.admin) and OAuth 2 (authorization code, authorization URL https://accounts.google.com/o/oauth2/auth, token URL https://accounts.google.com/o/oauth2/token, scopes: https://www.googleapis.com/auth/sqlservice.admin)

Path parameters

projectstring required

Project ID of the project that contains the instance.

instancestring required

Database instance ID. This does not include the project ID.

Query parameters

databaseRolesstring[]

Optional. List of database roles to grant to the user. body.database_roles will be ignored for update request.

hoststring

Optional. Host of the user in the instance.

locationstring

Optional. Region of the Cloud SQL instance.

namestring

Name of the user in the instance.

revokeExistingRolesboolean

Optional. Specifies whether to revoke existing roles that are not present in the database_roles field. If false or unset, the database roles specified in database_roles are added to the user's existing roles.

revokeExistingServerRolesboolean

Optional. Specifies whether to revoke existing roles that are not present in the server_roles field. If false or unset, the server roles specified in server_roles are added to the user's existing server roles.

serverRolesstring[]

Optional. The server roles to grant to the SQL Server login. Existing server roles will not be revoked if revoke_existing_roles is false. body.server_roles will be ignored for update request.

Request body

databaseRolesstring[]

Optional. Role memberships of the user

dualPasswordType'DUAL_PASSWORD_TYPE_UNSPECIFIED' | 'NO_MODIFY_DUAL_PASSWORD' | 'NO_DUAL_PASSWORD' | 'DUAL_PASSWORD'

Dual password status for the user.

etagstring

This field is deprecated and will be removed from a future version of the API.

hoststring

Optional. The host from which the user can connect. For insert operations, host defaults to an empty string. For update operations, host is specified as part of the request URL. The host name cannot be updated after insertion. For a MySQL instance, it's required; for a PostgreSQL or SQL Server instance, it's optional.

iamEmailstring

Optional. The full email for an IAM user. For normal database users, this will not be filled. Only applicable to MySQL database users.

iamStatus'IAM_STATUS_UNSPECIFIED' | 'INACTIVE' | 'ACTIVE'

Indicates if a group is active or inactive for IAM database authentication.

instancestring

The name of the Cloud SQL instance. This does not include the project ID. Can be omitted for update because it is already specified on the URL.

kindstring

This is always sql#user.

namestring

The name of the user in the Cloud SQL instance. Can be omitted for update because it is already specified in the URL.

passwordstring

The password for the user.

projectstring

The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable. Can be omitted for update because it is already specified on the URL.

serverRolesstring[]

Optional. The server roles for the SQL Server login.

type'BUILT_IN' | 'CLOUD_IAM_USER' | 'CLOUD_IAM_SERVICE_ACCOUNT' | 'CLOUD_IAM_GROUP' | 'CLOUD_IAM_GROUP_USER' | 'CLOUD_IAM_GROUP_SERVICE_ACCOUNT' | 'CLOUD_IAM_WORKFORCE_IDENTITY' | 'ENTRAID_USER'

The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type.

Response

Successful response

Changes

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/sqlservice.admin was removed from the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/sqlservice.admin was removed from the endpoint's security scheme Oauth2c

    • breaking

      removed the request body

    • breaking

      removed the media type */* for the response with the status

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/sqlservice.admin was removed from the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/sqlservice.admin was removed from the endpoint's security scheme Oauth2c