users

Creates a new user in a Cloud SQL instance.

post/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

locationstring

Optional. Region of the Cloud SQL instance.

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