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

public class SnapshotsClient : ClientBase<Snapshots.SnapshotsClient>

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

Client for Snapshots

Inheritance

Object > ClientBase > ClientBase<Snapshots.SnapshotsClient> > 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(ClientBase.ClientBaseConfiguration)

protected SnapshotsClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
NameDescription
configurationClientBase.ClientBaseConfiguration

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
Operations.OperationsClient

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, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Operation>

The call object.

DeleteAsync(DeleteSnapshotRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Operation>

The call object.

Get(GetSnapshotRequest, CallOptions)

public virtual Snapshot Get(GetSnapshotRequest request, CallOptions options)

Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request.

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, Nullable<DateTime>, CancellationToken)

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

Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request.

Parameters
NameDescription
requestGetSnapshotRequest

The request to send to the server.

headersMetadata

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

deadlineNullable<DateTime>

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. Gets a list of available snapshots by making a list() request.

Parameters
NameDescription
requestGetSnapshotRequest

The request to send to the server.

optionsCallOptions

The options for the call.

Returns
TypeDescription
AsyncUnaryCall<Snapshot>

The call object.

GetAsync(GetSnapshotRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request.

Parameters
NameDescription
requestGetSnapshotRequest

The request to send to the server.

headersMetadata

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

deadlineNullable<DateTime>

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
AsyncUnaryCall<Snapshot>

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, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Policy>

The call object.

GetIamPolicyAsync(GetIamPolicySnapshotRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Policy>

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, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Operation>

The call object.

InsertAsync(InsertSnapshotRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Operation>

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, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<SnapshotList>

The call object.

ListAsync(ListSnapshotsRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<SnapshotList>

The call object.

NewInstance(ClientBase.ClientBaseConfiguration)

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

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
NameDescription
configurationClientBase.ClientBaseConfiguration
Returns
TypeDescription
Snapshots.SnapshotsClient
Overrides
Grpc.Core.ClientBase<Google.Cloud.Compute.V1.Snapshots.SnapshotsClient>.NewInstance(Grpc.Core.ClientBase.ClientBaseConfiguration)

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, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Policy>

The call object.

SetIamPolicyAsync(SetIamPolicySnapshotRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Policy>

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, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Operation>

The call object.

SetLabelsAsync(SetLabelsSnapshotRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<Operation>

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, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<TestPermissionsResponse>

The call object.

TestIamPermissionsAsync(TestIamPermissionsSnapshotRequest, Metadata, Nullable<DateTime>, CancellationToken)

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

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.

deadlineNullable<DateTime>

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
AsyncUnaryCall<TestPermissionsResponse>

The call object.