class Disks extends Resource (View source)

The "disks" collection of methods.

Typical usage is:

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

Methods

addResourcePolicies(string $project, string $zone, string $disk, DisksAddResourcePoliciesRequest $postBody, array $optParams = [])

Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.

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

Retrieves an aggregated list of persistent disks. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

bulkInsert(string $project, string $zone, BulkInsertDiskResource $postBody, array $optParams = [])

Bulk create a set of disks. (disks.bulkInsert)

createSnapshot(string $project, string $zone, string $disk, Snapshot $postBody, array $optParams = [])

Creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project. (disks.createSnapshot)

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

Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. (disks.delete)

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

Returns the specified persistent disk. (disks.get)

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

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

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

Creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) or create an empty 500 GB data disk by omitting all properties.

listDisks(string $project, string $zone, array $optParams = [])

Retrieves a list of persistent disks contained within the specified zone.

removeResourcePolicies(string $project, string $zone, string $disk, DisksRemoveResourcePoliciesRequest $postBody, array $optParams = [])

Removes resource policies from a disk. (disks.removeResourcePolicies)

resize(string $project, string $zone, string $disk, DisksResizeRequest $postBody, array $optParams = [])

Resizes the specified persistent disk. You can only increase the size of the disk. (disks.resize)

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

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

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

Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. (disks.setLabels)

startAsyncReplication(string $project, string $zone, string $disk, DisksStartAsyncReplicationRequest $postBody, array $optParams = [])

Starts asynchronous replication. Must be invoked on the primary disk.

stopAsyncReplication(string $project, string $zone, string $disk, array $optParams = [])

Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk. (disks.stopAsyncReplication)

stopGroupAsyncReplication(string $project, string $zone, DisksStopGroupAsyncReplicationResource $postBody, array $optParams = [])

Stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope.

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

Returns permissions that a caller has on the specified resource.

update(string $project, string $zone, string $disk, Disk $postBody, array $optParams = [])

Updates the specified disk with the data included in the request. The update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: user_license. (disks.update)

Details

Operation addResourcePolicies(string $project, string $zone, string $disk, DisksAddResourcePoliciesRequest $postBody, array $optParams = [])

Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.

(disks.addResourcePolicies)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone for this request.

string $disk

The disk name for this request.

DisksAddResourcePoliciesRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

DiskAggregatedList aggregatedList(string $project, array $optParams = [])

Retrieves an aggregated list of persistent disks. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

(disks.aggregatedList)

Parameters

string $project

Project ID for this request.

array $optParams

Optional parameters.

Return Value

DiskAggregatedList

Exceptions

Exception

Operation bulkInsert(string $project, string $zone, BulkInsertDiskResource $postBody, array $optParams = [])

Bulk create a set of disks. (disks.bulkInsert)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone for this request.

BulkInsertDiskResource $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation createSnapshot(string $project, string $zone, string $disk, Snapshot $postBody, array $optParams = [])

Creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project. (disks.createSnapshot)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone for this request.

string $disk

Name of the persistent disk to snapshot.

Snapshot $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

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

Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. (disks.delete)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone for this request.

string $disk

Name of the persistent disk to delete.

array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Disk get(string $project, string $zone, string $disk, array $optParams = [])

Returns the specified persistent disk. (disks.get)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone for this request.

string $disk

Name of the persistent disk to return.

array $optParams

Optional parameters.

Return Value

Disk

Exceptions

Exception

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

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

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone 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, string $zone, Disk $postBody, array $optParams = [])

Creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) or create an empty 500 GB data disk by omitting all properties.

You can also create a disk that is larger than the default size by specifying the sizeGb property. (disks.insert)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone for this request.

Disk $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

DiskList listDisks(string $project, string $zone, array $optParams = [])

Retrieves a list of persistent disks contained within the specified zone.

(disks.listDisks)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone for this request.

array $optParams

Optional parameters.

Return Value

DiskList

Exceptions

Exception

Operation removeResourcePolicies(string $project, string $zone, string $disk, DisksRemoveResourcePoliciesRequest $postBody, array $optParams = [])

Removes resource policies from a disk. (disks.removeResourcePolicies)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone for this request.

string $disk

The disk name for this request.

DisksRemoveResourcePoliciesRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation resize(string $project, string $zone, string $disk, DisksResizeRequest $postBody, array $optParams = [])

Resizes the specified persistent disk. You can only increase the size of the disk. (disks.resize)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone for this request.

string $disk

The name of the persistent disk.

DisksResizeRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

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

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

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone for this request.

string $resource

Name or id of the resource for this request.

ZoneSetPolicyRequest $postBody
array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

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

Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. (disks.setLabels)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone for this request.

string $resource

Name or id of the resource for this request.

ZoneSetLabelsRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation startAsyncReplication(string $project, string $zone, string $disk, DisksStartAsyncReplicationRequest $postBody, array $optParams = [])

Starts asynchronous replication. Must be invoked on the primary disk.

(disks.startAsyncReplication)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone for this request.

string $disk

The name of the persistent disk.

DisksStartAsyncReplicationRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation stopAsyncReplication(string $project, string $zone, string $disk, array $optParams = [])

Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk. (disks.stopAsyncReplication)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone for this request.

string $disk

The name of the persistent disk.

array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation stopGroupAsyncReplication(string $project, string $zone, DisksStopGroupAsyncReplicationResource $postBody, array $optParams = [])

Stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope.

(disks.stopGroupAsyncReplication)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone for this request. This must be the zone of the primary or secondary disks in the consistency group.

DisksStopGroupAsyncReplicationResource $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

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

Returns permissions that a caller has on the specified resource.

(disks.testIamPermissions)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone 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

Operation update(string $project, string $zone, string $disk, Disk $postBody, array $optParams = [])

Updates the specified disk with the data included in the request. The update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: user_license. (disks.update)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone for this request.

string $disk

The disk name for this request.

Disk $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception