class Images extends Resource (View source)

The "images" collection of methods.

Typical usage is:

 $computeService = new Google\Service\Compute(...);
 $images = $computeService->images;

Methods

delete(string $project, string $image, array $optParams = [])

Deletes the specified image. (images.delete)

deprecate(string $project, string $image, DeprecationStatus $postBody, array $optParams = [])

Sets the deprecation status of an image. If an empty request body is given, clears the deprecation status instead. (images.deprecate)

get(string $project, string $image, array $optParams = [])

Returns the specified image. (images.get)

getFromFamily(string $project, string $family, array $optParams = [])

Returns the latest image that is part of an image family and is not deprecated. For more information on image families, see Public image families documentation. (images.getFromFamily)

getIamPolicy(string $project, string $resource, array $optParams = [])

Gets the access control policy for a resource. May be empty if no such policy or resource exists. (images.getIamPolicy)

insert(string $project, Image $postBody, array $optParams = [])

Creates an image in the specified project using the data included in the request. (images.insert)

listImages(string $project, array $optParams = [])

Retrieves the list of custom images available to the specified project.

patch(string $project, string $image, Image $postBody, array $optParams = [])

Patches the specified image with the data included in the request. Only the following fields can be modified: family, description, deprecation status.

setIamPolicy(string $project, string $resource, GlobalSetPolicyRequest $postBody, array $optParams = [])

Sets the access control policy on the specified resource. Replaces any existing policy. (images.setIamPolicy)

setLabels(string $project, string $resource, GlobalSetLabelsRequest $postBody, array $optParams = [])

Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. (images.setLabels)

testIamPermissions(string $project, string $resource, TestPermissionsRequest $postBody, array $optParams = [])

Returns permissions that a caller has on the specified resource.

Details

Operation delete(string $project, string $image, array $optParams = [])

Deletes the specified image. (images.delete)

Parameters

string $project

Project ID for this request.

string $image

Name of the image resource to delete.

array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation deprecate(string $project, string $image, DeprecationStatus $postBody, array $optParams = [])

Sets the deprecation status of an image. If an empty request body is given, clears the deprecation status instead. (images.deprecate)

Parameters

string $project

Project ID for this request.

string $image

Image name.

DeprecationStatus $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Image get(string $project, string $image, array $optParams = [])

Returns the specified image. (images.get)

Parameters

string $project

Project ID for this request.

string $image

Name of the image resource to return.

array $optParams

Optional parameters.

Return Value

Image

Exceptions

Exception

Image getFromFamily(string $project, string $family, array $optParams = [])

Returns the latest image that is part of an image family and is not deprecated. For more information on image families, see Public image families documentation. (images.getFromFamily)

Parameters

string $project

The image project that the image belongs to. For example, to get a CentOS image, specify centos-cloud as the image project.

string $family

Name of the image family to search for.

array $optParams

Optional parameters.

Return Value

Image

Exceptions

Exception

Policy getIamPolicy(string $project, string $resource, array $optParams = [])

Gets the access control policy for a resource. May be empty if no such policy or resource exists. (images.getIamPolicy)

Parameters

string $project

Project ID for this request.

string $resource

Name or id of the resource for this request.

array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

Operation insert(string $project, Image $postBody, array $optParams = [])

Creates an image in the specified project using the data included in the request. (images.insert)

Parameters

string $project

Project ID for this request.

Image $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

ImageList listImages(string $project, array $optParams = [])

Retrieves the list of custom images available to the specified project.

Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly- available images, like Debian 8. If you want to get a list of publicly- available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. (images.listImages)

Parameters

string $project

Project ID for this request.

array $optParams

Optional parameters.

Return Value

ImageList

Exceptions

Exception

Operation patch(string $project, string $image, Image $postBody, array $optParams = [])

Patches the specified image with the data included in the request. Only the following fields can be modified: family, description, deprecation status.

(images.patch)

Parameters

string $project

Project ID for this request.

string $image

Name of the image resource to patch.

Image $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Policy setIamPolicy(string $project, string $resource, GlobalSetPolicyRequest $postBody, array $optParams = [])

Sets the access control policy on the specified resource. Replaces any existing policy. (images.setIamPolicy)

Parameters

string $project

Project ID for this request.

string $resource

Name or id of the resource for this request.

GlobalSetPolicyRequest $postBody
array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

Operation setLabels(string $project, string $resource, GlobalSetLabelsRequest $postBody, array $optParams = [])

Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. (images.setLabels)

Parameters

string $project

Project ID for this request.

string $resource

Name or id of the resource for this request.

GlobalSetLabelsRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

TestPermissionsResponse testIamPermissions(string $project, string $resource, TestPermissionsRequest $postBody, array $optParams = [])

Returns permissions that a caller has on the specified resource.

(images.testIamPermissions)

Parameters

string $project

Project ID for this request.

string $resource

Name or id of the resource for this request.

TestPermissionsRequest $postBody
array $optParams

Optional parameters.

Return Value

TestPermissionsResponse

Exceptions

Exception