- Resource: Operation
- SqlOperationStatus
- OperationErrors
- ApiWarning
- SqlApiWarningCode
- SqlOperationType
- ImportContext
- SqlFileType
- ExportContext
- BackupContext
- AcquireSsrsLeaseContext
- SqlSubOperationType
- SqlMaintenanceType
- Methods
Resource: Operation
An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
JSON representation |
---|
{ "kind": string, "targetLink": string, "status": enum ( |
Fields | |
---|---|
kind |
This is always |
targetLink |
|
status |
The status of an operation. |
user |
The email address of the user who initiated this operation. |
insertTime |
The time this operation was enqueued in UTC timezone in RFC 3339 format, for example Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
startTime |
The time this operation actually started in UTC timezone in RFC 3339 format, for example Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
endTime |
The time this operation finished in UTC timezone in RFC 3339 format, for example Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
error |
If errors occurred during processing of this operation, this field will be populated. |
apiWarning |
An Admin API warning message. |
operationType |
The type of the operation. Valid values are: * |
importContext |
The context for import operation, if applicable. |
exportContext |
The context for export operation, if applicable. |
backupContext |
The context for backup operation, if applicable. |
name |
An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
targetId |
Name of the resource on which this operation runs. |
selfLink |
The URI of this resource. |
targetProject |
The project ID of the target instance related to this operation. |
acquireSsrsLeaseContext |
The context for acquire SSRS lease operation, if applicable. |
subOperationType |
Optional. The sub operation based on the operation type. |
SqlOperationStatus
The status of an operation.
Enums | |
---|---|
SQL_OPERATION_STATUS_UNSPECIFIED |
The state of the operation is unknown. |
PENDING |
The operation has been queued, but has not started yet. |
RUNNING |
The operation is running. |
DONE |
The operation completed. |
OperationErrors
Database instance operation errors list wrapper.
JSON representation |
---|
{
"kind": string,
"errors": [
{
object ( |
Fields | |
---|---|
kind |
This is always |
errors[] |
The list of errors encountered while processing this operation. |
ApiWarning
An Admin API warning message.
JSON representation |
---|
{
"code": enum ( |
Fields | |
---|---|
code |
Code to uniquely identify the warning type. |
message |
The warning message. |
region |
The region name for REGION_UNREACHABLE warning. |
SqlApiWarningCode
Enums | |
---|---|
SQL_API_WARNING_CODE_UNSPECIFIED |
An unknown or unset warning type from Cloud SQL API. |
REGION_UNREACHABLE |
Warning when one or more regions are not reachable. The returned result set may be incomplete. |
MAX_RESULTS_EXCEEDS_LIMIT |
Warning when user provided maxResults parameter exceeds the limit. The returned result set may be incomplete. |
COMPROMISED_CREDENTIALS |
Warning when user tries to create/update a user with credentials that have previously been compromised by a public data breach. |
INTERNAL_STATE_FAILURE |
Warning when the operation succeeds but some non-critical workflow state failed. |
SqlOperationType
The type of Cloud SQL operation.
Enums | |
---|---|
SQL_OPERATION_TYPE_UNSPECIFIED |
Unknown operation type. |
IMPORT |
Imports data into a Cloud SQL instance. |
EXPORT |
Exports data from a Cloud SQL instance to a Cloud Storage bucket. |
CREATE |
Creates a new Cloud SQL instance. |
UPDATE |
Updates the settings of a Cloud SQL instance. |
DELETE |
Deletes a Cloud SQL instance. |
RESTART |
Restarts the Cloud SQL instance. |
BACKUP |
|
SNAPSHOT |
|
BACKUP_VOLUME |
Performs instance backup. |
DELETE_VOLUME |
Deletes an instance backup. |
RESTORE_VOLUME |
Restores an instance backup. |
INJECT_USER |
Injects a privileged user in mysql for MOB instances. |
CLONE |
Clones a Cloud SQL instance. |
STOP_REPLICA |
Stops replication on a Cloud SQL read replica instance. |
START_REPLICA |
Starts replication on a Cloud SQL read replica instance. |
PROMOTE_REPLICA |
Promotes a Cloud SQL replica instance. |
CREATE_REPLICA |
Creates a Cloud SQL replica instance. |
CREATE_USER |
Creates a new user in a Cloud SQL instance. |
DELETE_USER |
Deletes a user from a Cloud SQL instance. |
UPDATE_USER |
Updates an existing user in a Cloud SQL instance. |
CREATE_DATABASE |
Creates a database in the Cloud SQL instance. |
DELETE_DATABASE |
Deletes a database in the Cloud SQL instance. |
UPDATE_DATABASE |
Updates a database in the Cloud SQL instance. |
FAILOVER |
Performs failover of an HA-enabled Cloud SQL failover replica. |
DELETE_BACKUP |
Deletes the backup taken by a backup run. |
RECREATE_REPLICA |
|
TRUNCATE_LOG |
Truncates a general or slow log table in MySQL. |
DEMOTE_MASTER |
Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server. |
MAINTENANCE |
Indicates that the instance is currently in maintenance. Maintenance typically causes the instance to be unavailable for 1-3 minutes. |
ENABLE_PRIVATE_IP |
This field is deprecated, and will be removed in future version of API. |
DEFER_MAINTENANCE |
|
CREATE_CLONE |
Creates clone instance. |
RESCHEDULE_MAINTENANCE |
Reschedule maintenance to another time. |
START_EXTERNAL_SYNC |
Starts external sync of a Cloud SQL EM replica to an external primary instance. |
LOG_CLEANUP |
Recovers logs from an instance's old data disk. |
AUTO_RESTART |
Performs auto-restart of an HA-enabled Cloud SQL database for auto recovery. |
REENCRYPT |
Re-encrypts CMEK instances with latest key version. |
SWITCHOVER |
Switches the roles of the primary and replica pair. The target instance should be the replica. |
UPDATE_BACKUP |
Update a backup. |
ACQUIRE_SSRS_LEASE |
Acquire a lease for the setup of SQL Server Reporting Services (SSRS). |
RELEASE_SSRS_LEASE |
Release a lease for the setup of SQL Server Reporting Services (SSRS). |
RECONFIGURE_OLD_PRIMARY |
Reconfigures old primary after a promote replica operation. Effect of a promote operation to the old primary is executed in this operation, asynchronously from the promote replica operation executed to the replica. |
CLUSTER_MAINTENANCE |
Indicates that the instance, its read replicas, and its cascading replicas are in maintenance. Maintenance typically gets initiated on groups of replicas first, followed by the primary instance. For each instance, maintenance typically causes the instance to be unavailable for 1-3 minutes. |
SELF_SERVICE_MAINTENANCE |
Indicates that the instance (and any of its replicas) are currently in maintenance. This is initiated as a self-service request by using SSM. Maintenance typically causes the instance to be unavailable for 1-3 minutes. |
SWITCHOVER_TO_REPLICA |
Switches a primary instance to a replica. This operation runs as part of a switchover operation to the original primary instance. |
MAJOR_VERSION_UPGRADE |
Updates the major version of a Cloud SQL instance. |
ADVANCED_BACKUP |
Deprecated: ADVANCED_BACKUP is deprecated. Use ENHANCED_BACKUP instead. |
MANAGE_BACKUP |
Changes the BackupTier of a Cloud SQL instance. |
ENHANCED_BACKUP |
Creates a backup for an Enhanced BackupTier Cloud SQL instance. |
REPAIR_READ_POOL |
Repairs entire read pool or specified read pool nodes in the read pool. |
CREATE_READ_POOL |
Creates a Cloud SQL read pool instance. |
ImportContext
Database instance import context.
JSON representation |
---|
{ "uri": string, "database": string, "kind": string, "fileType": enum ( |
Fields | |
---|---|
uri |
Path to the import file in Cloud Storage, in the form |
database |
The target database for the import. If |
kind |
This is always |
fileType |
The file type for the specified uri. * |
csvImportOptions |
Options for importing data as CSV. |
csvImportOptions.table |
The table to which CSV data is imported. |
csvImportOptions.columns[] |
The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
csvImportOptions.escapeCharacter |
Specifies the character that should appear before a data character that needs to be escaped. |
csvImportOptions.quoteCharacter |
Specifies the quoting character to be used when a data value is quoted. |
csvImportOptions.fieldsTerminatedBy |
Specifies the character that separates columns within each row (line) of the file. |
csvImportOptions.linesTerminatedBy |
This is used to separate lines. If a line does not contain all fields, the rest of the columns are set to their default values. |
importUser |
The PostgreSQL user for this import operation. PostgreSQL instances only. |
bakImportOptions |
Import parameters specific to SQL Server .BAK files |
bakImportOptions.encryptionOptions |
|
bakImportOptions.encryptionOptions.certPath |
Path to the Certificate (.cer) in Cloud Storage, in the form |
bakImportOptions.encryptionOptions.pvkPath |
Path to the Certificate Private Key (.pvk) in Cloud Storage, in the form |
bakImportOptions.encryptionOptions.pvkPassword |
Password that encrypts the private key |
bakImportOptions.encryptionOptions.keepEncrypted |
Optional. Whether the imported file remains encrypted. |
bakImportOptions.striped |
Whether or not the backup set being restored is striped. Applies only to Cloud SQL for SQL Server. |
bakImportOptions.noRecovery |
Whether or not the backup importing will restore database with NORECOVERY option Applies only to Cloud SQL for SQL Server. |
bakImportOptions.recoveryOnly |
Whether or not the backup importing request will just bring database online without downloading Bak content only one of "noRecovery" and "recoveryOnly" can be true otherwise error will return. Applies only to Cloud SQL for SQL Server. |
bakImportOptions.bakType |
Type of the bak content, FULL or DIFF. |
bakImportOptions.stopAt |
Optional. The timestamp when the import should stop. This timestamp is in the RFC 3339 format (for example, Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
bakImportOptions.stopAtMark |
Optional. The marked transaction where the import should stop. This field is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL Server only. |
sqlImportOptions |
Optional. Options for importing data from SQL statements. |
sqlImportOptions.threads |
Optional. The number of threads to use for parallel import. |
sqlImportOptions.parallel |
Optional. Whether or not the import should be parallel. |
sqlImportOptions.postgresImportOptions |
Optional. Options for importing from a Cloud SQL for PostgreSQL instance. |
sqlImportOptions.postgresImportOptions.clean |
Optional. The --clean flag for the pg_restore utility. This flag applies only if you enabled Cloud SQL to import files in parallel. |
sqlImportOptions.postgresImportOptions.ifExists |
Optional. The --if-exists flag for the pg_restore utility. This flag applies only if you enabled Cloud SQL to import files in parallel. |
tdeImportOptions |
Optional. Import parameters specific to SQL Server .TDE files Import parameters specific to SQL Server TDE certificates |
tdeImportOptions.certificatePath |
Required. Path to the TDE certificate public key in the form gs://bucketName/fileName. The instance must have read access to the file. Applicable only for SQL Server instances. |
tdeImportOptions.privateKeyPath |
Required. Path to the TDE certificate private key in the form gs://bucketName/fileName. The instance must have read access to the file. Applicable only for SQL Server instances. |
tdeImportOptions.privateKeyPassword |
Required. Password that encrypts the private key. |
tdeImportOptions.name |
Required. Certificate name. Applicable only for SQL Server instances. |
SqlFileType
Enums | |
---|---|
SQL_FILE_TYPE_UNSPECIFIED |
Unknown file type. |
SQL |
File containing SQL statements. |
CSV |
File in CSV format. |
BAK |
|
TDE |
TDE certificate. |
ExportContext
Database instance export context.
JSON representation |
---|
{ "uri": string, "databases": [ string ], "kind": string, "sqlExportOptions": { "tables": [ string ], "schemaOnly": boolean, "mysqlExportOptions": { "masterData": integer }, "threads": integer, "parallel": boolean, "postgresExportOptions": { "clean": boolean, "ifExists": boolean } }, "csvExportOptions": { "selectQuery": string, "escapeCharacter": string, "quoteCharacter": string, "fieldsTerminatedBy": string, "linesTerminatedBy": string }, "fileType": enum ( |
Fields | |
---|---|
uri |
The path to the file in Trusted Cloud Storage where the export will be stored. The URI is in the form |
databases[] |
Databases to be exported. |
kind |
This is always |
sqlExportOptions |
Options for exporting data as SQL statements. |
sqlExportOptions.tables[] |
Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
sqlExportOptions.schemaOnly |
Export only schemas. |
sqlExportOptions.mysqlExportOptions |
|
sqlExportOptions.mysqlExportOptions.masterData |
Option to include SQL statement required to set up replication. If set to |
sqlExportOptions.threads |
Optional. The number of threads to use for parallel export. |
sqlExportOptions.parallel |
Optional. Whether or not the export should be parallel. |
sqlExportOptions.postgresExportOptions |
Optional. Options for exporting from a Cloud SQL for PostgreSQL instance. |
sqlExportOptions.postgresExportOptions.clean |
Optional. Use this option to include DROP
SQL statements. Use these statements to delete database objects before running the import operation. |
sqlExportOptions.postgresExportOptions.ifExists |
Optional. Option to include an IF EXISTS SQL statement with each DROP statement produced by clean. |
csvExportOptions |
Options for exporting data as CSV. |
csvExportOptions.selectQuery |
The select query used to extract the data. |
csvExportOptions.escapeCharacter |
Specifies the character that should appear before a data character that needs to be escaped. |
csvExportOptions.quoteCharacter |
Specifies the quoting character to be used when a data value is quoted. |
csvExportOptions.fieldsTerminatedBy |
Specifies the character that separates columns within each row (line) of the file. |
csvExportOptions.linesTerminatedBy |
This is used to separate lines. If a line does not contain all fields, the rest of the columns are set to their default values. |
fileType |
The file type for the specified uri. |
offload |
Whether to perform a serverless export. |
bakExportOptions |
Options for exporting data as BAK files. |
bakExportOptions.striped |
Whether or not the export should be striped. |
bakExportOptions.stripeCount |
Option for specifying how many stripes to use for the export. If blank, and the value of the striped field is true, the number of stripes is automatically chosen. |
bakExportOptions.bakType |
Type of this bak file will be export, FULL or DIFF, SQL Server only |
bakExportOptions.copyOnly |
Deprecated: copyOnly is deprecated. Use differentialBase instead |
bakExportOptions.differentialBase |
Whether or not the backup can be used as a differential base copyOnly backup can not be served as differential base |
bakExportOptions.exportLogStartTime |
Optional. The begin timestamp when transaction log will be included in the export operation. RFC 3339 format (for example, Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
bakExportOptions.exportLogEndTime |
Optional. The end timestamp when transaction log will be included in the export operation. RFC 3339 format (for example, Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
tdeExportOptions |
Optional. Export parameters specific to SQL Server TDE certificates |
tdeExportOptions.certificatePath |
Required. Path to the TDE certificate public key in the form gs://bucketName/fileName. The instance must have write access to the location. Applicable only for SQL Server instances. |
tdeExportOptions.privateKeyPath |
Required. Path to the TDE certificate private key in the form gs://bucketName/fileName. The instance must have write access to the location. Applicable only for SQL Server instances. |
tdeExportOptions.privateKeyPassword |
Required. Password that encrypts the private key. |
tdeExportOptions.name |
Required. Certificate name. Applicable only for SQL Server instances. |
BackupContext
Backup context.
JSON representation |
---|
{ "backupId": string, "kind": string, "name": string } |
Fields | |
---|---|
backupId |
The identifier of the backup. |
kind |
This is always |
name |
The name of the backup. Format: projects/{project}/backups/{backup} |
AcquireSsrsLeaseContext
Acquire SSRS lease context.
JSON representation |
---|
{ "setupLogin": string, "serviceLogin": string, "reportDatabase": string, "duration": string } |
Fields | |
---|---|
setupLogin |
The username to be used as the setup login to connect to the database server for SSRS setup. |
serviceLogin |
The username to be used as the service login to connect to the report database for SSRS setup. |
reportDatabase |
The report database to be used for the SSRS setup. |
duration |
Lease duration needed for the SSRS setup. A duration in seconds with up to nine fractional digits, ending with ' |
SqlSubOperationType
The sub operation type based on the operation type.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field sub_operation_details . Sub operation details corresponding to the operation type. sub_operation_details can be only one of the following: |
|
maintenanceType |
The type of maintenance to be performed on the instance. |
SqlMaintenanceType
The type of maintenance to be performed on the instance.
Enums | |
---|---|
SQL_MAINTENANCE_TYPE_UNSPECIFIED |
Maintenance type is unspecified. |
INSTANCE_MAINTENANCE |
Indicates that a standalone instance is undergoing maintenance. The instance can be either a primary instance or a replica. |
REPLICA_INCLUDED_MAINTENANCE |
Indicates that the primary instance and all of its replicas, including cascading replicas, are undergoing maintenance. Maintenance is performed on groups of replicas first, followed by the primary instance. |
INSTANCE_SELF_SERVICE_MAINTENANCE |
Indicates that the standalone instance is undergoing maintenance, initiated by self-service. The instance can be either a primary instance or a replica. |
REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE |
Indicates that the primary instance and all of its replicas are undergoing maintenance, initiated by self-service. Maintenance is performed on groups of replicas first, followed by the primary instance. |
Methods |
|
---|---|
|
SQL Server, private server access, HDD, data cache, legacy HA, serverless exports, multi-region backups, cross-region replicas are not supported. Cancels an instance operation that has been performed on an instance. |
|
SQL Server, private server access, HDD, data cache, legacy HA, serverless exports, multi-region backups, cross-region replicas are not supported. Retrieves an instance operation that has been performed on an instance. |
|
SQL Server, private server access, HDD, data cache, legacy HA, serverless exports, multi-region backups, cross-region replicas are not supported. Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time. |