Compute Cloud API, gRPC: SnapshotService
A set of methods for managing Snapshot resources.
Call | Description |
---|---|
Get | Returns the specified Snapshot resource. |
List | Retrieves the list of Snapshot resources in the specified folder. |
Create | Creates a snapshot of the specified disk. |
Update | Updates the specified snapshot. |
Delete | Deletes the specified snapshot. |
ListOperations | Lists operations for the specified snapshot. |
Calls SnapshotService
Get
Returns the specified Snapshot resource.
To get the list of available Snapshot resources, make a List request.
rpc Get (GetSnapshotRequest) returns (Snapshot)
GetSnapshotRequest
Field | Description |
---|---|
snapshot_id | string Required. ID of the Snapshot resource to return. To get the snapshot ID, use a SnapshotService.List request. The maximum string length in characters is 50. |
Snapshot
Field | Description |
---|---|
id | string ID of the snapshot. |
folder_id | string ID of the folder that the snapshot belongs to. |
created_at | google.protobuf.Timestamp |
name | string Name of the snapshot. 1-63 characters long. |
description | string Description of the snapshot. 0-256 characters long. |
labels | map<string,string> Resource labels as key:value pairs. Maximum of 64 per resource. |
storage_size | int64 Size of the snapshot, specified in bytes. |
disk_size | int64 Size of the disk when the snapshot was created, specified in bytes. |
product_ids[] | string License IDs that indicate which licenses are attached to this resource. License IDs are used to calculate additional charges for the use of the virtual machine. The correct license ID is generated by the platform. IDs are inherited by new resources created from this resource. If you know the license IDs, specify them when you create the image. For example, if you create a disk image using a third-party utility and load it into Object Storage, the license IDs will be lost. You can specify them in the compute.v1.ImageService.Create request. |
status | enum Status Current status of the snapshot.
|
source_disk_id | string ID of the source disk used to create this snapshot. |
List
Retrieves the list of Snapshot resources in the specified folder.
rpc List (ListSnapshotsRequest) returns (ListSnapshotsResponse)
ListSnapshotsRequest
Field | Description |
---|---|
folder_id | string Required. ID of the folder to list snapshots in. To get the folder ID, use a resourcemanager.v1.FolderService.List request. The maximum string length in characters is 50. |
page_size | int64 The maximum number of results per page to return. If the number of available results is larger than page_size , the service returns a ListSnapshotsResponse.next_page_token that can be used to get the next page of results in subsequent list requests. The maximum value is 1000. |
page_token | string Page token. To get the next page of results, set page_token to the ListSnapshotsResponse.next_page_token returned by a previous list request. The maximum string length in characters is 100. |
filter | string A filter expression that filters resources listed in the response. The expression consists of one or more conditions united by AND operator: <condition1> [AND <condition2> [<...> AND <conditionN>]] . Each condition has the form <field> <operator> <value> , where:
" ) or single (' ) quotes. C-style escape sequences are supported (\" turns to " , \' to ' , \\ to backslash). The maximum string length in characters is 1000. |
order_by | string By which column the listing should be ordered and in which direction, format is "createdAt desc". "id asc" if omitted. The default sorting order is ascending The maximum string length in characters is 100. |
ListSnapshotsResponse
Field | Description |
---|---|
snapshots[] | Snapshot List of snapshots. |
next_page_token | string This token allows you to get the next page of results for list requests. If the number of results is larger than ListSnapshotsRequest.page_size, use the next_page_token as the value for the ListSnapshotsRequest.page_token query parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results. |
Snapshot
Field | Description |
---|---|
id | string ID of the snapshot. |
folder_id | string ID of the folder that the snapshot belongs to. |
created_at | google.protobuf.Timestamp |
name | string Name of the snapshot. 1-63 characters long. |
description | string Description of the snapshot. 0-256 characters long. |
labels | map<string,string> Resource labels as key:value pairs. Maximum of 64 per resource. |
storage_size | int64 Size of the snapshot, specified in bytes. |
disk_size | int64 Size of the disk when the snapshot was created, specified in bytes. |
product_ids[] | string License IDs that indicate which licenses are attached to this resource. License IDs are used to calculate additional charges for the use of the virtual machine. The correct license ID is generated by the platform. IDs are inherited by new resources created from this resource. If you know the license IDs, specify them when you create the image. For example, if you create a disk image using a third-party utility and load it into Object Storage, the license IDs will be lost. You can specify them in the compute.v1.ImageService.Create request. |
status | enum Status Current status of the snapshot.
|
source_disk_id | string ID of the source disk used to create this snapshot. |
Create
Creates a snapshot of the specified disk.
rpc Create (CreateSnapshotRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:CreateSnapshotMetadata
Operation.response:Snapshot
CreateSnapshotRequest
Field | Description |
---|---|
folder_id | string Required. ID of the folder to create a snapshot in. To get the folder ID use a resourcemanager.v1.FolderService.List request. The maximum string length in characters is 50. |
disk_id | string Required. ID of the disk to create the snapshot from. To get the disk ID use a compute.v1.DiskService.List request. The maximum string length in characters is 50. |
name | string Name of the snapshot. Value must match the regular expression |[a-z]([-a-z0-9]{0,61}[a-z0-9])? . |
description | string Description of the snapshot. The maximum string length in characters is 256. |
labels | map<string,string> Resource labels as key:value pairs. No more than 64 per resource. The maximum string length in characters for each value is 63. Each value must match the regular expression [-_./\\@0-9a-z]* . The string length in characters for each key must be 1-63. Each key must match the regular expression [a-z][-_./\\@0-9a-z]* . |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any if operation finished successfully. |
CreateSnapshotMetadata
Field | Description |
---|---|
snapshot_id | string ID of the snapshot that is being created. |
disk_id | string ID of the source disk used to create this snapshot. |
Snapshot
Field | Description |
---|---|
id | string ID of the snapshot. |
folder_id | string ID of the folder that the snapshot belongs to. |
created_at | google.protobuf.Timestamp |
name | string Name of the snapshot. 1-63 characters long. |
description | string Description of the snapshot. 0-256 characters long. |
labels | map<string,string> Resource labels as key:value pairs. Maximum of 64 per resource. |
storage_size | int64 Size of the snapshot, specified in bytes. |
disk_size | int64 Size of the disk when the snapshot was created, specified in bytes. |
product_ids[] | string License IDs that indicate which licenses are attached to this resource. License IDs are used to calculate additional charges for the use of the virtual machine. The correct license ID is generated by the platform. IDs are inherited by new resources created from this resource. If you know the license IDs, specify them when you create the image. For example, if you create a disk image using a third-party utility and load it into Object Storage, the license IDs will be lost. You can specify them in the compute.v1.ImageService.Create request. |
status | enum Status Current status of the snapshot.
|
source_disk_id | string ID of the source disk used to create this snapshot. |
Update
Updates the specified snapshot.
Values of omitted parameters are not changed.
rpc Update (UpdateSnapshotRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:UpdateSnapshotMetadata
Operation.response:Snapshot
UpdateSnapshotRequest
Field | Description |
---|---|
snapshot_id | string Required. ID of the Snapshot resource to update. To get the snapshot ID use a SnapshotService.List request. The maximum string length in characters is 50. |
update_mask | google.protobuf.FieldMask Field mask that specifies which fields of the Snapshot resource are going to be updated. |
name | string Name of the snapshot. Value must match the regular expression |[a-z]([-a-z0-9]{0,61}[a-z0-9])? . |
description | string Description of the snapshot. The maximum string length in characters is 256. |
labels | map<string,string> Resource labels as key:value pairs. Existing set of labels is completely replaced by the provided set. No more than 64 per resource. The maximum string length in characters for each value is 63. Each value must match the regular expression [-_./\\@0-9a-z]* . The string length in characters for each key must be 1-63. Each key must match the regular expression [a-z][-_./\\@0-9a-z]* . |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any if operation finished successfully. |
UpdateSnapshotMetadata
Field | Description |
---|---|
snapshot_id | string ID of the Snapshot resource that is being updated. |
Snapshot
Field | Description |
---|---|
id | string ID of the snapshot. |
folder_id | string ID of the folder that the snapshot belongs to. |
created_at | google.protobuf.Timestamp |
name | string Name of the snapshot. 1-63 characters long. |
description | string Description of the snapshot. 0-256 characters long. |
labels | map<string,string> Resource labels as key:value pairs. Maximum of 64 per resource. |
storage_size | int64 Size of the snapshot, specified in bytes. |
disk_size | int64 Size of the disk when the snapshot was created, specified in bytes. |
product_ids[] | string License IDs that indicate which licenses are attached to this resource. License IDs are used to calculate additional charges for the use of the virtual machine. The correct license ID is generated by the platform. IDs are inherited by new resources created from this resource. If you know the license IDs, specify them when you create the image. For example, if you create a disk image using a third-party utility and load it into Object Storage, the license IDs will be lost. You can specify them in the compute.v1.ImageService.Create request. |
status | enum Status Current status of the snapshot.
|
source_disk_id | string ID of the source disk used to create this snapshot. |
Delete
Deletes the specified snapshot.
Deleting a snapshot removes its data permanently and is irreversible.
rpc Delete (DeleteSnapshotRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:DeleteSnapshotMetadata
Operation.response:google.protobuf.Empty
DeleteSnapshotRequest
Field | Description |
---|---|
snapshot_id | string Required. ID of the snapshot to delete. To get the snapshot ID, use a SnapshotService.List request. The maximum string length in characters is 50. |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any if operation finished successfully. |
DeleteSnapshotMetadata
Field | Description |
---|---|
snapshot_id | string ID of the snapshot that is being deleted. |
ListOperations
Lists operations for the specified snapshot.
rpc ListOperations (ListSnapshotOperationsRequest) returns (ListSnapshotOperationsResponse)
ListSnapshotOperationsRequest
Field | Description |
---|---|
snapshot_id | string Required. ID of the Snapshot resource to list operations for. The maximum string length in characters is 50. |
page_size | int64 The maximum number of results per page to return. If the number of available results is larger than page_size , the service returns a ListSnapshotOperationsResponse.next_page_token that can be used to get the next page of results in subsequent list requests. The maximum value is 1000. |
page_token | string Page token. To get the next page of results, set page_token to the ListSnapshotOperationsResponse.next_page_token returned by a previous list request. The maximum string length in characters is 100. |
ListSnapshotOperationsResponse
Field | Description |
---|---|
operations[] | operation.Operation List of operations for the specified snapshot. |
next_page_token | string This token allows you to get the next page of results for list requests. If the number of results is larger than ListSnapshotOperationsRequest.page_size, use the next_page_token as the value for the ListSnapshotOperationsRequest.page_token query parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results. |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty |