public abstract class AlloyDBAdminClient
Reference documentation and code samples for the AlloyDB v1beta API class AlloyDBAdminClient.
AlloyDBAdmin client wrapper, for convenient use.
Derived Types
Namespace
GoogleCloudGoogle.Cloud.AlloyDbV1BetaAssembly
Google.Cloud.AlloyDb.V1Beta.dll
Remarks
Service describing handlers for resources
Properties
BatchCreateInstancesOperationsClient
public virtual OperationsClient BatchCreateInstancesOperationsClient { get; }
The long-running operations client for BatchCreateInstances
.
Type | Description |
OperationsClient |
CreateBackupOperationsClient
public virtual OperationsClient CreateBackupOperationsClient { get; }
The long-running operations client for CreateBackup
.
Type | Description |
OperationsClient |
CreateClusterOperationsClient
public virtual OperationsClient CreateClusterOperationsClient { get; }
The long-running operations client for CreateCluster
.
Type | Description |
OperationsClient |
CreateInstanceOperationsClient
public virtual OperationsClient CreateInstanceOperationsClient { get; }
The long-running operations client for CreateInstance
.
Type | Description |
OperationsClient |
CreateSecondaryClusterOperationsClient
public virtual OperationsClient CreateSecondaryClusterOperationsClient { get; }
The long-running operations client for CreateSecondaryCluster
.
Type | Description |
OperationsClient |
CreateSecondaryInstanceOperationsClient
public virtual OperationsClient CreateSecondaryInstanceOperationsClient { get; }
The long-running operations client for CreateSecondaryInstance
.
Type | Description |
OperationsClient |
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the AlloyDBAdmin service, which is a host of "alloydb.googleapis.com" and a port of 443.
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default AlloyDBAdmin scopes.
Type | Description |
IReadOnlyListstring |
The default AlloyDBAdmin scopes are:
DeleteBackupOperationsClient
public virtual OperationsClient DeleteBackupOperationsClient { get; }
The long-running operations client for DeleteBackup
.
Type | Description |
OperationsClient |
DeleteClusterOperationsClient
public virtual OperationsClient DeleteClusterOperationsClient { get; }
The long-running operations client for DeleteCluster
.
Type | Description |
OperationsClient |
DeleteInstanceOperationsClient
public virtual OperationsClient DeleteInstanceOperationsClient { get; }
The long-running operations client for DeleteInstance
.
Type | Description |
OperationsClient |
FailoverInstanceOperationsClient
public virtual OperationsClient FailoverInstanceOperationsClient { get; }
The long-running operations client for FailoverInstance
.
Type | Description |
OperationsClient |
GrpcClient
public virtual AlloyDBAdmin.AlloyDBAdminClient GrpcClient { get; }
The underlying gRPC AlloyDBAdmin client
Type | Description |
AlloyDBAdminAlloyDBAdminClient |
IAMPolicyClient
public virtual IAMPolicyClient IAMPolicyClient { get; }
The IAMPolicyClient associated with this client.
Type | Description |
IAMPolicyClient |
LocationsClient
public virtual LocationsClient LocationsClient { get; }
The LocationsClient associated with this client.
Type | Description |
LocationsClient |
PromoteClusterOperationsClient
public virtual OperationsClient PromoteClusterOperationsClient { get; }
The long-running operations client for PromoteCluster
.
Type | Description |
OperationsClient |
RestartInstanceOperationsClient
public virtual OperationsClient RestartInstanceOperationsClient { get; }
The long-running operations client for RestartInstance
.
Type | Description |
OperationsClient |
RestoreClusterOperationsClient
public virtual OperationsClient RestoreClusterOperationsClient { get; }
The long-running operations client for RestoreCluster
.
Type | Description |
OperationsClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Type | Description |
ServiceMetadata |
UpdateBackupOperationsClient
public virtual OperationsClient UpdateBackupOperationsClient { get; }
The long-running operations client for UpdateBackup
.
Type | Description |
OperationsClient |
UpdateClusterOperationsClient
public virtual OperationsClient UpdateClusterOperationsClient { get; }
The long-running operations client for UpdateCluster
.
Type | Description |
OperationsClient |
UpdateInstanceOperationsClient
public virtual OperationsClient UpdateInstanceOperationsClient { get; }
The long-running operations client for UpdateInstance
.
Type | Description |
OperationsClient |
Methods
BatchCreateInstances(BatchCreateInstancesRequest, CallSettings)
public virtual Operation<BatchCreateInstancesResponse, OperationMetadata> BatchCreateInstances(BatchCreateInstancesRequest request, CallSettings callSettings = null)
Creates new instances under the given project, location and cluster. There can be only one primary instance in a cluster. If the primary instance exists in the cluster as well as this request, then API will throw an error. The primary instance should exist before any read pool instance is created. If the primary instance is a part of the request payload, then the API will take care of creating instances in the correct order. This method is here to support Google-internal use cases, and is not meant for external customers to consume. Please do not start relying on it; its behavior is subject to change without notice.
Name | Description |
request | BatchCreateInstancesRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
OperationBatchCreateInstancesResponseOperationMetadata | The RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.Create();
// Initialize request argument(s)
BatchCreateInstancesRequest request = new BatchCreateInstancesRequest
{
ParentAsClusterName = ClusterName.FromProjectLocationCluster("[PROJECT]", "[LOCATION]", "[CLUSTER]"),
Requests = new CreateInstanceRequests(),
RequestId = "",
};
// Make the request
Operation<BatchCreateInstancesResponse, OperationMetadata> response = alloyDBAdminClient.BatchCreateInstances(request);
// Poll until the returned long-running operation is complete
Operation<BatchCreateInstancesResponse, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
BatchCreateInstancesResponse 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<BatchCreateInstancesResponse, OperationMetadata> retrievedResponse = alloyDBAdminClient.PollOnceBatchCreateInstances(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchCreateInstancesResponse retrievedResult = retrievedResponse.Result;
}
BatchCreateInstancesAsync(BatchCreateInstancesRequest, CallSettings)
public virtual Task<Operation<BatchCreateInstancesResponse, OperationMetadata>> BatchCreateInstancesAsync(BatchCreateInstancesRequest request, CallSettings callSettings = null)
Creates new instances under the given project, location and cluster. There can be only one primary instance in a cluster. If the primary instance exists in the cluster as well as this request, then API will throw an error. The primary instance should exist before any read pool instance is created. If the primary instance is a part of the request payload, then the API will take care of creating instances in the correct order. This method is here to support Google-internal use cases, and is not meant for external customers to consume. Please do not start relying on it; its behavior is subject to change without notice.
Name | Description |
request | BatchCreateInstancesRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
TaskOperationBatchCreateInstancesResponseOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
BatchCreateInstancesRequest request = new BatchCreateInstancesRequest
{
ParentAsClusterName = ClusterName.FromProjectLocationCluster("[PROJECT]", "[LOCATION]", "[CLUSTER]"),
Requests = new CreateInstanceRequests(),
RequestId = "",
};
// Make the request
Operation<BatchCreateInstancesResponse, OperationMetadata> response = await alloyDBAdminClient.BatchCreateInstancesAsync(request);
// Poll until the returned long-running operation is complete
Operation<BatchCreateInstancesResponse, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchCreateInstancesResponse 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<BatchCreateInstancesResponse, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceBatchCreateInstancesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchCreateInstancesResponse retrievedResult = retrievedResponse.Result;
}
BatchCreateInstancesAsync(BatchCreateInstancesRequest, CancellationToken)
public virtual Task<Operation<BatchCreateInstancesResponse, OperationMetadata>> BatchCreateInstancesAsync(BatchCreateInstancesRequest request, CancellationToken cancellationToken)
Creates new instances under the given project, location and cluster. There can be only one primary instance in a cluster. If the primary instance exists in the cluster as well as this request, then API will throw an error. The primary instance should exist before any read pool instance is created. If the primary instance is a part of the request payload, then the API will take care of creating instances in the correct order. This method is here to support Google-internal use cases, and is not meant for external customers to consume. Please do not start relying on it; its behavior is subject to change without notice.
Name | Description |
request | BatchCreateInstancesRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
TaskOperationBatchCreateInstancesResponseOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
BatchCreateInstancesRequest request = new BatchCreateInstancesRequest
{
ParentAsClusterName = ClusterName.FromProjectLocationCluster("[PROJECT]", "[LOCATION]", "[CLUSTER]"),
Requests = new CreateInstanceRequests(),
RequestId = "",
};
// Make the request
Operation<BatchCreateInstancesResponse, OperationMetadata> response = await alloyDBAdminClient.BatchCreateInstancesAsync(request);
// Poll until the returned long-running operation is complete
Operation<BatchCreateInstancesResponse, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchCreateInstancesResponse 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<BatchCreateInstancesResponse, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceBatchCreateInstancesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchCreateInstancesResponse retrievedResult = retrievedResponse.Result;
}
Create()
public static AlloyDBAdminClient Create()
Synchronously creates a AlloyDBAdminClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AlloyDBAdminClientBuilder.
Type | Description |
AlloyDBAdminClient | The created AlloyDBAdminClient. |
CreateAsync(CancellationToken)
public static Task<AlloyDBAdminClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a AlloyDBAdminClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AlloyDBAdminClientBuilder.
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Type | Description |
TaskAlloyDBAdminClient | The task representing the created AlloyDBAdminClient. |
CreateBackup(LocationName, Backup, string, CallSettings)
public virtual Operation<Backup, OperationMetadata> CreateBackup(LocationName parent, Backup backup, string backupId, CallSettings callSettings = null)
Creates a new Backup in a given project and location.
Name | Description |
parent | LocationName Required. Value for parent. |
backup | Backup Required. The resource being created |
backupId | string Required. ID of the requesting object. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
OperationBackupOperationMetadata | The RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Backup backup = new Backup();
string backupId = "";
// Make the request
Operation<Backup, OperationMetadata> response = alloyDBAdminClient.CreateBackup(parent, backup, backupId);
// Poll until the returned long-running operation is complete
Operation<Backup, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Backup 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<Backup, OperationMetadata> retrievedResponse = alloyDBAdminClient.PollOnceCreateBackup(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Backup retrievedResult = retrievedResponse.Result;
}
CreateBackup(CreateBackupRequest, CallSettings)
public virtual Operation<Backup, OperationMetadata> CreateBackup(CreateBackupRequest request, CallSettings callSettings = null)
Creates a new Backup in a given project and location.
Name | Description |
request | CreateBackupRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
OperationBackupOperationMetadata | The RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.Create();
// Initialize request argument(s)
CreateBackupRequest request = new CreateBackupRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
BackupId = "",
Backup = new Backup(),
RequestId = "",
ValidateOnly = false,
};
// Make the request
Operation<Backup, OperationMetadata> response = alloyDBAdminClient.CreateBackup(request);
// Poll until the returned long-running operation is complete
Operation<Backup, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Backup 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<Backup, OperationMetadata> retrievedResponse = alloyDBAdminClient.PollOnceCreateBackup(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Backup retrievedResult = retrievedResponse.Result;
}
CreateBackup(string, Backup, string, CallSettings)
public virtual Operation<Backup, OperationMetadata> CreateBackup(string parent, Backup backup, string backupId, CallSettings callSettings = null)
Creates a new Backup in a given project and location.
Name | Description |
parent | string Required. Value for parent. |
backup | Backup Required. The resource being created |
backupId | string Required. ID of the requesting object. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
OperationBackupOperationMetadata | The RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Backup backup = new Backup();
string backupId = "";
// Make the request
Operation<Backup, OperationMetadata> response = alloyDBAdminClient.CreateBackup(parent, backup, backupId);
// Poll until the returned long-running operation is complete
Operation<Backup, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Backup 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<Backup, OperationMetadata> retrievedResponse = alloyDBAdminClient.PollOnceCreateBackup(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Backup retrievedResult = retrievedResponse.Result;
}
CreateBackupAsync(LocationName, Backup, string, CallSettings)
public virtual Task<Operation<Backup, OperationMetadata>> CreateBackupAsync(LocationName parent, Backup backup, string backupId, CallSettings callSettings = null)
Creates a new Backup in a given project and location.
Name | Description |
parent | LocationName Required. Value for parent. |
backup | Backup Required. The resource being created |
backupId | string Required. ID of the requesting object. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
TaskOperationBackupOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Backup backup = new Backup();
string backupId = "";
// Make the request
Operation<Backup, OperationMetadata> response = await alloyDBAdminClient.CreateBackupAsync(parent, backup, backupId);
// Poll until the returned long-running operation is complete
Operation<Backup, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Backup 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<Backup, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateBackupAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Backup retrievedResult = retrievedResponse.Result;
}
CreateBackupAsync(LocationName, Backup, string, CancellationToken)
public virtual Task<Operation<Backup, OperationMetadata>> CreateBackupAsync(LocationName parent, Backup backup, string backupId, CancellationToken cancellationToken)
Creates a new Backup in a given project and location.
Name | Description |
parent | LocationName Required. Value for parent. |
backup | Backup Required. The resource being created |
backupId | string Required. ID of the requesting object. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
TaskOperationBackupOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Backup backup = new Backup();
string backupId = "";
// Make the request
Operation<Backup, OperationMetadata> response = await alloyDBAdminClient.CreateBackupAsync(parent, backup, backupId);
// Poll until the returned long-running operation is complete
Operation<Backup, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Backup 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<Backup, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateBackupAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Backup retrievedResult = retrievedResponse.Result;
}
CreateBackupAsync(CreateBackupRequest, CallSettings)
public virtual Task<Operation<Backup, OperationMetadata>> CreateBackupAsync(CreateBackupRequest request, CallSettings callSettings = null)
Creates a new Backup in a given project and location.
Name | Description |
request | CreateBackupRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
TaskOperationBackupOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
CreateBackupRequest request = new CreateBackupRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
BackupId = "",
Backup = new Backup(),
RequestId = "",
ValidateOnly = false,
};
// Make the request
Operation<Backup, OperationMetadata> response = await alloyDBAdminClient.CreateBackupAsync(request);
// Poll until the returned long-running operation is complete
Operation<Backup, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Backup 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<Backup, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateBackupAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Backup retrievedResult = retrievedResponse.Result;
}
CreateBackupAsync(CreateBackupRequest, CancellationToken)
public virtual Task<Operation<Backup, OperationMetadata>> CreateBackupAsync(CreateBackupRequest request, CancellationToken cancellationToken)
Creates a new Backup in a given project and location.
Name | Description |
request | CreateBackupRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
TaskOperationBackupOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
CreateBackupRequest request = new CreateBackupRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
BackupId = "",
Backup = new Backup(),
RequestId = "",
ValidateOnly = false,
};
// Make the request
Operation<Backup, OperationMetadata> response = await alloyDBAdminClient.CreateBackupAsync(request);
// Poll until the returned long-running operation is complete
Operation<Backup, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Backup 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<Backup, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateBackupAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Backup retrievedResult = retrievedResponse.Result;
}
CreateBackupAsync(string, Backup, string, CallSettings)
public virtual Task<Operation<Backup, OperationMetadata>> CreateBackupAsync(string parent, Backup backup, string backupId, CallSettings callSettings = null)
Creates a new Backup in a given project and location.
Name | Description |
parent | string Required. Value for parent. |
backup | Backup Required. The resource being created |
backupId | string Required. ID of the requesting object. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
TaskOperationBackupOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Backup backup = new Backup();
string backupId = "";
// Make the request
Operation<Backup, OperationMetadata> response = await alloyDBAdminClient.CreateBackupAsync(parent, backup, backupId);
// Poll until the returned long-running operation is complete
Operation<Backup, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Backup 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<Backup, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateBackupAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Backup retrievedResult = retrievedResponse.Result;
}
CreateBackupAsync(string, Backup, string, CancellationToken)
public virtual Task<Operation<Backup, OperationMetadata>> CreateBackupAsync(string parent, Backup backup, string backupId, CancellationToken cancellationToken)
Creates a new Backup in a given project and location.
Name | Description |
parent | string Required. Value for parent. |
backup | Backup Required. The resource being created |
backupId | string Required. ID of the requesting object. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
TaskOperationBackupOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Backup backup = new Backup();
string backupId = "";
// Make the request
Operation<Backup, OperationMetadata> response = await alloyDBAdminClient.CreateBackupAsync(parent, backup, backupId);
// Poll until the returned long-running operation is complete
Operation<Backup, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Backup 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<Backup, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateBackupAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Backup retrievedResult = retrievedResponse.Result;
}
CreateCluster(LocationName, Cluster, string, CallSettings)
public virtual Operation<Cluster, OperationMetadata> CreateCluster(LocationName parent, Cluster cluster, string clusterId, CallSettings callSettings = null)
Creates a new Cluster in a given project and location.
Name | Description |
parent | LocationName Required. The name of the parent resource. For the required format, see the comment on the Cluster.name field. |
cluster | Cluster Required. The resource being created |
clusterId | string Required. ID of the requesting object. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
OperationClusterOperationMetadata | The RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Cluster cluster = new Cluster();
string clusterId = "";
// Make the request
Operation<Cluster, OperationMetadata> response = alloyDBAdminClient.CreateCluster(parent, cluster, clusterId);
// Poll until the returned long-running operation is complete
Operation<Cluster, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Cluster 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<Cluster, OperationMetadata> retrievedResponse = alloyDBAdminClient.PollOnceCreateCluster(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Cluster retrievedResult = retrievedResponse.Result;
}
CreateCluster(CreateClusterRequest, CallSettings)
public virtual Operation<Cluster, OperationMetadata> CreateCluster(CreateClusterRequest request, CallSettings callSettings = null)
Creates a new Cluster in a given project and location.
Name | Description |
request | CreateClusterRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
OperationClusterOperationMetadata | The RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.Create();
// Initialize request argument(s)
CreateClusterRequest request = new CreateClusterRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
ClusterId = "",
Cluster = new Cluster(),
RequestId = "",
ValidateOnly = false,
};
// Make the request
Operation<Cluster, OperationMetadata> response = alloyDBAdminClient.CreateCluster(request);
// Poll until the returned long-running operation is complete
Operation<Cluster, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Cluster 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<Cluster, OperationMetadata> retrievedResponse = alloyDBAdminClient.PollOnceCreateCluster(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Cluster retrievedResult = retrievedResponse.Result;
}
CreateCluster(string, Cluster, string, CallSettings)
public virtual Operation<Cluster, OperationMetadata> CreateCluster(string parent, Cluster cluster, string clusterId, CallSettings callSettings = null)
Creates a new Cluster in a given project and location.
Name | Description |
parent | string Required. The name of the parent resource. For the required format, see the comment on the Cluster.name field. |
cluster | Cluster Required. The resource being created |
clusterId | string Required. ID of the requesting object. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
OperationClusterOperationMetadata | The RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Cluster cluster = new Cluster();
string clusterId = "";
// Make the request
Operation<Cluster, OperationMetadata> response = alloyDBAdminClient.CreateCluster(parent, cluster, clusterId);
// Poll until the returned long-running operation is complete
Operation<Cluster, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Cluster 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<Cluster, OperationMetadata> retrievedResponse = alloyDBAdminClient.PollOnceCreateCluster(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Cluster retrievedResult = retrievedResponse.Result;
}
CreateClusterAsync(LocationName, Cluster, string, CallSettings)
public virtual Task<Operation<Cluster, OperationMetadata>> CreateClusterAsync(LocationName parent, Cluster cluster, string clusterId, CallSettings callSettings = null)
Creates a new Cluster in a given project and location.
Name | Description |
parent | LocationName Required. The name of the parent resource. For the required format, see the comment on the Cluster.name field. |
cluster | Cluster Required. The resource being created |
clusterId | string Required. ID of the requesting object. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
TaskOperationClusterOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Cluster cluster = new Cluster();
string clusterId = "";
// Make the request
Operation<Cluster, OperationMetadata> response = await alloyDBAdminClient.CreateClusterAsync(parent, cluster, clusterId);
// Poll until the returned long-running operation is complete
Operation<Cluster, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster 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<Cluster, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Cluster retrievedResult = retrievedResponse.Result;
}
CreateClusterAsync(LocationName, Cluster, string, CancellationToken)
public virtual Task<Operation<Cluster, OperationMetadata>> CreateClusterAsync(LocationName parent, Cluster cluster, string clusterId, CancellationToken cancellationToken)
Creates a new Cluster in a given project and location.
Name | Description |
parent | LocationName Required. The name of the parent resource. For the required format, see the comment on the Cluster.name field. |
cluster | Cluster Required. The resource being created |
clusterId | string Required. ID of the requesting object. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
TaskOperationClusterOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Cluster cluster = new Cluster();
string clusterId = "";
// Make the request
Operation<Cluster, OperationMetadata> response = await alloyDBAdminClient.CreateClusterAsync(parent, cluster, clusterId);
// Poll until the returned long-running operation is complete
Operation<Cluster, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster 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<Cluster, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Cluster retrievedResult = retrievedResponse.Result;
}
CreateClusterAsync(CreateClusterRequest, CallSettings)
public virtual Task<Operation<Cluster, OperationMetadata>> CreateClusterAsync(CreateClusterRequest request, CallSettings callSettings = null)
Creates a new Cluster in a given project and location.
Name | Description |
request | CreateClusterRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
TaskOperationClusterOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
CreateClusterRequest request = new CreateClusterRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
ClusterId = "",
Cluster = new Cluster(),
RequestId = "",
ValidateOnly = false,
};
// Make the request
Operation<Cluster, OperationMetadata> response = await alloyDBAdminClient.CreateClusterAsync(request);
// Poll until the returned long-running operation is complete
Operation<Cluster, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster 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<Cluster, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Cluster retrievedResult = retrievedResponse.Result;
}
CreateClusterAsync(CreateClusterRequest, CancellationToken)
public virtual Task<Operation<Cluster, OperationMetadata>> CreateClusterAsync(CreateClusterRequest request, CancellationToken cancellationToken)
Creates a new Cluster in a given project and location.
Name | Description |
request | CreateClusterRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
TaskOperationClusterOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
CreateClusterRequest request = new CreateClusterRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
ClusterId = "",
Cluster = new Cluster(),
RequestId = "",
ValidateOnly = false,
};
// Make the request
Operation<Cluster, OperationMetadata> response = await alloyDBAdminClient.CreateClusterAsync(request);
// Poll until the returned long-running operation is complete
Operation<Cluster, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster 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<Cluster, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Cluster retrievedResult = retrievedResponse.Result;
}
CreateClusterAsync(string, Cluster, string, CallSettings)
public virtual Task<Operation<Cluster, OperationMetadata>> CreateClusterAsync(string parent, Cluster cluster, string clusterId, CallSettings callSettings = null)
Creates a new Cluster in a given project and location.
Name | Description |
parent | string Required. The name of the parent resource. For the required format, see the comment on the Cluster.name field. |
cluster | Cluster Required. The resource being created |
clusterId | string Required. ID of the requesting object. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
TaskOperationClusterOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Cluster cluster = new Cluster();
string clusterId = "";
// Make the request
Operation<Cluster, OperationMetadata> response = await alloyDBAdminClient.CreateClusterAsync(parent, cluster, clusterId);
// Poll until the returned long-running operation is complete
Operation<Cluster, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster 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<Cluster, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Cluster retrievedResult = retrievedResponse.Result;
}
CreateClusterAsync(string, Cluster, string, CancellationToken)
public virtual Task<Operation<Cluster, OperationMetadata>> CreateClusterAsync(string parent, Cluster cluster, string clusterId, CancellationToken cancellationToken)
Creates a new Cluster in a given project and location.
Name | Description |
parent | string Required. The name of the parent resource. For the required format, see the comment on the Cluster.name field. |
cluster | Cluster Required. The resource being created |
clusterId | string Required. ID of the requesting object. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
TaskOperationClusterOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Cluster cluster = new Cluster();
string clusterId = "";
// Make the request
Operation<Cluster, OperationMetadata> response = await alloyDBAdminClient.CreateClusterAsync(parent, cluster, clusterId);
// Poll until the returned long-running operation is complete
Operation<Cluster, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster 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<Cluster, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Cluster retrievedResult = retrievedResponse.Result;
}
CreateInstance(ClusterName, Instance, string, CallSettings)
public virtual Operation<Instance, OperationMetadata> CreateInstance(ClusterName parent, Instance instance, string instanceId, CallSettings callSettings = null)
Creates a new Instance in a given project and location.
Name | Description |
parent | ClusterName Required. The name of the parent resource. For the required format, see the comment on the Instance.name field. |
instance | Instance Required. The resource being created |
instanceId | string Required. ID of the requesting object. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
OperationInstanceOperationMetadata | The RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.Create();
// Initialize request argument(s)
ClusterName parent = ClusterName.FromProjectLocationCluster("[PROJECT]", "[LOCATION]", "[CLUSTER]");
Instance instance = new Instance();
string instanceId = "";
// Make the request
Operation<Instance, OperationMetadata> response = alloyDBAdminClient.CreateInstance(parent, instance, instanceId);
// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
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<Instance, OperationMetadata> retrievedResponse = alloyDBAdminClient.PollOnceCreateInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateInstance(CreateInstanceRequest, CallSettings)
public virtual Operation<Instance, OperationMetadata> CreateInstance(CreateInstanceRequest request, CallSettings callSettings = null)
Creates a new Instance in a given project and location.
Name | Description |
request | CreateInstanceRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
OperationInstanceOperationMetadata | The RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.Create();
// Initialize request argument(s)
CreateInstanceRequest request = new CreateInstanceRequest
{
ParentAsClusterName = ClusterName.FromProjectLocationCluster("[PROJECT]", "[LOCATION]", "[CLUSTER]"),
InstanceId = "",
Instance = new Instance(),
RequestId = "",
ValidateOnly = false,
};
// Make the request
Operation<Instance, OperationMetadata> response = alloyDBAdminClient.CreateInstance(request);
// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
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<Instance, OperationMetadata> retrievedResponse = alloyDBAdminClient.PollOnceCreateInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateInstance(string, Instance, string, CallSettings)
public virtual Operation<Instance, OperationMetadata> CreateInstance(string parent, Instance instance, string instanceId, CallSettings callSettings = null)
Creates a new Instance in a given project and location.
Name | Description |
parent | string Required. The name of the parent resource. For the required format, see the comment on the Instance.name field. |
instance | Instance Required. The resource being created |
instanceId | string Required. ID of the requesting object. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
OperationInstanceOperationMetadata | The RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/clusters/[CLUSTER]";
Instance instance = new Instance();
string instanceId = "";
// Make the request
Operation<Instance, OperationMetadata> response = alloyDBAdminClient.CreateInstance(parent, instance, instanceId);
// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
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<Instance, OperationMetadata> retrievedResponse = alloyDBAdminClient.PollOnceCreateInstance(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(ClusterName, Instance, string, CallSettings)
public virtual Task<Operation<Instance, OperationMetadata>> CreateInstanceAsync(ClusterName parent, Instance instance, string instanceId, CallSettings callSettings = null)
Creates a new Instance in a given project and location.
Name | Description |
parent | ClusterName Required. The name of the parent resource. For the required format, see the comment on the Instance.name field. |
instance | Instance Required. The resource being created |
instanceId | string Required. ID of the requesting object. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
TaskOperationInstanceOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
ClusterName parent = ClusterName.FromProjectLocationCluster("[PROJECT]", "[LOCATION]", "[CLUSTER]");
Instance instance = new Instance();
string instanceId = "";
// Make the request
Operation<Instance, OperationMetadata> response = await alloyDBAdminClient.CreateInstanceAsync(parent, instance, instanceId);
// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
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<Instance, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(ClusterName, Instance, string, CancellationToken)
public virtual Task<Operation<Instance, OperationMetadata>> CreateInstanceAsync(ClusterName parent, Instance instance, string instanceId, CancellationToken cancellationToken)
Creates a new Instance in a given project and location.
Name | Description |
parent | ClusterName Required. The name of the parent resource. For the required format, see the comment on the Instance.name field. |
instance | Instance Required. The resource being created |
instanceId | string Required. ID of the requesting object. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
TaskOperationInstanceOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
ClusterName parent = ClusterName.FromProjectLocationCluster("[PROJECT]", "[LOCATION]", "[CLUSTER]");
Instance instance = new Instance();
string instanceId = "";
// Make the request
Operation<Instance, OperationMetadata> response = await alloyDBAdminClient.CreateInstanceAsync(parent, instance, instanceId);
// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
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<Instance, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(CreateInstanceRequest, CallSettings)
public virtual Task<Operation<Instance, OperationMetadata>> CreateInstanceAsync(CreateInstanceRequest request, CallSettings callSettings = null)
Creates a new Instance in a given project and location.
Name | Description |
request | CreateInstanceRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
TaskOperationInstanceOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
CreateInstanceRequest request = new CreateInstanceRequest
{
ParentAsClusterName = ClusterName.FromProjectLocationCluster("[PROJECT]", "[LOCATION]", "[CLUSTER]"),
InstanceId = "",
Instance = new Instance(),
RequestId = "",
ValidateOnly = false,
};
// Make the request
Operation<Instance, OperationMetadata> response = await alloyDBAdminClient.CreateInstanceAsync(request);
// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
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<Instance, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(CreateInstanceRequest, CancellationToken)
public virtual Task<Operation<Instance, OperationMetadata>> CreateInstanceAsync(CreateInstanceRequest request, CancellationToken cancellationToken)
Creates a new Instance in a given project and location.
Name | Description |
request | CreateInstanceRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
TaskOperationInstanceOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
CreateInstanceRequest request = new CreateInstanceRequest
{
ParentAsClusterName = ClusterName.FromProjectLocationCluster("[PROJECT]", "[LOCATION]", "[CLUSTER]"),
InstanceId = "",
Instance = new Instance(),
RequestId = "",
ValidateOnly = false,
};
// Make the request
Operation<Instance, OperationMetadata> response = await alloyDBAdminClient.CreateInstanceAsync(request);
// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
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<Instance, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(string, Instance, string, CallSettings)
public virtual Task<Operation<Instance, OperationMetadata>> CreateInstanceAsync(string parent, Instance instance, string instanceId, CallSettings callSettings = null)
Creates a new Instance in a given project and location.
Name | Description |
parent | string Required. The name of the parent resource. For the required format, see the comment on the Instance.name field. |
instance | Instance Required. The resource being created |
instanceId | string Required. ID of the requesting object. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
TaskOperationInstanceOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/clusters/[CLUSTER]";
Instance instance = new Instance();
string instanceId = "";
// Make the request
Operation<Instance, OperationMetadata> response = await alloyDBAdminClient.CreateInstanceAsync(parent, instance, instanceId);
// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
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<Instance, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateInstanceAsync(string, Instance, string, CancellationToken)
public virtual Task<Operation<Instance, OperationMetadata>> CreateInstanceAsync(string parent, Instance instance, string instanceId, CancellationToken cancellationToken)
Creates a new Instance in a given project and location.
Name | Description |
parent | string Required. The name of the parent resource. For the required format, see the comment on the Instance.name field. |
instance | Instance Required. The resource being created |
instanceId | string Required. ID of the requesting object. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
TaskOperationInstanceOperationMetadata | A Task containing the RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = await AlloyDBAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/clusters/[CLUSTER]";
Instance instance = new Instance();
string instanceId = "";
// Make the request
Operation<Instance, OperationMetadata> response = await alloyDBAdminClient.CreateInstanceAsync(parent, instance, instanceId);
// Poll until the returned long-running operation is complete
Operation<Instance, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
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<Instance, OperationMetadata> retrievedResponse = await alloyDBAdminClient.PollOnceCreateInstanceAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Instance retrievedResult = retrievedResponse.Result;
}
CreateSecondaryCluster(LocationName, Cluster, string, CallSettings)
public virtual Operation<Cluster, OperationMetadata> CreateSecondaryCluster(LocationName parent, Cluster cluster, string clusterId, CallSettings callSettings = null)
Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.
Name | Description |
parent | LocationName Required. The name of the parent resource (the primary cluster). For the required format, see the comment on the Cluster.name field. |
cluster | Cluster Required. Configuration of the requesting object (the secondary cluster). |
clusterId | string Required. ID of the requesting object (the secondary cluster). |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
OperationClusterOperationMetadata | The RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Cluster cluster = new Cluster();
string clusterId = "";
// Make the request
Operation<Cluster, OperationMetadata> response = alloyDBAdminClient.CreateSecondaryCluster(parent, cluster, clusterId);
// Poll until the returned long-running operation is complete
Operation<Cluster, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Cluster 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<Cluster, OperationMetadata> retrievedResponse = alloyDBAdminClient.PollOnceCreateSecondaryCluster(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Cluster retrievedResult = retrievedResponse.Result;
}
CreateSecondaryCluster(CreateSecondaryClusterRequest, CallSettings)
public virtual Operation<Cluster, OperationMetadata> CreateSecondaryCluster(CreateSecondaryClusterRequest request, CallSettings callSettings = null)
Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.
Name | Description |
request | CreateSecondaryClusterRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
OperationClusterOperationMetadata | The RPC response. |
// Create client
AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.Create();
// Initialize request argument(s)
CreateSecondaryClusterRequest request = new CreateSecondaryClusterRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
ClusterId = "",
Cluster = new Cluster(),
RequestId = "",
ValidateOnly = false,
};
// Make the request
Operation<Cluster, OperationMetadata> response = alloyDBAdminClient.CreateSecondaryCluster(request);
// Poll until the returned long-running operation is complete
Operation<Cluster, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Cluster 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<Cluster, OperationMetadata> retrievedResponse = alloyDBAdminClient.PollOnceCreateSecondaryCluster(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Cluster retrievedResult = retrievedResponse.Result;
}
CreateSecondaryCluster(string, Cluster, string, CallSettings)
public virtual Operation<Cluster, OperationMetadata> CreateSecondaryCluster(string parent, Cluster cluster, string clusterId, CallSettings callSettings = null)
Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.
Name | Description |
parent | string Required. The name of the parent resource (the primary cluster). For the required format, see the comment on the Cluster.name field. |
cluster | Cluster Required. Configuration of the requesting object (the secondary cluster). |
|