Compute Engine v1 API - Class RegionInstancesClient (2.3.0)

public abstract class RegionInstancesClient

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

RegionInstances client wrapper, for convenient use.

Inheritance

Object > RegionInstancesClient

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Remarks

The RegionInstances API.

Properties

BulkInsertOperationsClient

public virtual OperationsClient BulkInsertOperationsClient { get; }

The long-running operations client for BulkInsert.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the RegionInstances 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 RegionInstances scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

GrpcClient

public virtual RegionInstances.RegionInstancesClient GrpcClient { get; }

The underlying gRPC RegionInstances client

Property Value
TypeDescription
RegionInstances.RegionInstancesClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

BulkInsert(BulkInsertRegionInstanceRequest, CallSettings)

public virtual Operation<Operation, Operation> BulkInsert(BulkInsertRegionInstanceRequest request, CallSettings callSettings = null)

Creates multiple instances in a given region. Count specifies the number of instances to create.

Parameters
NameDescription
requestBulkInsertRegionInstanceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Operation, Operation>

The RPC response.

Example
// Create client
RegionInstancesClient regionInstancesClient = RegionInstancesClient.Create();
// Initialize request argument(s)
BulkInsertRegionInstanceRequest request = new BulkInsertRegionInstanceRequest
{
    RequestId = "",
    BulkInsertInstanceResourceResource = new BulkInsertInstanceResource(),
    Region = "",
    Project = "",
};
// Make the request
lro::Operation<Operation, Operation> response = regionInstancesClient.BulkInsert(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 = regionInstancesClient.PollOnceBulkInsert(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;
}

BulkInsert(String, String, BulkInsertInstanceResource, CallSettings)

public virtual Operation<Operation, Operation> BulkInsert(string project, string region, BulkInsertInstanceResource bulkInsertInstanceResourceResource, CallSettings callSettings = null)

Creates multiple instances in a given region. Count specifies the number of instances to create.

Parameters
NameDescription
projectString

Project ID for this request.

regionString

The name of the region for this request.

bulkInsertInstanceResourceResourceBulkInsertInstanceResource

The body resource for this request

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Operation, Operation>

The RPC response.

Example
// Create client
RegionInstancesClient regionInstancesClient = RegionInstancesClient.Create();
// Initialize request argument(s)
string project = "";
string region = "";
BulkInsertInstanceResource bulkInsertInstanceResourceResource = new BulkInsertInstanceResource();
// Make the request
lro::Operation<Operation, Operation> response = regionInstancesClient.BulkInsert(project, region, bulkInsertInstanceResourceResource);

// 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 = regionInstancesClient.PollOnceBulkInsert(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;
}

BulkInsertAsync(BulkInsertRegionInstanceRequest, CallSettings)

public virtual Task<Operation<Operation, Operation>> BulkInsertAsync(BulkInsertRegionInstanceRequest request, CallSettings callSettings = null)

Creates multiple instances in a given region. Count specifies the number of instances to create.

Parameters
NameDescription
requestBulkInsertRegionInstanceRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Operation, Operation>>

A Task containing the RPC response.

Example
// Create client
RegionInstancesClient regionInstancesClient = await RegionInstancesClient.CreateAsync();
// Initialize request argument(s)
BulkInsertRegionInstanceRequest request = new BulkInsertRegionInstanceRequest
{
    RequestId = "",
    BulkInsertInstanceResourceResource = new BulkInsertInstanceResource(),
    Region = "",
    Project = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await regionInstancesClient.BulkInsertAsync(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 regionInstancesClient.PollOnceBulkInsertAsync(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;
}

BulkInsertAsync(BulkInsertRegionInstanceRequest, CancellationToken)

public virtual Task<Operation<Operation, Operation>> BulkInsertAsync(BulkInsertRegionInstanceRequest request, CancellationToken cancellationToken)

Creates multiple instances in a given region. Count specifies the number of instances to create.

Parameters
NameDescription
requestBulkInsertRegionInstanceRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Operation, Operation>>

A Task containing the RPC response.

Example
// Create client
RegionInstancesClient regionInstancesClient = await RegionInstancesClient.CreateAsync();
// Initialize request argument(s)
BulkInsertRegionInstanceRequest request = new BulkInsertRegionInstanceRequest
{
    RequestId = "",
    BulkInsertInstanceResourceResource = new BulkInsertInstanceResource(),
    Region = "",
    Project = "",
};
// Make the request
lro::Operation<Operation, Operation> response = await regionInstancesClient.BulkInsertAsync(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 regionInstancesClient.PollOnceBulkInsertAsync(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;
}

BulkInsertAsync(String, String, BulkInsertInstanceResource, CallSettings)

public virtual Task<Operation<Operation, Operation>> BulkInsertAsync(string project, string region, BulkInsertInstanceResource bulkInsertInstanceResourceResource, CallSettings callSettings = null)

Creates multiple instances in a given region. Count specifies the number of instances to create.

Parameters
NameDescription
projectString

Project ID for this request.

regionString

The name of the region for this request.

bulkInsertInstanceResourceResourceBulkInsertInstanceResource

The body resource for this request

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Operation, Operation>>

A Task containing the RPC response.

Example
// Create client
RegionInstancesClient regionInstancesClient = await RegionInstancesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
BulkInsertInstanceResource bulkInsertInstanceResourceResource = new BulkInsertInstanceResource();
// Make the request
lro::Operation<Operation, Operation> response = await regionInstancesClient.BulkInsertAsync(project, region, bulkInsertInstanceResourceResource);

// 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 regionInstancesClient.PollOnceBulkInsertAsync(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;
}

BulkInsertAsync(String, String, BulkInsertInstanceResource, CancellationToken)

public virtual Task<Operation<Operation, Operation>> BulkInsertAsync(string project, string region, BulkInsertInstanceResource bulkInsertInstanceResourceResource, CancellationToken cancellationToken)

Creates multiple instances in a given region. Count specifies the number of instances to create.

Parameters
NameDescription
projectString

Project ID for this request.

regionString

The name of the region for this request.

bulkInsertInstanceResourceResourceBulkInsertInstanceResource

The body resource for this request

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Operation, Operation>>

A Task containing the RPC response.

Example
// Create client
RegionInstancesClient regionInstancesClient = await RegionInstancesClient.CreateAsync();
// Initialize request argument(s)
string project = "";
string region = "";
BulkInsertInstanceResource bulkInsertInstanceResourceResource = new BulkInsertInstanceResource();
// Make the request
lro::Operation<Operation, Operation> response = await regionInstancesClient.BulkInsertAsync(project, region, bulkInsertInstanceResourceResource);

// 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 regionInstancesClient.PollOnceBulkInsertAsync(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;
}

Create()

public static RegionInstancesClient Create()

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

Returns
TypeDescription
RegionInstancesClient

The created RegionInstancesClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<RegionInstancesClient>

The task representing the created RegionInstancesClient.

PollOnceBulkInsert(String, CallSettings)

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

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

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

The result of polling the operation.

PollOnceBulkInsertAsync(String, CallSettings)

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

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

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
Task<Operation<Operation, Operation>>

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.