Compute Engine v1 API - Class DisksClientImpl (2.16.0)

public sealed class DisksClientImpl : DisksClient

Reference documentation and code samples for the Compute Engine v1 API class DisksClientImpl.

Disks client wrapper implementation, for convenient use.

Inheritance

object > DisksClient > DisksClientImpl

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Remarks

The Disks API.

Constructors

DisksClientImpl(DisksClient, DisksSettings, ILogger)

public DisksClientImpl(Disks.DisksClient grpcClient, DisksSettings settings, ILogger logger)

Constructs a client wrapper for the Disks service, with the specified gRPC client and settings.

Parameters
Name Description
grpcClient DisksDisksClient

The underlying gRPC client.

settings DisksSettings

The base DisksSettings used within this client.

logger ILogger

Optional ILogger to use within this client.

Properties

AddResourcePoliciesOperationsClient

public override OperationsClient AddResourcePoliciesOperationsClient { get; }

The long-running operations client for AddResourcePolicies.

Property Value
Type Description
OperationsClient
Overrides

BulkInsertOperationsClient

public override OperationsClient BulkInsertOperationsClient { get; }

The long-running operations client for BulkInsert.

Property Value
Type Description
OperationsClient
Overrides

CreateSnapshotOperationsClient

public override OperationsClient CreateSnapshotOperationsClient { get; }

The long-running operations client for CreateSnapshot.

Property Value
Type Description
OperationsClient
Overrides

DeleteOperationsClient

public override OperationsClient DeleteOperationsClient { get; }

The long-running operations client for Delete.

Property Value
Type Description
OperationsClient
Overrides

GrpcClient

public override Disks.DisksClient GrpcClient { get; }

The underlying gRPC Disks client

Property Value
Type Description
DisksDisksClient
Overrides

InsertOperationsClient

public override OperationsClient InsertOperationsClient { get; }

The long-running operations client for Insert.

Property Value
Type Description
OperationsClient
Overrides

RemoveResourcePoliciesOperationsClient

public override OperationsClient RemoveResourcePoliciesOperationsClient { get; }

The long-running operations client for RemoveResourcePolicies.

Property Value
Type Description
OperationsClient
Overrides

ResizeOperationsClient

public override OperationsClient ResizeOperationsClient { get; }

The long-running operations client for Resize.

Property Value
Type Description
OperationsClient
Overrides

SetLabelsOperationsClient

public override OperationsClient SetLabelsOperationsClient { get; }

The long-running operations client for SetLabels.

Property Value
Type Description
OperationsClient
Overrides

StartAsyncReplicationOperationsClient

public override OperationsClient StartAsyncReplicationOperationsClient { get; }

The long-running operations client for StartAsyncReplication.

Property Value
Type Description
OperationsClient
Overrides

StopAsyncReplicationOperationsClient

public override OperationsClient StopAsyncReplicationOperationsClient { get; }

The long-running operations client for StopAsyncReplication.

Property Value
Type Description
OperationsClient
Overrides

StopGroupAsyncReplicationOperationsClient

public override OperationsClient StopGroupAsyncReplicationOperationsClient { get; }

The long-running operations client for StopGroupAsyncReplication.

Property Value
Type Description
OperationsClient
Overrides

UpdateOperationsClient

public override OperationsClient UpdateOperationsClient { get; }

The long-running operations client for Update.

Property Value
Type Description
OperationsClient
Overrides

Methods

AddResourcePolicies(AddResourcePoliciesDiskRequest, CallSettings)

