Compute Engine v1 API - Class Snapshots.SnapshotsClient (2.16.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
Name Description
callInvoker CallInvoker

The callInvoker to use to make remote calls.

SnapshotsClient(ChannelBase)

public SnapshotsClient(ChannelBase channel)

Creates a new client for Snapshots

Parameter
Name Description
channel ChannelBase

The channel to use to make remote calls.

SnapshotsClient(ClientBaseConfiguration)

protected SnapshotsClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
Name Description
configuration ClientBaseClientBaseConfiguration

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
Type Description
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
Name Description
request DeleteSnapshotRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request DeleteSnapshotRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request DeleteSnapshotRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request DeleteSnapshotRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallOperation

The call object.

Get(GetSnapshotRequest, CallOptions)

public virtual Snapshot Get(GetSnapshotRequest request, CallOptions options)

Returns the specified Snapshot resource.

Parameters
Name Description
request GetSnapshotRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request GetSnapshotRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request GetSnapshotRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request GetSnapshotRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request GetIamPolicySnapshotRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request GetIamPolicySnapshotRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request GetIamPolicySnapshotRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request GetIamPolicySnapshotRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request InsertSnapshotRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request InsertSnapshotRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request InsertSnapshotRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request InsertSnapshotRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request ListSnapshotsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request ListSnapshotsRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request ListSnapshotsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request ListSnapshotsRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallSnapshotList

The call object.

NewInstance(ClientBaseConfiguration)

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

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
Name Description
configuration ClientBaseClientBaseConfiguration
Returns
Type Description
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
Name Description
request SetIamPolicySnapshotRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request SetIamPolicySnapshotRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request SetIamPolicySnapshotRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request SetIamPolicySnapshotRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request SetLabelsSnapshotRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request SetLabelsSnapshotRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request SetLabelsSnapshotRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request SetLabelsSnapshotRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request TestIamPermissionsSnapshotRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request TestIamPermissionsSnapshotRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
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
Name Description
request TestIamPermissionsSnapshotRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
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
Name Description
request TestIamPermissionsSnapshotRequest

The request to send to the server.

headers Metadata

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

deadline DateTime

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

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallTestPermissionsResponse

The call object.