Compute Engine v1 API - Class SnapshotSettingsServiceClient (2.13.0)

public abstract class SnapshotSettingsServiceClient

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

SnapshotSettingsService client wrapper, for convenient use.

Inheritance

object > SnapshotSettingsServiceClient

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Remarks

The SnapshotSettings API.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the SnapshotSettingsService service, which is a host of "compute.googleapis.com" and a port of 443.

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default SnapshotSettingsService scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

GrpcClient

public virtual SnapshotSettingsService.SnapshotSettingsServiceClient GrpcClient { get; }

The underlying gRPC SnapshotSettingsService client

Property Value
TypeDescription
SnapshotSettingsServiceSnapshotSettingsServiceClient

PatchOperationsClient

public virtual OperationsClient PatchOperationsClient { get; }

The long-running operations client for Patch.

Property Value
TypeDescription
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static SnapshotSettingsServiceClient Create()

Synchronously creates a SnapshotSettingsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use SnapshotSettingsServiceClientBuilder.

Returns
TypeDescription
SnapshotSettingsServiceClient

The created SnapshotSettingsServiceClient.

CreateAsync(CancellationToken)

public static Task<SnapshotSettingsServiceClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a SnapshotSettingsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use SnapshotSettingsServiceClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskSnapshotSettingsServiceClient

The task representing the created SnapshotSettingsServiceClient.

Get(GetSnapshotSettingRequest, CallSettings)

public virtual SnapshotSettings Get(GetSnapshotSettingRequest request, CallSettings callSettings = null)

Get snapshot settings.

Parameters
NameDescription
requestGetSnapshotSettingRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SnapshotSettings

The RPC response.

Example
// Create client
SnapshotSettingsServiceClient snapshotSettingsServiceClient = SnapshotSettingsServiceClient.Create();
// Initialize request argument(s)
GetSnapshotSettingRequest request = new GetSnapshotSettingRequest { Project = "", };
// Make the request
SnapshotSettings response = snapshotSettingsServiceClient.Get(request);

Get(string, CallSettings)

public virtual SnapshotSettings Get(string project, CallSettings callSettings = null)

Get snapshot settings.

Parameters
NameDescription
projectstring

Project ID for this request.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
SnapshotSettings

The RPC response.

Example
// Create client
SnapshotSettingsServiceClient snapshotSettingsServiceClient = SnapshotSettingsServiceClient.Create();
// Initialize request argument(s)
string project = "";
// Make the request
SnapshotSettings response = snapshotSettingsServiceClient.Get(project);

GetAsync(GetSnapshotSettingRequest, CallSettings)

public virtual Task<SnapshotSettings> GetAsync(GetSnapshotSettingRequest request, CallSettings callSettings = null)

Get snapshot settings.

Parameters
NameDescription
requestGetSnapshotSettingRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSnapshotSettings

A Task containing the RPC response.

Example
// Create client
SnapshotSettingsServiceClient snapshotSettingsServiceClient = await SnapshotSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
GetSnapshotSettingRequest request = new GetSnapshotSettingRequest { Project = "", };
// Make the request
SnapshotSettings response = await snapshotSettingsServiceClient.GetAsync(request);

GetAsync(GetSnapshotSettingRequest, CancellationToken)

public virtual Task<SnapshotSettings> GetAsync(GetSnapshotSettingRequest request, CancellationToken cancellationToken)

Get snapshot settings.

Parameters
NameDescription
requestGetSnapshotSettingRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskSnapshotSettings

A Task containing the RPC response.

Example
// Create client
SnapshotSettingsServiceClient snapshotSettingsServiceClient = await SnapshotSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
GetSnapshotSettingRequest request = new GetSnapshotSettingRequest { Project = "", };
// Make the request
SnapshotSettings response = await snapshotSettingsServiceClient.GetAsync(request);

GetAsync(string, CallSettings)

public virtual Task<SnapshotSettings> GetAsync(string project, CallSettings callSettings = null)

Get snapshot settings.

Parameters
NameDescription
projectstring

Project ID for this request.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskSnapshotSettings

A Task containing the RPC response.

Example
// Create client
SnapshotSettingsServiceClient snapshotSettingsServiceClient = await SnapshotSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
string project = "";
// Make the request
SnapshotSettings response = await snapshotSettingsServiceClient.GetAsync(project);

GetAsync(string, CancellationToken)

public virtual Task<SnapshotSettings> GetAsync(string project, CancellationToken cancellationToken)

Get snapshot settings.

Parameters
NameDescription
projectstring

Project ID for this request.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskSnapshotSettings

A Task containing the RPC response.

Example
// Create client
SnapshotSettingsServiceClient snapshotSettingsServiceClient = await SnapshotSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
string project = "";
// Make the request
SnapshotSettings response = await snapshotSettingsServiceClient.GetAsync(project);

Patch(PatchSnapshotSettingRequest, CallSettings)

