Disks
class Disks extends Resource (View source)
The "disks" collection of methods.
Typical usage is:
$computeService = new Google\Service\Compute(...);
$disks = $computeService->disks;
Methods
Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.
Retrieves an aggregated list of persistent disks. To prevent failure, Google
recommends that you set the returnPartialSuccess
parameter to true
.
Bulk create a set of disks. (disks.bulkInsert)
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)
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)
Returns the specified persistent disk. (disks.get)
Gets the access control policy for a resource. May be empty if no such policy or resource exists. (disks.getIamPolicy)
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.
Retrieves a list of persistent disks contained within the specified zone.
Removes resource policies from a disk. (disks.removeResourcePolicies)
Resizes the specified persistent disk. You can only increase the size of the disk. (disks.resize)
Sets the access control policy on the specified resource. Replaces any existing policy. (disks.setIamPolicy)
Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. (disks.setLabels)
Starts asynchronous replication. Must be invoked on the primary disk.
Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk. (disks.stopAsyncReplication)
Stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope.
Returns permissions that a caller has on the specified resource.
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)
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)
Operation
bulkInsert(string $project, string $zone, BulkInsertDiskResource $postBody, array $optParams = [])
Bulk create a set of disks. (disks.bulkInsert)
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)
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)
Disk
get(string $project, string $zone, string $disk, array $optParams = [])
Returns the specified persistent disk. (disks.get)
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)
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)
DiskList
listDisks(string $project, string $zone, array $optParams = [])
Retrieves a list of persistent disks contained within the specified zone.
(disks.listDisks)
Operation
removeResourcePolicies(string $project, string $zone, string $disk, DisksRemoveResourcePoliciesRequest $postBody, array $optParams = [])
Removes resource policies from a disk. (disks.removeResourcePolicies)
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)
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)
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)
Operation
startAsyncReplication(string $project, string $zone, string $disk, DisksStartAsyncReplicationRequest $postBody, array $optParams = [])
Starts asynchronous replication. Must be invoked on the primary disk.
(disks.startAsyncReplication)
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)
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)
TestPermissionsResponse
testIamPermissions(string $project, string $zone, string $resource, TestPermissionsRequest $postBody, array $optParams = [])
Returns permissions that a caller has on the specified resource.
(disks.testIamPermissions)
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)