Compute Engine v1 API - Class Snapshots.SnapshotsClient (2.15.0)

public class Snapshots.SnapshotsClient : ClientBase<Snapshots.SnapshotsClient>

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

Client for Snapshots

Inheritance

object > ClientBase > ClientBaseSnapshotsSnapshotsClient > Snapshots.SnapshotsClient

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Constructors

SnapshotsClient()

protected SnapshotsClient()

Protected parameterless constructor to allow creation of test doubles.

SnapshotsClient(CallInvoker)

public SnapshotsClient(CallInvoker callInvoker)

Creates a new client for Snapshots that uses a custom CallInvoker.

Parameter
NameDescription
callInvokerCallInvoker

The callInvoker to use to make remote calls.

SnapshotsClient(ChannelBase)

public SnapshotsClient(ChannelBase channel)

Creates a new client for Snapshots

Parameter
NameDescription
channelChannelBase

The channel to use to make remote calls.

SnapshotsClient(ClientBaseConfiguration)

protected SnapshotsClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
NameDescription
configurationClientBaseClientBaseConfiguration

The client configuration.

Methods

CreateOperationsClientForGlobalOperations()

public virtual Operations.OperationsClient CreateOperationsClientForGlobalOperations()

Creates a new instance of Operations.OperationsClient using the same call invoker as this client, delegating to GlobalOperations.

Returns
TypeDescription
OperationsOperationsClient

A new Operations client for the same target as this client.

Delete(DeleteSnapshotRequest, CallOptions)

public virtual Operation Delete(DeleteSnapshotRequest request, CallOptions options)

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.

Parameters
NameDescription
requestDeleteSnapshotRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Operation

The response received from the server.