public virtual Operation<Operation, Operation> Patch(PatchSnapshotSettingRequest request, CallSettings callSettings = null)

Patch snapshot settings.

Parameters
NameDescription
requestPatchSnapshotSettingRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationOperationOperation

The RPC response.

Example
// Create client
SnapshotSettingsServiceClient snapshotSettingsServiceClient = SnapshotSettingsServiceClient.Create();
// Initialize request argument(s)
PatchSnapshotSettingRequest request = new PatchSnapshotSettingRequest
{
    RequestId = "",
    Project = "",
    SnapshotSettingsResource = new SnapshotSettings(),
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = snapshotSettingsServiceClient.Patch(request);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = snapshotSettingsServiceClient.PollOncePatch(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

Patch(string, SnapshotSettings, CallSettings)

public virtual Operation<Operation, Operation> Patch(string project, SnapshotSettings snapshotSettingsResource, CallSettings callSettings = null)

Patch snapshot settings.

Parameters
NameDescription
projectstring

Project ID for this request.

snapshotSettingsResourceSnapshotSettings

The body resource for this request

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationOperationOperation

The RPC response.

Example
// Create client
SnapshotSettingsServiceClient snapshotSettingsServiceClient = SnapshotSettingsServiceClient.Create();
// Initialize request argument(s)
string project = "";
SnapshotSettings snapshotSettingsResource = new SnapshotSettings();
// Make the request
lro::Operation<Operation, Operation> response = snapshotSettingsServiceClient.Patch(project, snapshotSettingsResource);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = snapshotSettingsServiceClient.PollOncePatch(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

PatchAsync(PatchSnapshotSettingRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> PatchAsync(PatchSnapshotSettingRequest request, CallSettings callSettings = null)

Patch snapshot settings.

Parameters
NameDescription
requestPatchSnapshotSettingRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SnapshotSettingsServiceClient snapshotSettingsServiceClient = await SnapshotSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
PatchSnapshotSettingRequest request = new PatchSnapshotSettingRequest
{
    RequestId = "",
    Project = "",
    SnapshotSettingsResource = new SnapshotSettings(),
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await snapshotSettingsServiceClient.PatchAsync(request);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await snapshotSettingsServiceClient.PollOncePatchAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

PatchAsync(PatchSnapshotSettingRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> PatchAsync(PatchSnapshotSettingRequest request, CancellationToken cancellationToken)

Patch snapshot settings.

Parameters
NameDescription
requestPatchSnapshotSettingRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SnapshotSettingsServiceClient snapshotSettingsServiceClient = await SnapshotSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
PatchSnapshotSettingRequest request = new PatchSnapshotSettingRequest
{
    RequestId = "",
    Project = "",
    SnapshotSettingsResource = new SnapshotSettings(),
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await snapshotSettingsServiceClient.PatchAsync(request);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await snapshotSettingsServiceClient.PollOncePatchAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

PatchAsync(string, SnapshotSettings, CallSettings)

public virtual Task<Operation<Operation, Operation>> PatchAsync(string project, SnapshotSettings snapshotSettingsResource, CallSettings callSettings = null)

Patch snapshot settings.

Parameters
NameDescription
projectstring

Project ID for this request.

snapshotSettingsResourceSnapshotSettings

The body resource for this request

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SnapshotSettingsServiceClient snapshotSettingsServiceClient = await SnapshotSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
string project = "";
SnapshotSettings snapshotSettingsResource = new SnapshotSettings();
// Make the request
lro::Operation<Operation, Operation> response = await snapshotSettingsServiceClient.PatchAsync(project, snapshotSettingsResource);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await snapshotSettingsServiceClient.PollOncePatchAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

PatchAsync(string, SnapshotSettings, CancellationToken)

public virtual Task<Operation<Operation, Operation>> PatchAsync(string project, SnapshotSettings snapshotSettingsResource, CancellationToken cancellationToken)

Patch snapshot settings.

Parameters
NameDescription
projectstring

Project ID for this request.

snapshotSettingsResourceSnapshotSettings

The body resource for this request

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
SnapshotSettingsServiceClient snapshotSettingsServiceClient = await SnapshotSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
string project = "";
SnapshotSettings snapshotSettingsResource = new SnapshotSettings();
// Make the request
lro::Operation<Operation, Operation> response = await snapshotSettingsServiceClient.PatchAsync(project, snapshotSettingsResource);

// Poll until the returned long-running operation is complete
lro::Operation<Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Operation result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
lro::Operation<Operation, Operation> retrievedResponse = await snapshotSettingsServiceClient.PollOncePatchAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Operation retrievedResult = retrievedResponse.Result;
}

PollOncePatch(string, CallSettings)

public virtual Operation<Operation, Operation> PollOncePatch(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of Patch.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationOperationOperation

The result of polling the operation.

PollOncePatchAsync(string, CallSettings)

public virtual Task<Operation<Operation, Operation>> PollOncePatchAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of Patch .

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationOperationOperation

A task representing the result of polling the operation.

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.