class Snapshots extends Resource (View source)

The "snapshots" collection of methods.

Typical usage is:

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

Methods

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

Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. For more information, see Deleting snapshots. (snapshots.delete)

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

Returns the specified Snapshot resource. (snapshots.get)

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. (snapshots.getIamPolicy)

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

Creates a snapshot in the specified project using the data included in the request. For regular snapshot creation, consider using this method instead of disks.createSnapshot, as this method supports more features, such as creating snapshots in a project different from the source disk project.

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

Retrieves the list of Snapshot resources contained within the specified project. (snapshots.listSnapshots)

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

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

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

Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. (snapshots.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 $snapshot, array $optParams = [])

Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. For more information, see Deleting snapshots. (snapshots.delete)

Parameters

string $project

Project ID for this request.

string $snapshot

Name of the Snapshot resource to delete.

array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

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

Returns the specified Snapshot resource. (snapshots.get)

Parameters

string $project

Project ID for this request.

string $snapshot

Name of the Snapshot resource to return.

array $optParams

Optional parameters.

Return Value

Snapshot

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. (snapshots.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, Snapshot $postBody, array $optParams = [])

Creates a snapshot in the specified project using the data included in the request. For regular snapshot creation, consider using this method instead of disks.createSnapshot, as this method supports more features, such as creating snapshots in a project different from the source disk project.

(snapshots.insert)

Parameters

string $project

Project ID for this request.

Snapshot $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

SnapshotList listSnapshots(string $project, array $optParams = [])

Retrieves the list of Snapshot resources contained within the specified project. (snapshots.listSnapshots)

Parameters

string $project

Project ID for this request.

array $optParams

Optional parameters.

Return Value

SnapshotList

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. (snapshots.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 a snapshot. To learn more about labels, read the Labeling Resources documentation. (snapshots.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.

(snapshots.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