users

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

Changed on

Updates an existing user in a Cloud SQL instance.

Request

  • Base URL
    https://sqladmin.googleapis.com
  • Auth
    • OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/cloud-platform
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/cloud-platform
    • or OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/sqlservice.admin
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/sqlservice.admin

Path parameters

project, string required

Project ID of the project that contains the instance.

instance, string required

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

Query parameters

$.xgafv, '1' | '2'

V1 error format.

access_token, string

OAuth access token.

alt, 'json' | 'media' | 'proto'

Data format for response.

callback, string

JSONP

fields, string

Selector specifying which fields to include in a partial response.

key, string

API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

oauth_token, string

OAuth 2.0 token for the current user.

prettyPrint, boolean

Returns response with indentations and line breaks.

quotaUser, string

Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

uploadType, string

Legacy upload protocol for media (e.g. "media", "multipart").

upload_protocol, string

Upload protocol for media (e.g. "raw", "multipart").

databaseRoles, string[]

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

host, string

Optional. Host of the user in the instance.

location, string

Optional. Region of the Cloud SQL instance.

name, string

Name of the user in the instance.

revokeExistingRoles, boolean

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.

revokeExistingServerRoles, boolean

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.

serverRoles, string[]

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

User required

A Cloud SQL user resource.

databaseRoles, string[]

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.

etag, string

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

host, string

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.

iamEmail, string

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.

instance, string

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.

kind, string

This is always sql#user.

name, string

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

password, string

The password for the user.

passwordPolicy, UserPasswordValidationPolicy

User level password validation policy.

project, string

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.

serverRoles, string[]

Optional. The server roles for the SQL Server login.

sqlserverUserDetails, SqlServerUserDetails

Represents a Sql Server user on the Cloud SQL instance.

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' | 'ACTIVE_DIRECTORY_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

Operation required

An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.

acquireSsrsLeaseContext, AcquireSsrsLeaseContext

Acquire SSRS lease context.

apiWarning, ApiWarning

An Admin API warning message.

backupContext, BackupContext

Backup context.

endTime, string google-datetime

The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.

error, OperationErrors

Database instance operation errors list wrapper.

exportContext, ExportContext

Database instance export context.

importContext, ImportContext

Database instance import context.

insertTime, string google-datetime

The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.

kind, string

This is always sql#operation.

name, string

An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation.

operationType, 'SQL_OPERATION_TYPE_UNSPECIFIED' | 'IMPORT' | 'EXPORT' | 'CREATE' | 'UPDATE' | 'DELETE' | 'RESTART' | 'BACKUP' | 'SNAPSHOT' | 'BACKUP_VOLUME' | 'DELETE_VOLUME' | 'RESTORE_VOLUME' | 'INJECT_USER' | 'CLONE' | 'STOP_REPLICA' | 'START_REPLICA' | 'PROMOTE_REPLICA' | 'CREATE_REPLICA' | 'CREATE_USER' | 'DELETE_USER' | 'UPDATE_USER' | 'CREATE_DATABASE' | 'DELETE_DATABASE' | 'UPDATE_DATABASE' | 'FAILOVER' | 'DELETE_BACKUP' | 'RECREATE_REPLICA' | 'TRUNCATE_LOG' | 'DEMOTE_MASTER' | 'MAINTENANCE' | 'ENABLE_PRIVATE_IP' | 'DEFER_MAINTENANCE' | 'CREATE_CLONE' | 'RESCHEDULE_MAINTENANCE' | 'START_EXTERNAL_SYNC' | 'LOG_CLEANUP' | 'AUTO_RESTART' | 'REENCRYPT' | 'SWITCHOVER' | 'UPDATE_BACKUP' | 'ACQUIRE_SSRS_LEASE' | 'RELEASE_SSRS_LEASE' | 'RECONFIGURE_OLD_PRIMARY' | 'CLUSTER_MAINTENANCE' | 'SELF_SERVICE_MAINTENANCE' | 'SWITCHOVER_TO_REPLICA' | 'MAJOR_VERSION_UPGRADE' | 'ADVANCED_BACKUP' | 'MANAGE_BACKUP' | 'ENHANCED_BACKUP' | 'REPAIR_READ_POOL' | 'CREATE_READ_POOL' | 'PRE_CHECK_MAJOR_VERSION_UPGRADE' | 'SETUP_MIGRATION' | 'CREATE_BLUE_GREEN_DEPLOYMENT' | 'SWITCHOVER_BLUE_GREEN_DEPLOYMENT' | 'DELETE_BLUE_GREEN_DEPLOYMENT' | 'RECONCILE_NETWORKING'

The type of the operation. Valid values are: * CREATE * DELETE * UPDATE * RESTART * IMPORT * EXPORT * BACKUP_VOLUME * RESTORE_VOLUME * CREATE_USER * DELETE_USER * CREATE_DATABASE * DELETE_DATABASE

preCheckMajorVersionUpgradeContext, PreCheckMajorVersionUpgradeContext

Pre-check major version upgrade context.

selfLink, string

The URI of this resource.

startTime, string google-datetime

The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.

startWorkloadCaptureContext, StartWorkloadCaptureContext

The context for the StartWorkloadCapture operation, which contains details to start recording the workload (SQL queries) on a Cloud SQL instance.

startWorkloadReplayContext, StartWorkloadReplayContext

The context for the StartWorkloadReplay operation, which contains details about starting the execution of a captured workload (recorded read and write SQL queries) on a replay instance (the Cloud SQL instance where the recorded SQL queries are executed).

status, 'SQL_OPERATION_STATUS_UNSPECIFIED' | 'PENDING' | 'RUNNING' | 'DONE'

The status of an operation.

stopWorkloadCaptureContext, StopWorkloadCaptureContext

The context for the StopWorkloadCapture operation, which contains details to stop recording the workload (SQL queries) on a Cloud SQL instance.

stopWorkloadReplayContext, StopWorkloadReplayContext

The context for the StopWorkloadReplay operation, which represents an operation that stops an active workload replay on a target Cloud SQL replay instance.

subOperationType, SqlSubOperationType

The sub operation type based on the operation type.

targetId, string

Name of the resource on which this operation runs.

targetLink, string
targetProject, string

The project ID of the target instance related to this operation.

user, string

The email address of the user who initiated this operation.

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

    1 more change in this revision