Compute Engine v1 API - Class RegionSnapshotSettingsClient (3.27.0)

public abstract class RegionSnapshotSettingsClient

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

RegionSnapshotSettings client wrapper, for convenient use.

Inheritance

object > RegionSnapshotSettingsClient

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Remarks

The RegionSnapshotSettings API.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default RegionSnapshotSettings scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

GrpcClient

public virtual RegionSnapshotSettings.RegionSnapshotSettingsClient GrpcClient { get; }

The underlying gRPC RegionSnapshotSettings client

Property Value
Type Description
RegionSnapshotSettingsRegionSnapshotSettingsClient

PatchOperationsClient

public virtual OperationsClient PatchOperationsClient { get; }

The long-running operations client for Patch.

Property Value
Type Description
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static RegionSnapshotSettingsClient Create()

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

Returns
Type Description
RegionSnapshotSettingsClient

The created RegionSnapshotSettingsClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskRegionSnapshotSettingsClient

The task representing the created RegionSnapshotSettingsClient.

Get(GetRegionSnapshotSettingRequest, CallSettings)

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

Get region snapshot settings.

Parameters
Name Description
request GetRegionSnapshotSettingRequest

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
SnapshotSettings

The RPC response.

Example
// Create client
RegionSnapshotSettingsClient regionSnapshotSettingsClient = RegionSnapshotSettingsClient.Create();
// Initialize request argument(s)
GetRegionSnapshotSettingRequest request = new GetRegionSnapshotSettingRequest
{
    Region = "",
    Project = "",
};
// Make the request
SnapshotSettings response = regionSnapshotSettingsClient.Get(request);

Get(string, string, CallSettings)

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

Get region snapshot settings.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region for this request.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SnapshotSettings

The RPC response.

Example
// Create client
RegionSnapshotSettingsClient regionSnapshotSettingsClient = RegionSnapshotSettingsClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
// Make the request
SnapshotSettings response = regionSnapshotSettingsClient.Get(project, region);

GetAsync(GetRegionSnapshotSettingRequest, CallSettings)

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

Get region snapshot settings.

Parameters
Name Description
request GetRegionSnapshotSettingRequest

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
TaskSnapshotSettings

A Task containing the RPC response.

Example
// Create client
RegionSnapshotSettingsClient regionSnapshotSettingsClient = await RegionSnapshotSettingsClient.CreateAsync();
// Initialize request argument(s)
GetRegionSnapshotSettingRequest request = new GetRegionSnapshotSettingRequest
{
    Region = "",
    Project = "",
};
// Make the request
SnapshotSettings response = await regionSnapshotSettingsClient.GetAsync(request);

GetAsync(GetRegionSnapshotSettingRequest, CancellationToken)

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

Get region snapshot settings.

Parameters
Name Description
request GetRegionSnapshotSettingRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSnapshotSettings

A Task containing the RPC response.

Example
// Create client
RegionSnapshotSettingsClient regionSnapshotSettingsClient = await RegionSnapshotSettingsClient.CreateAsync();
// Initialize request argument(s)
GetRegionSnapshotSettingRequest request = new GetRegionSnapshotSettingRequest
{
    Region = "",
    Project = "",
};
// Make the request
SnapshotSettings response = await regionSnapshotSettingsClient.GetAsync(request);

GetAsync(string, string, CallSettings)

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

Get region snapshot settings.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region for this request.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSnapshotSettings

A Task containing the RPC response.

Example
// Create client
RegionSnapshotSettingsClient regionSnapshotSettingsClient = await RegionSnapshotSettingsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
// Make the request
SnapshotSettings response = await regionSnapshotSettingsClient.GetAsync(project, region);

GetAsync(string, string, CancellationToken)

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

Get region snapshot settings.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region for this request.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSnapshotSettings

A Task containing the RPC response.

