public abstract class RegionInstancesClient
RegionInstances client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Compute.V1Assembly
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default RegionInstances scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyList<String> |
The default RegionInstances scopes are:
GrpcClient
public virtual RegionInstances.RegionInstancesClient GrpcClient { get; }
The underlying gRPC RegionInstances client
Property Value | |
---|---|
Type | Description |
RegionInstances.RegionInstancesClient |
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 | |
---|---|
Name | Description |
request | BulkInsertRegionInstanceRequest 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 |
Operation<Operation, Operation> | The RPC response. |
// 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 | |
---|---|
Name | Description |
project | String Project ID for this request. |
region | String The name of the region for this request. |
bulkInsertInstanceResourceResource | BulkInsertInstanceResource The body resource for this request |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Operation, Operation> | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | BulkInsertRegionInstanceRequest 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 |
Task<Operation<Operation, Operation>> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | BulkInsertRegionInstanceRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Operation, Operation>> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
project | String Project ID for this request. |
region | String The name of the region for this request. |
bulkInsertInstanceResourceResource | BulkInsertInstanceResource The body resource for this request |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Operation, Operation>> | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
project | String Project ID for this request. |
region | String The name of the region for this request. |
bulkInsertInstanceResourceResource | BulkInsertInstanceResource The body resource for this request |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Operation, Operation>> | A Task containing the RPC response. |
// 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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
Task | A task representing the asynchronous shutdown operation. |
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.