public override Operation<Operation, Operation> AddResourcePolicies(AddResourcePoliciesDiskRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request AddResourcePoliciesDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Overrides

AddResourcePoliciesAsync(AddResourcePoliciesDiskRequest, CallSettings)

public override Task<Operation<Operation, Operation>> AddResourcePoliciesAsync(AddResourcePoliciesDiskRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request AddResourcePoliciesDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Overrides

AggregatedList(AggregatedListDisksRequest, CallSettings)

public override PagedEnumerable<DiskAggregatedList, KeyValuePair<string, DisksScopedList>> AggregatedList(AggregatedListDisksRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request AggregatedListDisksRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableDiskAggregatedListKeyValuePairstringDisksScopedList

A pageable sequence of KeyValuePair<TKey, TValue> resources.

Overrides

AggregatedListAsync(AggregatedListDisksRequest, CallSettings)

public override PagedAsyncEnumerable<DiskAggregatedList, KeyValuePair<string, DisksScopedList>> AggregatedListAsync(AggregatedListDisksRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request AggregatedListDisksRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableDiskAggregatedListKeyValuePairstringDisksScopedList

A pageable asynchronous sequence of KeyValuePair<TKey, TValue> resources.

Overrides

BulkInsert(BulkInsertDiskRequest, CallSettings)

public override Operation<Operation, Operation> BulkInsert(BulkInsertDiskRequest request, CallSettings callSettings = null)

Bulk create a set of disks.

Parameters
Name Description
request BulkInsertDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Overrides

BulkInsertAsync(BulkInsertDiskRequest, CallSettings)

public override Task<Operation<Operation, Operation>> BulkInsertAsync(BulkInsertDiskRequest request, CallSettings callSettings = null)

Bulk create a set of disks.

Parameters
Name Description
request BulkInsertDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Overrides

CreateSnapshot(CreateSnapshotDiskRequest, CallSettings)

public override Operation<Operation, Operation> CreateSnapshot(CreateSnapshotDiskRequest request, CallSettings callSettings = null)

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.

Parameters
Name Description
request CreateSnapshotDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Overrides

CreateSnapshotAsync(CreateSnapshotDiskRequest, CallSettings)

public override Task<Operation<Operation, Operation>> CreateSnapshotAsync(CreateSnapshotDiskRequest request, CallSettings callSettings = null)

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.

Parameters
Name Description
request CreateSnapshotDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Overrides

Delete(DeleteDiskRequest, CallSettings)

public override Operation<Operation, Operation> Delete(DeleteDiskRequest request, CallSettings callSettings = null)

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.

Parameters
Name Description
request DeleteDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Overrides

DeleteAsync(DeleteDiskRequest, CallSettings)

public override Task<Operation<Operation, Operation>> DeleteAsync(DeleteDiskRequest request, CallSettings callSettings = null)

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.

Parameters
Name Description
request DeleteDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Overrides

Get(GetDiskRequest, CallSettings)

public override Disk Get(GetDiskRequest request, CallSettings callSettings = null)

Returns the specified persistent disk.

Parameters
Name Description
request GetDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Disk

The RPC response.

Overrides

GetAsync(GetDiskRequest, CallSettings)

public override Task<Disk> GetAsync(GetDiskRequest request, CallSettings callSettings = null)

Returns the specified persistent disk.

Parameters
Name Description
request GetDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskDisk

A Task containing the RPC response.

Overrides

GetIamPolicy(GetIamPolicyDiskRequest, CallSettings)

public override Policy GetIamPolicy(GetIamPolicyDiskRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request GetIamPolicyDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Policy

The RPC response.

Overrides

GetIamPolicyAsync(GetIamPolicyDiskRequest, CallSettings)

public override Task<Policy> GetIamPolicyAsync(GetIamPolicyDiskRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request GetIamPolicyDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Overrides

Insert(InsertDiskRequest, CallSettings)

public override Operation<Operation, Operation> Insert(InsertDiskRequest request, CallSettings callSettings = null)

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.

Parameters
Name Description
request InsertDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Overrides

InsertAsync(InsertDiskRequest, CallSettings)

public override Task<Operation<Operation, Operation>> InsertAsync(InsertDiskRequest request, CallSettings callSettings = null)

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.

Parameters
Name Description
request InsertDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Overrides

List(ListDisksRequest, CallSettings)

public override PagedEnumerable<DiskList, Disk> List(ListDisksRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request ListDisksRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableDiskListDisk

A pageable sequence of Disk resources.

Overrides

ListAsync(ListDisksRequest, CallSettings)

public override PagedAsyncEnumerable<DiskList, Disk> ListAsync(ListDisksRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request ListDisksRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableDiskListDisk

A pageable asynchronous sequence of Disk resources.

Overrides

RemoveResourcePolicies(RemoveResourcePoliciesDiskRequest, CallSettings)

public override Operation<Operation, Operation> RemoveResourcePolicies(RemoveResourcePoliciesDiskRequest request, CallSettings callSettings = null)

Removes resource policies from a disk.

Parameters
Name Description
request RemoveResourcePoliciesDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Overrides

RemoveResourcePoliciesAsync(RemoveResourcePoliciesDiskRequest, CallSettings)

public override Task<Operation<Operation, Operation>> RemoveResourcePoliciesAsync(RemoveResourcePoliciesDiskRequest request, CallSettings callSettings = null)

Removes resource policies from a disk.

Parameters
Name Description
request RemoveResourcePoliciesDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Overrides

Resize(ResizeDiskRequest, CallSettings)

public override Operation<Operation, Operation> Resize(ResizeDiskRequest request, CallSettings callSettings = null)

Resizes the specified persistent disk. You can only increase the size of the disk.

Parameters
Name Description
request ResizeDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Overrides

ResizeAsync(ResizeDiskRequest, CallSettings)

public override Task<Operation<Operation, Operation>> ResizeAsync(ResizeDiskRequest request, CallSettings callSettings = null)

Resizes the specified persistent disk. You can only increase the size of the disk.

Parameters
Name Description
request ResizeDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Overrides

SetIamPolicy(SetIamPolicyDiskRequest, CallSettings)

public override Policy SetIamPolicy(SetIamPolicyDiskRequest request, CallSettings callSettings = null)

Sets the access control policy on the specified resource. Replaces any existing policy.

Parameters
Name Description
request SetIamPolicyDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Policy

The RPC response.

Overrides

SetIamPolicyAsync(SetIamPolicyDiskRequest, CallSettings)

public override Task<Policy> SetIamPolicyAsync(SetIamPolicyDiskRequest request, CallSettings callSettings = null)

Sets the access control policy on the specified resource. Replaces any existing policy.

Parameters
Name Description
request SetIamPolicyDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Overrides

SetLabels(SetLabelsDiskRequest, CallSettings)

public override Operation<Operation, Operation> SetLabels(SetLabelsDiskRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request SetLabelsDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Overrides

SetLabelsAsync(SetLabelsDiskRequest, CallSettings)

public override Task<Operation<Operation, Operation>> SetLabelsAsync(SetLabelsDiskRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request SetLabelsDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Overrides

StartAsyncReplication(StartAsyncReplicationDiskRequest, CallSettings)

public override Operation<Operation, Operation> StartAsyncReplication(StartAsyncReplicationDiskRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request StartAsyncReplicationDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Overrides

StartAsyncReplicationAsync(StartAsyncReplicationDiskRequest, CallSettings)

public override Task<Operation<Operation, Operation>> StartAsyncReplicationAsync(StartAsyncReplicationDiskRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request StartAsyncReplicationDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Overrides

StopAsyncReplication(StopAsyncReplicationDiskRequest, CallSettings)

public override Operation<Operation, Operation> StopAsyncReplication(StopAsyncReplicationDiskRequest request, CallSettings callSettings = null)

Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk.

Parameters
Name Description
request StopAsyncReplicationDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Overrides

StopAsyncReplicationAsync(StopAsyncReplicationDiskRequest, CallSettings)

public override Task<Operation<Operation, Operation>> StopAsyncReplicationAsync(StopAsyncReplicationDiskRequest request, CallSettings callSettings = null)

Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk.

Parameters
Name Description
request StopAsyncReplicationDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Overrides

StopGroupAsyncReplication(StopGroupAsyncReplicationDiskRequest, CallSettings)

public override Operation<Operation, Operation> StopGroupAsyncReplication(StopGroupAsyncReplicationDiskRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request StopGroupAsyncReplicationDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Overrides

StopGroupAsyncReplicationAsync(StopGroupAsyncReplicationDiskRequest, CallSettings)

public override Task<Operation<Operation, Operation>> StopGroupAsyncReplicationAsync(StopGroupAsyncReplicationDiskRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request StopGroupAsyncReplicationDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Overrides

TestIamPermissions(TestIamPermissionsDiskRequest, CallSettings)

public override TestPermissionsResponse TestIamPermissions(TestIamPermissionsDiskRequest request, CallSettings callSettings = null)

Returns permissions that a caller has on the specified resource.

Parameters
Name Description
request TestIamPermissionsDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TestPermissionsResponse

The RPC response.

Overrides

TestIamPermissionsAsync(TestIamPermissionsDiskRequest, CallSettings)

public override Task<TestPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsDiskRequest request, CallSettings callSettings = null)

Returns permissions that a caller has on the specified resource.

Parameters
Name Description
request TestIamPermissionsDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTestPermissionsResponse

A Task containing the RPC response.

Overrides

Update(UpdateDiskRequest, CallSettings)

public override Operation<Operation, Operation> Update(UpdateDiskRequest request, CallSettings callSettings = null)

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.

Parameters
Name Description
request UpdateDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Overrides

UpdateAsync(UpdateDiskRequest, CallSettings)

public override Task<Operation<Operation, Operation>> UpdateAsync(UpdateDiskRequest request, CallSettings callSettings = null)

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.

Parameters
Name Description
request UpdateDiskRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Overrides