operations
Creates, updates, deletes, gets or lists an operations
resource.
Overview
Name | operations |
Type | Resource |
Id | google.sqladmin.operations |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
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. |
acquireSsrsLeaseContext | object | The context for acquire SSRS lease operation, if applicable. (id: AcquireSsrsLeaseContext) |
apiWarning | object | An Admin API warning message. (id: ApiWarning) |
backupContext | object | The context for backup operation, if applicable. (id: BackupContext) |
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 | object | If errors occurred during processing of this operation, this field will be populated. (id: OperationErrors) |
exportContext | object | The context for export operation, if applicable. (id: ExportContext) |
importContext | object | The context for import operation, if applicable. (id: ImportContext) |
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 . |
operationType | string | 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 |
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 . |
status | string | The status of an operation. |
subOperationType | object | Optional. The sub operation based on the operation type. (id: SqlSubOperationType) |
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. |
Successful response
Name | Datatype | Description |
---|---|---|
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. |
acquireSsrsLeaseContext | object | The context for acquire SSRS lease operation, if applicable. (id: AcquireSsrsLeaseContext) |
apiWarning | object | An Admin API warning message. (id: ApiWarning) |
backupContext | object | The context for backup operation, if applicable. (id: BackupContext) |
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 | object | If errors occurred during processing of this operation, this field will be populated. (id: OperationErrors) |
exportContext | object | The context for export operation, if applicable. (id: ExportContext) |
importContext | object | The context for import operation, if applicable. (id: ImportContext) |
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 . |
operationType | string | 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 |
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 . |
status | string | The status of an operation. |
subOperationType | object | Optional. The sub operation based on the operation type. (id: SqlSubOperationType) |
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. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | project , operation | Retrieves an instance operation that has been performed on an instance. | |
list | select | project | instance , maxResults , pageToken | Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time. |
cancel | exec | project , operation | Cancels 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.
Name | Datatype | Description |
---|---|---|
operation | string | |
project | string | |
instance | string | |
maxResults | integer (uint32) | |
pageToken | string |
SELECT
examples
- get
- list
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;
Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.
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 instance = '{{ instance }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}';
Lifecycle Methods
- cancel
Cancels an instance operation that has been performed on an instance.
EXEC google.sqladmin.operations.cancel
@project='{{ project }}' --required,
@operation='{{ operation }}' --required;