Example
// Create client
RegionSnapshotSettingsClient regionSnapshotSettingsClient = await RegionSnapshotSettingsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
// Make the request
SnapshotSettings response = await regionSnapshotSettingsClient.GetAsync(project, region);

Patch(PatchRegionSnapshotSettingRequest, CallSettings)

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

Patch region snapshot settings.

Parameters
Name Description
request PatchRegionSnapshotSettingRequest

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.

Example
// Create client
RegionSnapshotSettingsClient regionSnapshotSettingsClient = RegionSnapshotSettingsClient.Create();
// Initialize request argument(s)
PatchRegionSnapshotSettingRequest request = new PatchRegionSnapshotSettingRequest
{
    RequestId = "",
    Region = "",
    Project = "",
    SnapshotSettingsResource = new SnapshotSettings(),
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = regionSnapshotSettingsClient.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 = regionSnapshotSettingsClient.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, string, SnapshotSettings, CallSettings)

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

Patch region snapshot settings.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region for this request.

snapshotSettingsResource SnapshotSettings

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationOperationOperation

The RPC response.

Example
// Create client
RegionSnapshotSettingsClient regionSnapshotSettingsClient = RegionSnapshotSettingsClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
SnapshotSettings snapshotSettingsResource = new SnapshotSettings();
// Make the request
lro::Operation<Operation, Operation> response = regionSnapshotSettingsClient.Patch(project, region, 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 = regionSnapshotSettingsClient.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(PatchRegionSnapshotSettingRequest, CallSettings)

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

Patch region snapshot settings.

Parameters
Name Description
request PatchRegionSnapshotSettingRequest

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.

Example
// Create client
RegionSnapshotSettingsClient regionSnapshotSettingsClient = await RegionSnapshotSettingsClient.CreateAsync();
// Initialize request argument(s)
PatchRegionSnapshotSettingRequest request = new PatchRegionSnapshotSettingRequest
{
    RequestId = "",
    Region = "",
    Project = "",
    SnapshotSettingsResource = new SnapshotSettings(),
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await regionSnapshotSettingsClient.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 regionSnapshotSettingsClient.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(PatchRegionSnapshotSettingRequest, CancellationToken)

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

Patch region snapshot settings.

Parameters
Name Description
request PatchRegionSnapshotSettingRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSnapshotSettingsClient regionSnapshotSettingsClient = await RegionSnapshotSettingsClient.CreateAsync();
// Initialize request argument(s)
PatchRegionSnapshotSettingRequest request = new PatchRegionSnapshotSettingRequest
{
    RequestId = "",
    Region = "",
    Project = "",
    SnapshotSettingsResource = new SnapshotSettings(),
    UpdateMask = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await regionSnapshotSettingsClient.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 regionSnapshotSettingsClient.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, string, SnapshotSettings, CallSettings)

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

Patch region snapshot settings.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region for this request.

snapshotSettingsResource SnapshotSettings

The body resource for this request

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSnapshotSettingsClient regionSnapshotSettingsClient = await RegionSnapshotSettingsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
SnapshotSettings snapshotSettingsResource = new SnapshotSettings();
// Make the request
lro::Operation<Operation, Operation> response = await regionSnapshotSettingsClient.PatchAsync(project, region, 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 regionSnapshotSettingsClient.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, string, SnapshotSettings, CancellationToken)

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

Patch region snapshot settings.

Parameters
Name Description
project string

Project ID for this request.

region string

Name of the region for this request.

snapshotSettingsResource SnapshotSettings

The body resource for this request

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationOperationOperation

A Task containing the RPC response.

Example
// Create client
RegionSnapshotSettingsClient regionSnapshotSettingsClient = await RegionSnapshotSettingsClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
SnapshotSettings snapshotSettingsResource = new SnapshotSettings();
// Make the request
lro::Operation<Operation, Operation> response = await regionSnapshotSettingsClient.PatchAsync(project, region, 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 regionSnapshotSettingsClient.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
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
operationName string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Type Description
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.