Delete(DeleteSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual Operation Delete(DeleteSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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.

Parameters
NameDescription
requestDeleteSnapshotRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Operation

The response received from the server.

DeleteAsync(DeleteSnapshotRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> DeleteAsync(DeleteSnapshotRequest request, CallOptions options)

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.

Parameters
NameDescription
requestDeleteSnapshotRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

DeleteAsync(DeleteSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Operation> DeleteAsync(DeleteSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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.

Parameters
NameDescription
requestDeleteSnapshotRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

Get(GetSnapshotRequest, CallOptions)

public virtual Snapshot Get(GetSnapshotRequest request, CallOptions options)

Returns the specified Snapshot resource.

Parameters
NameDescription
requestGetSnapshotRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Snapshot

The response received from the server.

Get(GetSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual Snapshot Get(GetSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Returns the specified Snapshot resource.

Parameters
NameDescription
requestGetSnapshotRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Snapshot

The response received from the server.

GetAsync(GetSnapshotRequest, CallOptions)

public virtual AsyncUnaryCall<Snapshot> GetAsync(GetSnapshotRequest request, CallOptions options)

Returns the specified Snapshot resource.

Parameters
NameDescription
requestGetSnapshotRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallSnapshot

The call object.

GetAsync(GetSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Snapshot> GetAsync(GetSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Returns the specified Snapshot resource.

Parameters
NameDescription
requestGetSnapshotRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallSnapshot

The call object.

GetIamPolicy(GetIamPolicySnapshotRequest, CallOptions)

public virtual Policy GetIamPolicy(GetIamPolicySnapshotRequest request, CallOptions options)

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

Parameters
NameDescription
requestGetIamPolicySnapshotRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Policy

The response received from the server.

GetIamPolicy(GetIamPolicySnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual Policy GetIamPolicy(GetIamPolicySnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
NameDescription
requestGetIamPolicySnapshotRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Policy

The response received from the server.

GetIamPolicyAsync(GetIamPolicySnapshotRequest, CallOptions)

public virtual AsyncUnaryCall<Policy> GetIamPolicyAsync(GetIamPolicySnapshotRequest request, CallOptions options)

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

Parameters
NameDescription
requestGetIamPolicySnapshotRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallPolicy

The call object.

GetIamPolicyAsync(GetIamPolicySnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Policy> GetIamPolicyAsync(GetIamPolicySnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
NameDescription
requestGetIamPolicySnapshotRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallPolicy

The call object.

Insert(InsertSnapshotRequest, CallOptions)

public virtual Operation Insert(InsertSnapshotRequest request, CallOptions options)

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.

Parameters
NameDescription
requestInsertSnapshotRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Operation

The response received from the server.

Insert(InsertSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual Operation Insert(InsertSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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.

Parameters
NameDescription
requestInsertSnapshotRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Operation

The response received from the server.

InsertAsync(InsertSnapshotRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> InsertAsync(InsertSnapshotRequest request, CallOptions options)

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.

Parameters
NameDescription
requestInsertSnapshotRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

InsertAsync(InsertSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Operation> InsertAsync(InsertSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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.

Parameters
NameDescription
requestInsertSnapshotRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

List(ListSnapshotsRequest, CallOptions)

public virtual SnapshotList List(ListSnapshotsRequest request, CallOptions options)

Retrieves the list of Snapshot resources contained within the specified project.

Parameters
NameDescription
requestListSnapshotsRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
SnapshotList

The response received from the server.

List(ListSnapshotsRequest, Metadata, DateTime?, CancellationToken)

public virtual SnapshotList List(ListSnapshotsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Retrieves the list of Snapshot resources contained within the specified project.

Parameters
NameDescription
requestListSnapshotsRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
SnapshotList

The response received from the server.

ListAsync(ListSnapshotsRequest, CallOptions)

public virtual AsyncUnaryCall<SnapshotList> ListAsync(ListSnapshotsRequest request, CallOptions options)

Retrieves the list of Snapshot resources contained within the specified project.

Parameters
NameDescription
requestListSnapshotsRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallSnapshotList

The call object.

ListAsync(ListSnapshotsRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<SnapshotList> ListAsync(ListSnapshotsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Retrieves the list of Snapshot resources contained within the specified project.

Parameters
NameDescription
requestListSnapshotsRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallSnapshotList

The call object.

NewInstance(ClientBaseConfiguration)

protected override Snapshots.SnapshotsClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
NameDescription
configurationClientBaseClientBaseConfiguration
Returns
TypeDescription
SnapshotsSnapshotsClient
Overrides

SetIamPolicy(SetIamPolicySnapshotRequest, CallOptions)

public virtual Policy SetIamPolicy(SetIamPolicySnapshotRequest request, CallOptions options)

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

Parameters
NameDescription
requestSetIamPolicySnapshotRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Policy

The response received from the server.

SetIamPolicy(SetIamPolicySnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual Policy SetIamPolicy(SetIamPolicySnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
NameDescription
requestSetIamPolicySnapshotRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Policy

The response received from the server.

SetIamPolicyAsync(SetIamPolicySnapshotRequest, CallOptions)

public virtual AsyncUnaryCall<Policy> SetIamPolicyAsync(SetIamPolicySnapshotRequest request, CallOptions options)

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

Parameters
NameDescription
requestSetIamPolicySnapshotRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallPolicy

The call object.

SetIamPolicyAsync(SetIamPolicySnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Policy> SetIamPolicyAsync(SetIamPolicySnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
NameDescription
requestSetIamPolicySnapshotRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallPolicy

The call object.

SetLabels(SetLabelsSnapshotRequest, CallOptions)

public virtual Operation SetLabels(SetLabelsSnapshotRequest request, CallOptions options)

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

Parameters
NameDescription
requestSetLabelsSnapshotRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
Operation

The response received from the server.

SetLabels(SetLabelsSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual Operation SetLabels(SetLabelsSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
NameDescription
requestSetLabelsSnapshotRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
Operation

The response received from the server.

SetLabelsAsync(SetLabelsSnapshotRequest, CallOptions)

public virtual AsyncUnaryCall<Operation> SetLabelsAsync(SetLabelsSnapshotRequest request, CallOptions options)

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

Parameters
NameDescription
requestSetLabelsSnapshotRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

SetLabelsAsync(SetLabelsSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Operation> SetLabelsAsync(SetLabelsSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
NameDescription
requestSetLabelsSnapshotRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallOperation

The call object.

TestIamPermissions(TestIamPermissionsSnapshotRequest, CallOptions)

public virtual TestPermissionsResponse TestIamPermissions(TestIamPermissionsSnapshotRequest request, CallOptions options)

Returns permissions that a caller has on the specified resource.

Parameters
NameDescription
requestTestIamPermissionsSnapshotRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
TestPermissionsResponse

The response received from the server.

TestIamPermissions(TestIamPermissionsSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual TestPermissionsResponse TestIamPermissions(TestIamPermissionsSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Returns permissions that a caller has on the specified resource.

Parameters
NameDescription
requestTestIamPermissionsSnapshotRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
TestPermissionsResponse

The response received from the server.

TestIamPermissionsAsync(TestIamPermissionsSnapshotRequest, CallOptions)

public virtual AsyncUnaryCall<TestPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsSnapshotRequest request, CallOptions options)

Returns permissions that a caller has on the specified resource.

Parameters
NameDescription
requestTestIamPermissionsSnapshotRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCallTestPermissionsResponse

The call object.

TestIamPermissionsAsync(TestIamPermissionsSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<TestPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Returns permissions that a caller has on the specified resource.

Parameters
NameDescription
requestTestIamPermissionsSnapshotRequest

The request to send to the server.

headersMetadata

The initial metadata to send with the call. This parameter is optional.

deadlineDateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationTokenCancellationToken

An optional token for canceling the call.

Returns
TypeDescription
AsyncUnaryCallTestPermissionsResponse

The call object.