Compute Cloud API, gRPC: ImageService
A set of methods for managing Image resources.
Call | Description |
---|---|
Get | Returns the specified Image resource. |
GetLatestByFamily | Returns the latest image that is part of an image family. |
List | Retrieves the list of Image resources in the specified folder. |
Create | Creates an image in the specified folder. |
Update | Updates the specified image. |
Delete | Deletes the specified image. |
ListOperations | Lists operations for the specified image. |
Calls ImageService
Get
Returns the specified Image resource.
To get the list of available Image resources, make a List request.
rpc Get (GetImageRequest) returns (Image)
GetImageRequest
Field | Description |
---|---|
image_id | string Required. ID of the Image resource to return. To get the image ID, use a ImageService.List request. The maximum string length in characters is 50. |
Image
Field | Description |
---|---|
id | string ID of the image. |
folder_id | string ID of the folder that the image belongs to. |
created_at | google.protobuf.Timestamp |
name | string Name of the image. 1-63 characters long. |
description | string Description of the image. 0-256 characters long. |
labels | map<string,string> Resource labels as key:value pairs. Maximum of 64 per resource. |
family | string The name of the image family to which this image belongs. You can get the most recent image from a family by using the compute.v1.ImageService.GetLatestByFamily request and create the disk from this image. |
storage_size | int64 The size of the image, specified in bytes. |
min_disk_size | int64 Minimum size of the disk which will be created from this image. |
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 image.
|
os | Os Operating system that is contained in the image. |
pooled | bool When true, indicates there is an image pool for fast creation disks from the image. |
Os
Field | Description |
---|---|
type | enum Type Operating system type. The default is LINUX . This field is used to correctly emulate a vCPU and calculate the cost of using an instance.
|
GetLatestByFamily
Returns the latest image that is part of an image family.
rpc GetLatestByFamily (GetImageLatestByFamilyRequest) returns (Image)
GetImageLatestByFamilyRequest
Field | Description |
---|---|
folder_id | string Required. ID of the folder to get the image from. To get the folder ID, use a resourcemanager.v1.FolderService.List request. The maximum string length in characters is 50. |
family | string Name of the image family to search for. Value must match the regular expression |[a-z][-a-z0-9]{1,61}[a-z0-9] . |
Image
Field | Description |
---|---|
id | string ID of the image. |
folder_id | string ID of the folder that the image belongs to. |
created_at | google.protobuf.Timestamp |
name | string Name of the image. 1-63 characters long. |
description | string Description of the image. 0-256 characters long. |
labels | map<string,string> Resource labels as key:value pairs. Maximum of 64 per resource. |
family | string The name of the image family to which this image belongs. You can get the most recent image from a family by using the compute.v1.ImageService.GetLatestByFamily request and create the disk from this image. |
storage_size | int64 The size of the image, specified in bytes. |
min_disk_size | int64 Minimum size of the disk which will be created from this image. |
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 image.
|
os | Os Operating system that is contained in the image. |
pooled | bool When true, indicates there is an image pool for fast creation disks from the image. |
Os
Field | Description |
---|---|
type | enum Type Operating system type. The default is LINUX . This field is used to correctly emulate a vCPU and calculate the cost of using an instance.
|
List
Retrieves the list of Image resources in the specified folder.
rpc List (ListImagesRequest) returns (ListImagesResponse)
ListImagesRequest
Field | Description |
---|---|
folder_id | string Required. ID of the folder to list images 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 ListImagesResponse.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 ListImagesResponse.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. |
ListImagesResponse
Field | Description |
---|---|
images[] | Image List of images. |
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. |
Image
Field | Description |
---|---|
id | string ID of the image. |
folder_id | string ID of the folder that the image belongs to. |
created_at | google.protobuf.Timestamp |
name | string Name of the image. 1-63 characters long. |
description | string Description of the image. 0-256 characters long. |
labels | map<string,string> Resource labels as key:value pairs. Maximum of 64 per resource. |
family | string The name of the image family to which this image belongs. You can get the most recent image from a family by using the compute.v1.ImageService.GetLatestByFamily request and create the disk from this image. |
storage_size | int64 The size of the image, specified in bytes. |
min_disk_size | int64 Minimum size of the disk which will be created from this image. |
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 image.
|
os | Os Operating system that is contained in the image. |
pooled | bool When true, indicates there is an image pool for fast creation disks from the image. |
Os
Field | Description |
---|---|
type | enum Type Operating system type. The default is LINUX . This field is used to correctly emulate a vCPU and calculate the cost of using an instance.
|
Create
Creates an image in the specified folder.
You can create an image from a disk, snapshot, other image or URI. Method starts an asynchronous operation that can be cancelled while it is in progress.
rpc Create (CreateImageRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:CreateImageMetadata
Operation.response:Image
CreateImageRequest
Field | Description |
---|---|
folder_id | string Required. ID of the folder to create an image in. To get the folder ID, use a resourcemanager.v1.FolderService.List request. The maximum string length in characters is 50. |
name | string Name of the image. Value must match the regular expression |[a-z]([-a-z0-9]{0,61}[a-z0-9])? . |
description | string Description of the image. 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]* . |
family | string The name of the image family to which this image belongs. For more information, see Image family. To get an information about the most recent image from a family, use a ImageService.GetLatestByFamily request. Value must match the regular expression |[a-z][-a-z0-9]{1,61}[a-z0-9] . |
min_disk_size | int64 Minimum size of the disk that will be created from this image. Specified in bytes. Should be more than the volume of source data. Acceptable values are 4194304 to 4398046511104, inclusive. |
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 this request. The maximum string length in characters for each value is 50. |
source | oneof: image_id , disk_id , snapshot_id or uri |
image_id | string ID of the source image to create the new image from. The maximum string length in characters is 50. |
disk_id | string ID of the disk to create the image from. The maximum string length in characters is 50. |
snapshot_id | string ID of the snapshot to create the image from. The maximum string length in characters is 50. |
uri | string URI of the source image to create the new image from. Currently only supports links to images that are stored in Object Storage. Currently only supports Qcow2, VMDK, and RAW formats. |
os | Os Operating system that is contained in the image. If not specified and you used the image_id or disk_id field to set the source, then the value can be inherited from the source resource. |
pooled | bool When true, an image pool will be created for fast creation disks from the image. |
Os
Field | Description |
---|---|
type | enum Type Operating system type. The default is LINUX . This field is used to correctly emulate a vCPU and calculate the cost of using an instance.
|
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. |
CreateImageMetadata
Field | Description |
---|---|
image_id | string ID of the image that is being created. |
Image
Field | Description |
---|---|
id | string ID of the image. |
folder_id | string ID of the folder that the image belongs to. |
created_at | google.protobuf.Timestamp |
name | string Name of the image. 1-63 characters long. |
description | string Description of the image. 0-256 characters long. |
labels | map<string,string> Resource labels as key:value pairs. Maximum of 64 per resource. |
family | string The name of the image family to which this image belongs. You can get the most recent image from a family by using the compute.v1.ImageService.GetLatestByFamily request and create the disk from this image. |
storage_size | int64 The size of the image, specified in bytes. |
min_disk_size | int64 Minimum size of the disk which will be created from this image. |
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 image.
|
os | Os Operating system that is contained in the image. |
pooled | bool When true, indicates there is an image pool for fast creation disks from the image. |
Update
Updates the specified image.
rpc Update (UpdateImageRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:UpdateImageMetadata
Operation.response:Image
UpdateImageRequest
Field | Description |
---|---|
image_id | string Required. ID of the Image resource to update. To get the image ID, use a ImageService.List request. The maximum string length in characters is 50. |
update_mask | google.protobuf.FieldMask Field mask that specifies which fields of the Image resource are going to be updated. |
name | string Name of the image. Value must match the regular expression |[a-z]([-a-z0-9]{0,61}[a-z0-9])? . |
description | string Description of the image. The maximum string length in characters is 256. |
min_disk_size | int64 Minimum size of the disk that can be created from this image. Specified in bytes. Should be more than the volume of source data and more than the virtual disk size. Acceptable values are 4194304 to 4398046511104, inclusive. |
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. |
UpdateImageMetadata
Field | Description |
---|---|
image_id | string ID of the Image resource that is being updated. |
Image
Field | Description |
---|---|
id | string ID of the image. |
folder_id | string ID of the folder that the image belongs to. |
created_at | google.protobuf.Timestamp |
name | string Name of the image. 1-63 characters long. |
description | string Description of the image. 0-256 characters long. |
labels | map<string,string> Resource labels as key:value pairs. Maximum of 64 per resource. |
family | string The name of the image family to which this image belongs. You can get the most recent image from a family by using the compute.v1.ImageService.GetLatestByFamily request and create the disk from this image. |
storage_size | int64 The size of the image, specified in bytes. |
min_disk_size | int64 Minimum size of the disk which will be created from this image. |
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 image.
|
os | Os Operating system that is contained in the image. |
pooled | bool When true, indicates there is an image pool for fast creation disks from the image. |
Os
Field | Description |
---|---|
type | enum Type Operating system type. The default is LINUX . This field is used to correctly emulate a vCPU and calculate the cost of using an instance.
|
Delete
Deletes the specified image.
Deleting an image removes its data permanently and is irreversible.
rpc Delete (DeleteImageRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:DeleteImageMetadata
Operation.response:google.protobuf.Empty
DeleteImageRequest
Field | Description |
---|---|
image_id | string Required. ID of the image to delete. To get the image ID, use a ImageService.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. |
DeleteImageMetadata
Field | Description |
---|---|
image_id | string ID of the image that is being deleted. |
ListOperations
Lists operations for the specified image.
rpc ListOperations (ListImageOperationsRequest) returns (ListImageOperationsResponse)
ListImageOperationsRequest
Field | Description |
---|---|
image_id | string Required. ID of the Image 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 ListImageOperationsResponse.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 ListImageOperationsResponse.next_page_token returned by a previous list request. The maximum string length in characters is 100. |
ListImageOperationsResponse
Field | Description |
---|---|
operations[] | operation.Operation List of operations for the specified image. |
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 ListImageOperationsRequest.page_size, use the next_page_token as the value for the ListImageOperationsRequest.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 |