public abstract class InstancesClientReference documentation and code samples for the Cloud Run Admin v2 API class InstancesClient.
Instances client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Run.V2Assembly
Google.Cloud.Run.V2.dll
Remarks
The Cloud Run Instances API allows you to manage Cloud Run Instances.
Properties
CreateInstanceOperationsClient
public virtual OperationsClient CreateInstanceOperationsClient { get; }The long-running operations client for CreateInstance.
| Property Value | |
|---|---|
| Type | Description |
OperationsClient |
|
DefaultEndpoint
public static string DefaultEndpoint { get; }The default endpoint for the Instances service, which is a host of "run.googleapis.com" and a port of 443.
| Property Value | |
|---|---|
| Type | Description |
string |
|
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }The default Instances scopes.
| Property Value | |
|---|---|
| Type | Description |
IReadOnlyListstring |
|
The default Instances scopes are:
DeleteInstanceOperationsClient
public virtual OperationsClient DeleteInstanceOperationsClient { get; }The long-running operations client for DeleteInstance.
| Property Value | |
|---|---|
| Type | Description |
OperationsClient |
|
GrpcClient
public virtual Instances.InstancesClient GrpcClient { get; }The underlying gRPC Instances client
| Property Value | |
|---|---|
| Type | Description |
InstancesInstancesClient |
|
LocationsClient
public virtual LocationsClient LocationsClient { get; }The LocationsClient associated with this client.
| Property Value | |
|---|---|
| Type | Description |
LocationsClient |
|
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }The service metadata associated with this client type.
| Property Value | |
|---|---|
| Type | Description |
ServiceMetadata |
|
StartInstanceOperationsClient
public virtual OperationsClient StartInstanceOperationsClient { get; }The long-running operations client for StartInstance.
| Property Value | |
|---|---|
| Type | Description |
OperationsClient |
|
StopInstanceOperationsClient
public virtual OperationsClient StopInstanceOperationsClient { get; }The long-running operations client for StopInstance.
| Property Value | |
|---|---|
| Type | Description |
OperationsClient |
|
Methods
Create()
public static InstancesClient Create()Synchronously creates a InstancesClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use InstancesClientBuilder.
| Returns | |
|---|---|
| Type | Description |
InstancesClient |
The created InstancesClient. |
CreateAsync(CancellationToken)
public static Task<InstancesClient> CreateAsync(CancellationToken cancellationToken = default)Asynchronously creates a InstancesClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use InstancesClientBuilder.
| Parameter | |
|---|---|
| Name | Description |
cancellationToken |
CancellationTokenThe CancellationToken to use while creating the client. |
| Returns | |
|---|---|
| Type | Description |
TaskInstancesClient |
The task representing the created InstancesClient. |
CreateInstance(LocationName, Instance, CallSettings)
public virtual Operation<Instance, Instance> CreateInstance(LocationName parent, Instance instance, CallSettings callSettings = null)Creates an Instance.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationName |
instance |
Instance |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationInstanceInstance |
The RPC response. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
gcrv::Instance instance = new gcrv::Instance();
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = instancesClient.CreateInstance(parent, instance);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = instancesClient.PollOnceCreateInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
CreateInstance(CreateInstanceRequest, CallSettings)
public virtual Operation<Instance, Instance> CreateInstance(CreateInstanceRequest request, CallSettings callSettings = null)Creates an Instance.
| Parameters | |
|---|---|
| Name | Description |
request |
CreateInstanceRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationInstanceInstance |
The RPC response. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
gcrv::CreateInstanceRequest request = new gcrv::CreateInstanceRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Instance = new gcrv::Instance(),
InstanceId = "",
ValidateOnly = false,
};
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = instancesClient.CreateInstance(request);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = instancesClient.PollOnceCreateInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
CreateInstance(string, Instance, CallSettings)
public virtual Operation<Instance, Instance> CreateInstance(string parent, Instance instance, CallSettings callSettings = null)Creates an Instance.
| Parameters | |
|---|---|
| Name | Description |
parent |
string |
instance |
Instance |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationInstanceInstance |
The RPC response. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
gcrv::Instance instance = new gcrv::Instance();
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = instancesClient.CreateInstance(parent, instance);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = instancesClient.PollOnceCreateInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(LocationName, Instance, CallSettings)
public virtual Task<Operation<Instance, Instance>> CreateInstanceAsync(LocationName parent, Instance instance, CallSettings callSettings = null)Creates an Instance.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationName |
instance |
Instance |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
gcrv::Instance instance = new gcrv::Instance();
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.CreateInstanceAsync(parent, instance);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(LocationName, Instance, CancellationToken)
public virtual Task<Operation<Instance, Instance>> CreateInstanceAsync(LocationName parent, Instance instance, CancellationToken cancellationToken)Creates an Instance.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationName |
instance |
Instance |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
gcrv::Instance instance = new gcrv::Instance();
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.CreateInstanceAsync(parent, instance);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(CreateInstanceRequest, CallSettings)
public virtual Task<Operation<Instance, Instance>> CreateInstanceAsync(CreateInstanceRequest request, CallSettings callSettings = null)Creates an Instance.
| Parameters | |
|---|---|
| Name | Description |
request |
CreateInstanceRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::CreateInstanceRequest request = new gcrv::CreateInstanceRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Instance = new gcrv::Instance(),
InstanceId = "",
ValidateOnly = false,
};
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.CreateInstanceAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(CreateInstanceRequest, CancellationToken)
public virtual Task<Operation<Instance, Instance>> CreateInstanceAsync(CreateInstanceRequest request, CancellationToken cancellationToken)Creates an Instance.
| Parameters | |
|---|---|
| Name | Description |
request |
CreateInstanceRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::CreateInstanceRequest request = new gcrv::CreateInstanceRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Instance = new gcrv::Instance(),
InstanceId = "",
ValidateOnly = false,
};
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.CreateInstanceAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(string, Instance, CallSettings)
public virtual Task<Operation<Instance, Instance>> CreateInstanceAsync(string parent, Instance instance, CallSettings callSettings = null)Creates an Instance.
| Parameters | |
|---|---|
| Name | Description |
parent |
string |
instance |
Instance |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
gcrv::Instance instance = new gcrv::Instance();
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.CreateInstanceAsync(parent, instance);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(string, Instance, CancellationToken)
public virtual Task<Operation<Instance, Instance>> CreateInstanceAsync(string parent, Instance instance, CancellationToken cancellationToken)Creates an Instance.
| Parameters | |
|---|---|
| Name | Description |
parent |
string |
instance |
Instance |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
gcrv::Instance instance = new gcrv::Instance();
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.CreateInstanceAsync(parent, instance);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
DeleteInstance(DeleteInstanceRequest, CallSettings)
public virtual Operation<Instance, Instance> DeleteInstance(DeleteInstanceRequest request, CallSettings callSettings = null)Deletes a Instance
| Parameters | |
|---|---|
| Name | Description |
request |
DeleteInstanceRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationInstanceInstance |
The RPC response. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
gcrv::DeleteInstanceRequest request = new gcrv::DeleteInstanceRequest
{
InstanceName = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
ValidateOnly = false,
Etag = "",
};
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = instancesClient.DeleteInstance(request);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = instancesClient.PollOnceDeleteInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
DeleteInstance(InstanceName, CallSettings)
public virtual Operation<Instance, Instance> DeleteInstance(InstanceName name, CallSettings callSettings = null)Deletes a Instance
| Parameters | |
|---|---|
| Name | Description |
name |
InstanceName |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationInstanceInstance |
The RPC response. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
gcrv::InstanceName name = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = instancesClient.DeleteInstance(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = instancesClient.PollOnceDeleteInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
DeleteInstance(string, CallSettings)
public virtual Operation<Instance, Instance> DeleteInstance(string name, CallSettings callSettings = null)Deletes a Instance
| Parameters | |
|---|---|
| Name | Description |
name |
string |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationInstanceInstance |
The RPC response. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]";
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = instancesClient.DeleteInstance(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = instancesClient.PollOnceDeleteInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
DeleteInstanceAsync(DeleteInstanceRequest, CallSettings)
public virtual Task<Operation<Instance, Instance>> DeleteInstanceAsync(DeleteInstanceRequest request, CallSettings callSettings = null)Deletes a Instance
| Parameters | |
|---|---|
| Name | Description |
request |
DeleteInstanceRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::DeleteInstanceRequest request = new gcrv::DeleteInstanceRequest
{
InstanceName = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
ValidateOnly = false,
Etag = "",
};
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.DeleteInstanceAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceDeleteInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
DeleteInstanceAsync(DeleteInstanceRequest, CancellationToken)
public virtual Task<Operation<Instance, Instance>> DeleteInstanceAsync(DeleteInstanceRequest request, CancellationToken cancellationToken)Deletes a Instance
| Parameters | |
|---|---|
| Name | Description |
request |
DeleteInstanceRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::DeleteInstanceRequest request = new gcrv::DeleteInstanceRequest
{
InstanceName = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
ValidateOnly = false,
Etag = "",
};
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.DeleteInstanceAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceDeleteInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
DeleteInstanceAsync(InstanceName, CallSettings)
public virtual Task<Operation<Instance, Instance>> DeleteInstanceAsync(InstanceName name, CallSettings callSettings = null)Deletes a Instance
| Parameters | |
|---|---|
| Name | Description |
name |
InstanceName |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::InstanceName name = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.DeleteInstanceAsync(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceDeleteInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
DeleteInstanceAsync(InstanceName, CancellationToken)
public virtual Task<Operation<Instance, Instance>> DeleteInstanceAsync(InstanceName name, CancellationToken cancellationToken)Deletes a Instance
| Parameters | |
|---|---|
| Name | Description |
name |
InstanceName |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::InstanceName name = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.DeleteInstanceAsync(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceDeleteInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
DeleteInstanceAsync(string, CallSettings)
public virtual Task<Operation<Instance, Instance>> DeleteInstanceAsync(string name, CallSettings callSettings = null)Deletes a Instance
| Parameters | |
|---|---|
| Name | Description |
name |
string |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]";
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.DeleteInstanceAsync(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceDeleteInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
DeleteInstanceAsync(string, CancellationToken)
public virtual Task<Operation<Instance, Instance>> DeleteInstanceAsync(string name, CancellationToken cancellationToken)Deletes a Instance
| Parameters | |
|---|---|
| Name | Description |
name |
string |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]";
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.DeleteInstanceAsync(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceDeleteInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
GetInstance(GetInstanceRequest, CallSettings)
public virtual Instance GetInstance(GetInstanceRequest request, CallSettings callSettings = null)Gets a Instance
| Parameters | |
|---|---|
| Name | Description |
request |
GetInstanceRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Instance |
The RPC response. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
gcrv::GetInstanceRequest request = new gcrv::GetInstanceRequest
{
InstanceName = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
};
// Make the request
gcrv::Instance response = instancesClient.GetInstance(request);
GetInstance(InstanceName, CallSettings)
public virtual Instance GetInstance(InstanceName name, CallSettings callSettings = null)Gets a Instance
| Parameters | |
|---|---|
| Name | Description |
name |
InstanceName |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Instance |
The RPC response. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
gcrv::InstanceName name = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
gcrv::Instance response = instancesClient.GetInstance(name);
GetInstance(string, CallSettings)
public virtual Instance GetInstance(string name, CallSettings callSettings = null)Gets a Instance
| Parameters | |
|---|---|
| Name | Description |
name |
string |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Instance |
The RPC response. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]";
// Make the request
gcrv::Instance response = instancesClient.GetInstance(name);
GetInstanceAsync(GetInstanceRequest, CallSettings)
public virtual Task<Instance> GetInstanceAsync(GetInstanceRequest request, CallSettings callSettings = null)Gets a Instance
| Parameters | |
|---|---|
| Name | Description |
request |
GetInstanceRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::GetInstanceRequest request = new gcrv::GetInstanceRequest
{
InstanceName = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
};
// Make the request
gcrv::Instance response = await instancesClient.GetInstanceAsync(request);
GetInstanceAsync(GetInstanceRequest, CancellationToken)
public virtual Task<Instance> GetInstanceAsync(GetInstanceRequest request, CancellationToken cancellationToken)Gets a Instance
| Parameters | |
|---|---|
| Name | Description |
request |
GetInstanceRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::GetInstanceRequest request = new gcrv::GetInstanceRequest
{
InstanceName = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
};
// Make the request
gcrv::Instance response = await instancesClient.GetInstanceAsync(request);
GetInstanceAsync(InstanceName, CallSettings)
public virtual Task<Instance> GetInstanceAsync(InstanceName name, CallSettings callSettings = null)Gets a Instance
| Parameters | |
|---|---|
| Name | Description |
name |
InstanceName |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::InstanceName name = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
gcrv::Instance response = await instancesClient.GetInstanceAsync(name);
GetInstanceAsync(InstanceName, CancellationToken)
public virtual Task<Instance> GetInstanceAsync(InstanceName name, CancellationToken cancellationToken)Gets a Instance
| Parameters | |
|---|---|
| Name | Description |
name |
InstanceName |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::InstanceName name = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
gcrv::Instance response = await instancesClient.GetInstanceAsync(name);
GetInstanceAsync(string, CallSettings)
public virtual Task<Instance> GetInstanceAsync(string name, CallSettings callSettings = null)Gets a Instance
| Parameters | |
|---|---|
| Name | Description |
name |
string |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]";
// Make the request
gcrv::Instance response = await instancesClient.GetInstanceAsync(name);
GetInstanceAsync(string, CancellationToken)
public virtual Task<Instance> GetInstanceAsync(string name, CancellationToken cancellationToken)Gets a Instance
| Parameters | |
|---|---|
| Name | Description |
name |
string |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]";
// Make the request
gcrv::Instance response = await instancesClient.GetInstanceAsync(name);
ListInstances(LocationName, string, int?, CallSettings)
public virtual PagedEnumerable<ListInstancesResponse, Instance> ListInstances(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)Lists Instances. Results are sorted by creation time, descending.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. The location and project to list resources on. Format: projects/{project}/locations/{location}, where {project} can be project id or number. |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListInstancesResponseInstance |
A pageable sequence of Instance resources. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<gcrv::ListInstancesResponse, gcrv::Instance> response = instancesClient.ListInstances(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (gcrv::Instance item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (gcrv::ListInstancesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (gcrv::Instance item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gcrv::Instance> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gcrv::Instance item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInstances(ListInstancesRequest, CallSettings)
public virtual PagedEnumerable<ListInstancesResponse, Instance> ListInstances(ListInstancesRequest request, CallSettings callSettings = null)Lists Instances. Results are sorted by creation time, descending.
| Parameters | |
|---|---|
| Name | Description |
request |
ListInstancesRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListInstancesResponseInstance |
A pageable sequence of Instance resources. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
gcrv::ListInstancesRequest request = new gcrv::ListInstancesRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
ShowDeleted = false,
};
// Make the request
PagedEnumerable<gcrv::ListInstancesResponse, gcrv::Instance> response = instancesClient.ListInstances(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (gcrv::Instance item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (gcrv::ListInstancesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (gcrv::Instance item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gcrv::Instance> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gcrv::Instance item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInstances(string, string, int?, CallSettings)
public virtual PagedEnumerable<ListInstancesResponse, Instance> ListInstances(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)Lists Instances. Results are sorted by creation time, descending.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The location and project to list resources on. Format: projects/{project}/locations/{location}, where {project} can be project id or number. |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListInstancesResponseInstance |
A pageable sequence of Instance resources. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<gcrv::ListInstancesResponse, gcrv::Instance> response = instancesClient.ListInstances(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (gcrv::Instance item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (gcrv::ListInstancesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (gcrv::Instance item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gcrv::Instance> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gcrv::Instance item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInstancesAsync(LocationName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListInstancesResponse, Instance> ListInstancesAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)Lists Instances. Results are sorted by creation time, descending.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. The location and project to list resources on. Format: projects/{project}/locations/{location}, where {project} can be project id or number. |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListInstancesResponseInstance |
A pageable asynchronous sequence of Instance resources. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<gcrv::ListInstancesResponse, gcrv::Instance> response = instancesClient.ListInstancesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (gcrv::Instance item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (gcrv::ListInstancesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (gcrv::Instance item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gcrv::Instance> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gcrv::Instance item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInstancesAsync(ListInstancesRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListInstancesResponse, Instance> ListInstancesAsync(ListInstancesRequest request, CallSettings callSettings = null)Lists Instances. Results are sorted by creation time, descending.
| Parameters | |
|---|---|
| Name | Description |
request |
ListInstancesRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListInstancesResponseInstance |
A pageable asynchronous sequence of Instance resources. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::ListInstancesRequest request = new gcrv::ListInstancesRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
ShowDeleted = false,
};
// Make the request
PagedAsyncEnumerable<gcrv::ListInstancesResponse, gcrv::Instance> response = instancesClient.ListInstancesAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await foreach (gcrv::Instance item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (gcrv::ListInstancesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (gcrv::Instance item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gcrv::Instance> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gcrv::Instance item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListInstancesAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListInstancesResponse, Instance> ListInstancesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)Lists Instances. Results are sorted by creation time, descending.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The location and project to list resources on. Format: projects/{project}/locations/{location}, where {project} can be project id or number. |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListInstancesResponseInstance |
A pageable asynchronous sequence of Instance resources. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<gcrv::ListInstancesResponse, gcrv::Instance> response = instancesClient.ListInstancesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (gcrv::Instance item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (gcrv::ListInstancesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (gcrv::Instance item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gcrv::Instance> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gcrv::Instance item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
PollOnceCreateInstance(string, CallSettings)
public virtual Operation<Instance, Instance> PollOnceCreateInstance(string operationName, CallSettings callSettings = null)Poll an operation once, using an operationName from a previous invocation of CreateInstance.
| Parameters | |
|---|---|
| Name | Description |
operationName |
stringThe name of a previously invoked operation. Must not be |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationInstanceInstance |
The result of polling the operation. |
PollOnceCreateInstanceAsync(string, CallSettings)
public virtual Task<Operation<Instance, Instance>> PollOnceCreateInstanceAsync(string operationName, CallSettings callSettings = null)Asynchronously poll an operation once, using an operationName from a previous invocation of
CreateInstance.
| Parameters | |
|---|---|
| Name | Description |
operationName |
stringThe name of a previously invoked operation. Must not be |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A task representing the result of polling the operation. |
PollOnceDeleteInstance(string, CallSettings)
public virtual Operation<Instance, Instance> PollOnceDeleteInstance(string operationName, CallSettings callSettings = null)Poll an operation once, using an operationName from a previous invocation of DeleteInstance.
| Parameters | |
|---|---|
| Name | Description |
operationName |
stringThe name of a previously invoked operation. Must not be |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationInstanceInstance |
The result of polling the operation. |
PollOnceDeleteInstanceAsync(string, CallSettings)
public virtual Task<Operation<Instance, Instance>> PollOnceDeleteInstanceAsync(string operationName, CallSettings callSettings = null)Asynchronously poll an operation once, using an operationName from a previous invocation of
DeleteInstance.
| Parameters | |
|---|---|
| Name | Description |
operationName |
stringThe name of a previously invoked operation. Must not be |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A task representing the result of polling the operation. |
PollOnceStartInstance(string, CallSettings)
public virtual Operation<Instance, Instance> PollOnceStartInstance(string operationName, CallSettings callSettings = null)Poll an operation once, using an operationName from a previous invocation of StartInstance.
| Parameters | |
|---|---|
| Name | Description |
operationName |
stringThe name of a previously invoked operation. Must not be |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationInstanceInstance |
The result of polling the operation. |
PollOnceStartInstanceAsync(string, CallSettings)
public virtual Task<Operation<Instance, Instance>> PollOnceStartInstanceAsync(string operationName, CallSettings callSettings = null)Asynchronously poll an operation once, using an operationName from a previous invocation of
StartInstance.
| Parameters | |
|---|---|
| Name | Description |
operationName |
stringThe name of a previously invoked operation. Must not be |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A task representing the result of polling the operation. |
PollOnceStopInstance(string, CallSettings)
public virtual Operation<Instance, Instance> PollOnceStopInstance(string operationName, CallSettings callSettings = null)Poll an operation once, using an operationName from a previous invocation of StopInstance.
| Parameters | |
|---|---|
| Name | Description |
operationName |
stringThe name of a previously invoked operation. Must not be |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationInstanceInstance |
The result of polling the operation. |
PollOnceStopInstanceAsync(string, CallSettings)
public virtual Task<Operation<Instance, Instance>> PollOnceStopInstanceAsync(string operationName, CallSettings callSettings = null)Asynchronously poll an operation once, using an operationName from a previous invocation of
StopInstance.
| Parameters | |
|---|---|
| Name | Description |
operationName |
stringThe name of a previously invoked operation. Must not be |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
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.
StartInstance(InstanceName, CallSettings)
public virtual Operation<Instance, Instance> StartInstance(InstanceName name, CallSettings callSettings = null)Starts an Instance.
| Parameters | |
|---|---|
| Name | Description |
name |
InstanceNameRequired. The name of the Instance to stop.
Format:
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationInstanceInstance |
The RPC response. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
gcrv::InstanceName name = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = instancesClient.StartInstance(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = instancesClient.PollOnceStartInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StartInstance(StartInstanceRequest, CallSettings)
public virtual Operation<Instance, Instance> StartInstance(StartInstanceRequest request, CallSettings callSettings = null)Starts an Instance.
| Parameters | |
|---|---|
| Name | Description |
request |
StartInstanceRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationInstanceInstance |
The RPC response. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
gcrv::StartInstanceRequest request = new gcrv::StartInstanceRequest
{
InstanceName = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
ValidateOnly = false,
Etag = "",
};
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = instancesClient.StartInstance(request);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = instancesClient.PollOnceStartInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StartInstance(string, CallSettings)
public virtual Operation<Instance, Instance> StartInstance(string name, CallSettings callSettings = null)Starts an Instance.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The name of the Instance to stop.
Format:
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationInstanceInstance |
The RPC response. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]";
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = instancesClient.StartInstance(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = instancesClient.PollOnceStartInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StartInstanceAsync(InstanceName, CallSettings)
public virtual Task<Operation<Instance, Instance>> StartInstanceAsync(InstanceName name, CallSettings callSettings = null)Starts an Instance.
| Parameters | |
|---|---|
| Name | Description |
name |
InstanceNameRequired. The name of the Instance to stop.
Format:
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::InstanceName name = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.StartInstanceAsync(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceStartInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StartInstanceAsync(InstanceName, CancellationToken)
public virtual Task<Operation<Instance, Instance>> StartInstanceAsync(InstanceName name, CancellationToken cancellationToken)Starts an Instance.
| Parameters | |
|---|---|
| Name | Description |
name |
InstanceNameRequired. The name of the Instance to stop.
Format:
|
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::InstanceName name = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.StartInstanceAsync(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceStartInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StartInstanceAsync(StartInstanceRequest, CallSettings)
public virtual Task<Operation<Instance, Instance>> StartInstanceAsync(StartInstanceRequest request, CallSettings callSettings = null)Starts an Instance.
| Parameters | |
|---|---|
| Name | Description |
request |
StartInstanceRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::StartInstanceRequest request = new gcrv::StartInstanceRequest
{
InstanceName = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
ValidateOnly = false,
Etag = "",
};
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.StartInstanceAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceStartInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StartInstanceAsync(StartInstanceRequest, CancellationToken)
public virtual Task<Operation<Instance, Instance>> StartInstanceAsync(StartInstanceRequest request, CancellationToken cancellationToken)Starts an Instance.
| Parameters | |
|---|---|
| Name | Description |
request |
StartInstanceRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::StartInstanceRequest request = new gcrv::StartInstanceRequest
{
InstanceName = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
ValidateOnly = false,
Etag = "",
};
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.StartInstanceAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceStartInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StartInstanceAsync(string, CallSettings)
public virtual Task<Operation<Instance, Instance>> StartInstanceAsync(string name, CallSettings callSettings = null)Starts an Instance.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The name of the Instance to stop.
Format:
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]";
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.StartInstanceAsync(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceStartInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StartInstanceAsync(string, CancellationToken)
public virtual Task<Operation<Instance, Instance>> StartInstanceAsync(string name, CancellationToken cancellationToken)Starts an Instance.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The name of the Instance to stop.
Format:
|
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]";
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.StartInstanceAsync(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceStartInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StopInstance(InstanceName, CallSettings)
public virtual Operation<Instance, Instance> StopInstance(InstanceName name, CallSettings callSettings = null)Stops an Instance.
| Parameters | |
|---|---|
| Name | Description |
name |
InstanceNameRequired. The name of the Instance to stop.
Format:
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationInstanceInstance |
The RPC response. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
gcrv::InstanceName name = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = instancesClient.StopInstance(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = instancesClient.PollOnceStopInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StopInstance(StopInstanceRequest, CallSettings)
public virtual Operation<Instance, Instance> StopInstance(StopInstanceRequest request, CallSettings callSettings = null)Stops an Instance.
| Parameters | |
|---|---|
| Name | Description |
request |
StopInstanceRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationInstanceInstance |
The RPC response. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
gcrv::StopInstanceRequest request = new gcrv::StopInstanceRequest
{
InstanceName = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
ValidateOnly = false,
Etag = "",
};
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = instancesClient.StopInstance(request);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = instancesClient.PollOnceStopInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StopInstance(string, CallSettings)
public virtual Operation<Instance, Instance> StopInstance(string name, CallSettings callSettings = null)Stops an Instance.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The name of the Instance to stop.
Format:
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationInstanceInstance |
The RPC response. |
// Create client
gcrv::InstancesClient instancesClient = gcrv::InstancesClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]";
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = instancesClient.StopInstance(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = instancesClient.PollOnceStopInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StopInstanceAsync(InstanceName, CallSettings)
public virtual Task<Operation<Instance, Instance>> StopInstanceAsync(InstanceName name, CallSettings callSettings = null)Stops an Instance.
| Parameters | |
|---|---|
| Name | Description |
name |
InstanceNameRequired. The name of the Instance to stop.
Format:
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::InstanceName name = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.StopInstanceAsync(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceStopInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StopInstanceAsync(InstanceName, CancellationToken)
public virtual Task<Operation<Instance, Instance>> StopInstanceAsync(InstanceName name, CancellationToken cancellationToken)Stops an Instance.
| Parameters | |
|---|---|
| Name | Description |
name |
InstanceNameRequired. The name of the Instance to stop.
Format:
|
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::InstanceName name = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.StopInstanceAsync(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceStopInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StopInstanceAsync(StopInstanceRequest, CallSettings)
public virtual Task<Operation<Instance, Instance>> StopInstanceAsync(StopInstanceRequest request, CallSettings callSettings = null)Stops an Instance.
| Parameters | |
|---|---|
| Name | Description |
request |
StopInstanceRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::StopInstanceRequest request = new gcrv::StopInstanceRequest
{
InstanceName = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
ValidateOnly = false,
Etag = "",
};
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.StopInstanceAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceStopInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StopInstanceAsync(StopInstanceRequest, CancellationToken)
public virtual Task<Operation<Instance, Instance>> StopInstanceAsync(StopInstanceRequest request, CancellationToken cancellationToken)Stops an Instance.
| Parameters | |
|---|---|
| Name | Description |
request |
StopInstanceRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
gcrv::StopInstanceRequest request = new gcrv::StopInstanceRequest
{
InstanceName = gcrv::InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
ValidateOnly = false,
Etag = "",
};
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.StopInstanceAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceStopInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StopInstanceAsync(string, CallSettings)
public virtual Task<Operation<Instance, Instance>> StopInstanceAsync(string name, CallSettings callSettings = null)Stops an Instance.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The name of the Instance to stop.
Format:
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]";
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.StopInstanceAsync(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceStopInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}
StopInstanceAsync(string, CancellationToken)
public virtual Task<Operation<Instance, Instance>> StopInstanceAsync(string name, CancellationToken cancellationToken)Stops an Instance.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The name of the Instance to stop.
Format:
|
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationInstanceInstance |
A Task containing the RPC response. |
// Create client
gcrv::InstancesClient instancesClient = await gcrv::InstancesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]";
// Make the request
Operation<gcrv::Instance, gcrv::Instance> response = await instancesClient.StopInstanceAsync(name);
// Poll until the returned long-running operation is complete
Operation<gcrv::Instance, gcrv::Instance> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcrv::Instance 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
Operation<gcrv::Instance, gcrv::Instance> retrievedResponse = await instancesClient.PollOnceStopInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcrv::Instance retrievedResult = retrievedResponse.Result;
}