Skip to main content

operations

Creates, updates, deletes, gets or lists an operations resource.

Overview

Nameoperations
TypeResource
Idgoogle.sqladmin.operations

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringAn identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation.
acquireSsrsLeaseContextobjectThe context for acquire SSRS lease operation, if applicable. (id: AcquireSsrsLeaseContext)
apiWarningobjectAn Admin API warning message. (id: ApiWarning)
backupContextobjectThe context for backup operation, if applicable. (id: BackupContext)
endTimestring (google-datetime)The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
errorobjectIf errors occurred during processing of this operation, this field will be populated. (id: OperationErrors)
exportContextobjectThe context for export operation, if applicable. (id: ExportContext)
importContextobjectThe context for import operation, if applicable. (id: ImportContext)
insertTimestring (google-datetime)The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
kindstringThis is always sql#operation.
operationTypestringThe 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
selfLinkstringThe URI of this resource.
startTimestring (google-datetime)The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
statusstringThe status of an operation.
subOperationTypeobjectOptional. The sub operation based on the operation type. (id: SqlSubOperationType)
targetIdstringName of the resource on which this operation runs.
targetLinkstring
targetProjectstringThe project ID of the target instance related to this operation.
userstringThe email address of the user who initiated this operation.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject, operationRetrieves an instance operation that has been performed on an instance.
listselectprojectinstance, maxResults, pageTokenLists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.
cancelexecproject, operationCancels an instance operation that has been performed on an instance.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
operationstring
projectstring
instancestring
maxResultsinteger (uint32)
pageTokenstring

SELECT examples

Retrieves an instance operation that has been performed on an instance.

SELECT
name,
acquireSsrsLeaseContext,
apiWarning,
backupContext,
endTime,
error,
exportContext,
importContext,
insertTime,
kind,
operationType,
selfLink,
startTime,
status,
subOperationType,
targetId,
targetLink,
targetProject,
user
FROM google.sqladmin.operations
WHERE project = '{{ project }}' -- required
AND operation = '{{ operation }}' -- required;

Lifecycle Methods

Cancels an instance operation that has been performed on an instance.

EXEC google.sqladmin.operations.cancel 
@project='{{ project }}' --required,
@operation='{{ operation }}' --required;