public abstract class DatabaseAdminClient
Reference documentation and code samples for the Google Cloud Spanner Database Administration v1 API class DatabaseAdminClient.
DatabaseAdmin client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Spanner.Admin.Database.V1Assembly
Google.Cloud.Spanner.Admin.Database.V1.dll
Remarks
Cloud Spanner Database Admin API
The Cloud Spanner Database Admin API can be used to:
- create, drop, and list databases
- update the schema of pre-existing databases
- create, delete and list backups for a database
- restore a database from an existing backup
Properties
CopyBackupOperationsClient
public virtual OperationsClient CopyBackupOperationsClient { get; }
The long-running operations client for CopyBackup
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
CreateBackupOperationsClient
public virtual OperationsClient CreateBackupOperationsClient { get; }
The long-running operations client for CreateBackup
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
CreateDatabaseOperationsClient
public virtual OperationsClient CreateDatabaseOperationsClient { get; }
The long-running operations client for CreateDatabase
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the DatabaseAdmin service, which is a host of "spanner.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default DatabaseAdmin scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default DatabaseAdmin scopes are:
GrpcClient
public virtual DatabaseAdmin.DatabaseAdminClient GrpcClient { get; }
The underlying gRPC DatabaseAdmin client
Property Value | |
---|---|
Type | Description |
DatabaseAdminDatabaseAdminClient |
RestoreDatabaseOperationsClient
public virtual OperationsClient RestoreDatabaseOperationsClient { get; }
The long-running operations client for RestoreDatabase
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
ServiceMetadata |
UpdateDatabaseDdlOperationsClient
public virtual OperationsClient UpdateDatabaseDdlOperationsClient { get; }
The long-running operations client for UpdateDatabaseDdl
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
Methods
CopyBackup(CopyBackupRequest, CallSettings)
public virtual Operation<Backup, CopyBackupMetadata> CopyBackup(CopyBackupRequest request, CallSettings callSettings = null)
Starts copying a Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track copying of the backup. The operation is associated
with the destination backup.
The [metadata][google.longrunning.Operation.metadata] field type is
[CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
The [response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
copying and delete the backup.
Concurrent CopyBackup requests can run on the same source backup.
Parameters | |
---|---|
Name | Description |
request | CopyBackupRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationBackupCopyBackupMetadata | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
CopyBackupRequest request = new CopyBackupRequest
{
ParentAsInstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
BackupId = "",
SourceBackupAsBackupName = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]"),
ExpireTime = new Timestamp(),
EncryptionConfig = new CopyBackupEncryptionConfig(),
};
// Make the request
Operation<Backup, CopyBackupMetadata> response = databaseAdminClient.CopyBackup(request);
// Poll until the returned long-running operation is complete
Operation<Backup, CopyBackupMetadata> 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, CopyBackupMetadata> retrievedResponse = databaseAdminClient.PollOnceCopyBackup(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;
}
CopyBackup(InstanceName, string, BackupName, Timestamp, CallSettings)
public virtual Operation<Backup, CopyBackupMetadata> CopyBackup(InstanceName parent, string backupId, BackupName sourceBackup, Timestamp expireTime, CallSettings callSettings = null)
Starts copying a Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track copying of the backup. The operation is associated
with the destination backup.
The [metadata][google.longrunning.Operation.metadata] field type is
[CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
The [response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
copying and delete the backup.
Concurrent CopyBackup requests can run on the same source backup.
Parameters | |
---|---|
Name | Description |
parent | Google.Cloud.Spanner.Common.V1.InstanceName Required. The name of the destination instance that will contain the backup copy.
Values are of the form: |
backupId | string Required. The id of the backup copy.
The |
sourceBackup | BackupName Required. The source backup to be copied.
The source backup needs to be in READY state for it to be copied.
Once CopyBackup is in progress, the source backup cannot be deleted or
cleaned up on expiration until CopyBackup is finished.
Values are of the form:
|
expireTime | Timestamp Required. The expiration time of the backup in microsecond granularity.
The expiration time must be at least 6 hours and at most 366 days
from the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationBackupCopyBackupMetadata | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
InstanceName parent = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
string backupId = "";
BackupName sourceBackup = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]");
Timestamp expireTime = new Timestamp();
// Make the request
Operation<Backup, CopyBackupMetadata> response = databaseAdminClient.CopyBackup(parent, backupId, sourceBackup, expireTime);
// Poll until the returned long-running operation is complete
Operation<Backup, CopyBackupMetadata> 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, CopyBackupMetadata> retrievedResponse = databaseAdminClient.PollOnceCopyBackup(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;
}
CopyBackup(string, string, string, Timestamp, CallSettings)
public virtual Operation<Backup, CopyBackupMetadata> CopyBackup(string parent, string backupId, string sourceBackup, Timestamp expireTime, CallSettings callSettings = null)
Starts copying a Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track copying of the backup. The operation is associated
with the destination backup.
The [metadata][google.longrunning.Operation.metadata] field type is
[CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
The [response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
copying and delete the backup.
Concurrent CopyBackup requests can run on the same source backup.
Parameters | |
---|---|
Name | Description |
parent | string Required. The name of the destination instance that will contain the backup copy.
Values are of the form: |
backupId | string Required. The id of the backup copy.
The |
sourceBackup | string Required. The source backup to be copied.
The source backup needs to be in READY state for it to be copied.
Once CopyBackup is in progress, the source backup cannot be deleted or
cleaned up on expiration until CopyBackup is finished.
Values are of the form:
|
expireTime | Timestamp Required. The expiration time of the backup in microsecond granularity.
The expiration time must be at least 6 hours and at most 366 days
from the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationBackupCopyBackupMetadata | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/instances/[INSTANCE]";
string backupId = "";
string sourceBackup = "projects/[PROJECT]/instances/[INSTANCE]/backups/[BACKUP]";
Timestamp expireTime = new Timestamp();
// Make the request
Operation<Backup, CopyBackupMetadata> response = databaseAdminClient.CopyBackup(parent, backupId, sourceBackup, expireTime);
// Poll until the returned long-running operation is complete
Operation<Backup, CopyBackupMetadata> 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, CopyBackupMetadata> retrievedResponse = databaseAdminClient.PollOnceCopyBackup(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;
}
CopyBackupAsync(CopyBackupRequest, CallSettings)
public virtual Task<Operation<Backup, CopyBackupMetadata>> CopyBackupAsync(CopyBackupRequest request, CallSettings callSettings = null)
Starts copying a Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track copying of the backup. The operation is associated
with the destination backup.
The [metadata][google.longrunning.Operation.metadata] field type is
[CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
The [response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
copying and delete the backup.
Concurrent CopyBackup requests can run on the same source backup.
Parameters | |
---|---|
Name | Description |
request | CopyBackupRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationBackupCopyBackupMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
CopyBackupRequest request = new CopyBackupRequest
{
ParentAsInstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
BackupId = "",
SourceBackupAsBackupName = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]"),
ExpireTime = new Timestamp(),
EncryptionConfig = new CopyBackupEncryptionConfig(),
};
// Make the request
Operation<Backup, CopyBackupMetadata> response = await databaseAdminClient.CopyBackupAsync(request);
// Poll until the returned long-running operation is complete
Operation<Backup, CopyBackupMetadata> 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, CopyBackupMetadata> retrievedResponse = await databaseAdminClient.PollOnceCopyBackupAsync(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;
}
CopyBackupAsync(CopyBackupRequest, CancellationToken)
public virtual Task<Operation<Backup, CopyBackupMetadata>> CopyBackupAsync(CopyBackupRequest request, CancellationToken cancellationToken)
Starts copying a Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track copying of the backup. The operation is associated
with the destination backup.
The [metadata][google.longrunning.Operation.metadata] field type is
[CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
The [response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
copying and delete the backup.
Concurrent CopyBackup requests can run on the same source backup.
Parameters | |
---|---|
Name | Description |
request | CopyBackupRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationBackupCopyBackupMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
CopyBackupRequest request = new CopyBackupRequest
{
ParentAsInstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
BackupId = "",
SourceBackupAsBackupName = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]"),
ExpireTime = new Timestamp(),
EncryptionConfig = new CopyBackupEncryptionConfig(),
};
// Make the request
Operation<Backup, CopyBackupMetadata> response = await databaseAdminClient.CopyBackupAsync(request);
// Poll until the returned long-running operation is complete
Operation<Backup, CopyBackupMetadata> 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, CopyBackupMetadata> retrievedResponse = await databaseAdminClient.PollOnceCopyBackupAsync(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;
}
CopyBackupAsync(InstanceName, string, BackupName, Timestamp, CallSettings)
public virtual Task<Operation<Backup, CopyBackupMetadata>> CopyBackupAsync(InstanceName parent, string backupId, BackupName sourceBackup, Timestamp expireTime, CallSettings callSettings = null)
Starts copying a Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track copying of the backup. The operation is associated
with the destination backup.
The [metadata][google.longrunning.Operation.metadata] field type is
[CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
The [response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
copying and delete the backup.
Concurrent CopyBackup requests can run on the same source backup.
Parameters | |
---|---|
Name | Description |
parent | Google.Cloud.Spanner.Common.V1.InstanceName Required. The name of the destination instance that will contain the backup copy.
Values are of the form: |
backupId | string Required. The id of the backup copy.
The |
sourceBackup | BackupName Required. The source backup to be copied.
The source backup needs to be in READY state for it to be copied.
Once CopyBackup is in progress, the source backup cannot be deleted or
cleaned up on expiration until CopyBackup is finished.
Values are of the form:
|
expireTime | Timestamp Required. The expiration time of the backup in microsecond granularity.
The expiration time must be at least 6 hours and at most 366 days
from the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationBackupCopyBackupMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
InstanceName parent = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
string backupId = "";
BackupName sourceBackup = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]");
Timestamp expireTime = new Timestamp();
// Make the request
Operation<Backup, CopyBackupMetadata> response = await databaseAdminClient.CopyBackupAsync(parent, backupId, sourceBackup, expireTime);
// Poll until the returned long-running operation is complete
Operation<Backup, CopyBackupMetadata> 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, CopyBackupMetadata> retrievedResponse = await databaseAdminClient.PollOnceCopyBackupAsync(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;
}
CopyBackupAsync(InstanceName, string, BackupName, Timestamp, CancellationToken)
public virtual Task<Operation<Backup, CopyBackupMetadata>> CopyBackupAsync(InstanceName parent, string backupId, BackupName sourceBackup, Timestamp expireTime, CancellationToken cancellationToken)
Starts copying a Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track copying of the backup. The operation is associated
with the destination backup.
The [metadata][google.longrunning.Operation.metadata] field type is
[CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
The [response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
copying and delete the backup.
Concurrent CopyBackup requests can run on the same source backup.
Parameters | |
---|---|
Name | Description |
parent | Google.Cloud.Spanner.Common.V1.InstanceName Required. The name of the destination instance that will contain the backup copy.
Values are of the form: |
backupId | string Required. The id of the backup copy.
The |
sourceBackup | BackupName Required. The source backup to be copied.
The source backup needs to be in READY state for it to be copied.
Once CopyBackup is in progress, the source backup cannot be deleted or
cleaned up on expiration until CopyBackup is finished.
Values are of the form:
|
expireTime | Timestamp Required. The expiration time of the backup in microsecond granularity.
The expiration time must be at least 6 hours and at most 366 days
from the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationBackupCopyBackupMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
InstanceName parent = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
string backupId = "";
BackupName sourceBackup = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]");
Timestamp expireTime = new Timestamp();
// Make the request
Operation<Backup, CopyBackupMetadata> response = await databaseAdminClient.CopyBackupAsync(parent, backupId, sourceBackup, expireTime);
// Poll until the returned long-running operation is complete
Operation<Backup, CopyBackupMetadata> 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, CopyBackupMetadata> retrievedResponse = await databaseAdminClient.PollOnceCopyBackupAsync(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;
}
CopyBackupAsync(string, string, string, Timestamp, CallSettings)
public virtual Task<Operation<Backup, CopyBackupMetadata>> CopyBackupAsync(string parent, string backupId, string sourceBackup, Timestamp expireTime, CallSettings callSettings = null)
Starts copying a Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track copying of the backup. The operation is associated
with the destination backup.
The [metadata][google.longrunning.Operation.metadata] field type is
[CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
The [response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
copying and delete the backup.
Concurrent CopyBackup requests can run on the same source backup.
Parameters | |
---|---|
Name | Description |
parent | string Required. The name of the destination instance that will contain the backup copy.
Values are of the form: |
backupId | string Required. The id of the backup copy.
The |
sourceBackup | string Required. The source backup to be copied.
The source backup needs to be in READY state for it to be copied.
Once CopyBackup is in progress, the source backup cannot be deleted or
cleaned up on expiration until CopyBackup is finished.
Values are of the form:
|
expireTime | Timestamp Required. The expiration time of the backup in microsecond granularity.
The expiration time must be at least 6 hours and at most 366 days
from the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationBackupCopyBackupMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/instances/[INSTANCE]";
string backupId = "";
string sourceBackup = "projects/[PROJECT]/instances/[INSTANCE]/backups/[BACKUP]";
Timestamp expireTime = new Timestamp();
// Make the request
Operation<Backup, CopyBackupMetadata> response = await databaseAdminClient.CopyBackupAsync(parent, backupId, sourceBackup, expireTime);
// Poll until the returned long-running operation is complete
Operation<Backup, CopyBackupMetadata> 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, CopyBackupMetadata> retrievedResponse = await databaseAdminClient.PollOnceCopyBackupAsync(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;
}
CopyBackupAsync(string, string, string, Timestamp, CancellationToken)
public virtual Task<Operation<Backup, CopyBackupMetadata>> CopyBackupAsync(string parent, string backupId, string sourceBackup, Timestamp expireTime, CancellationToken cancellationToken)
Starts copying a Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track copying of the backup. The operation is associated
with the destination backup.
The [metadata][google.longrunning.Operation.metadata] field type is
[CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
The [response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
copying and delete the backup.
Concurrent CopyBackup requests can run on the same source backup.
Parameters | |
---|---|
Name | Description |
parent | string Required. The name of the destination instance that will contain the backup copy.
Values are of the form: |
backupId | string Required. The id of the backup copy.
The |
sourceBackup | string Required. The source backup to be copied.
The source backup needs to be in READY state for it to be copied.
Once CopyBackup is in progress, the source backup cannot be deleted or
cleaned up on expiration until CopyBackup is finished.
Values are of the form:
|
expireTime | Timestamp Required. The expiration time of the backup in microsecond granularity.
The expiration time must be at least 6 hours and at most 366 days
from the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationBackupCopyBackupMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/instances/[INSTANCE]";
string backupId = "";
string sourceBackup = "projects/[PROJECT]/instances/[INSTANCE]/backups/[BACKUP]";
Timestamp expireTime = new Timestamp();
// Make the request
Operation<Backup, CopyBackupMetadata> response = await databaseAdminClient.CopyBackupAsync(parent, backupId, sourceBackup, expireTime);
// Poll until the returned long-running operation is complete
Operation<Backup, CopyBackupMetadata> 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, CopyBackupMetadata> retrievedResponse = await databaseAdminClient.PollOnceCopyBackupAsync(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;
}
Create()
public static DatabaseAdminClient Create()
Synchronously creates a DatabaseAdminClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use DatabaseAdminClientBuilder.
Returns | |
---|---|
Type | Description |
DatabaseAdminClient | The created DatabaseAdminClient. |
CreateAsync(CancellationToken)
public static Task<DatabaseAdminClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a DatabaseAdminClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use DatabaseAdminClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
TaskDatabaseAdminClient | The task representing the created DatabaseAdminClient. |
CreateBackup(CreateBackupRequest, CallSettings)
public virtual Operation<Backup, CreateBackupMetadata> CreateBackup(CreateBackupRequest request, CallSettings callSettings = null)
Starts creating a new Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track creation of the backup. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
creation and delete the backup.
There can be only one pending backup creation per database. Backup creation
of different databases can run concurrently.
Parameters | |
---|---|
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. |
Returns | |
---|---|
Type | Description |
OperationBackupCreateBackupMetadata | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
CreateBackupRequest request = new CreateBackupRequest
{
ParentAsInstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
BackupId = "",
Backup = new Backup(),
EncryptionConfig = new CreateBackupEncryptionConfig(),
};
// Make the request
Operation<Backup, CreateBackupMetadata> response = databaseAdminClient.CreateBackup(request);
// Poll until the returned long-running operation is complete
Operation<Backup, CreateBackupMetadata> 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, CreateBackupMetadata> retrievedResponse = databaseAdminClient.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(InstanceName, Backup, string, CallSettings)
public virtual Operation<Backup, CreateBackupMetadata> CreateBackup(InstanceName parent, Backup backup, string backupId, CallSettings callSettings = null)
Starts creating a new Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track creation of the backup. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
creation and delete the backup.
There can be only one pending backup creation per database. Backup creation
of different databases can run concurrently.
Parameters | |
---|---|
Name | Description |
parent | Google.Cloud.Spanner.Common.V1.InstanceName Required. The name of the instance in which the backup will be
created. This must be the same instance that contains the database the
backup will be created from. The backup will be stored in the
location(s) specified in the instance configuration of this
instance. Values are of the form
|
backup | Backup Required. The backup to create. |
backupId | string Required. The id of the backup to be created. The |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationBackupCreateBackupMetadata | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
InstanceName parent = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
Backup backup = new Backup();
string backupId = "";
// Make the request
Operation<Backup, CreateBackupMetadata> response = databaseAdminClient.CreateBackup(parent, backup, backupId);
// Poll until the returned long-running operation is complete
Operation<Backup, CreateBackupMetadata> 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, CreateBackupMetadata> retrievedResponse = databaseAdminClient.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, CreateBackupMetadata> CreateBackup(string parent, Backup backup, string backupId, CallSettings callSettings = null)
Starts creating a new Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track creation of the backup. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
creation and delete the backup.
There can be only one pending backup creation per database. Backup creation
of different databases can run concurrently.
Parameters | |
---|---|
Name | Description |
parent | string Required. The name of the instance in which the backup will be
created. This must be the same instance that contains the database the
backup will be created from. The backup will be stored in the
location(s) specified in the instance configuration of this
instance. Values are of the form
|
backup | Backup Required. The backup to create. |
backupId | string Required. The id of the backup to be created. The |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationBackupCreateBackupMetadata | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/instances/[INSTANCE]";
Backup backup = new Backup();
string backupId = "";
// Make the request
Operation<Backup, CreateBackupMetadata> response = databaseAdminClient.CreateBackup(parent, backup, backupId);
// Poll until the returned long-running operation is complete
Operation<Backup, CreateBackupMetadata> 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, CreateBackupMetadata> retrievedResponse = databaseAdminClient.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(CreateBackupRequest, CallSettings)
public virtual Task<Operation<Backup, CreateBackupMetadata>> CreateBackupAsync(CreateBackupRequest request, CallSettings callSettings = null)
Starts creating a new Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track creation of the backup. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
creation and delete the backup.
There can be only one pending backup creation per database. Backup creation
of different databases can run concurrently.
Parameters | |
---|---|
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. |
Returns | |
---|---|
Type | Description |
TaskOperationBackupCreateBackupMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
CreateBackupRequest request = new CreateBackupRequest
{
ParentAsInstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
BackupId = "",
Backup = new Backup(),
EncryptionConfig = new CreateBackupEncryptionConfig(),
};
// Make the request
Operation<Backup, CreateBackupMetadata> response = await databaseAdminClient.CreateBackupAsync(request);
// Poll until the returned long-running operation is complete
Operation<Backup, CreateBackupMetadata> 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, CreateBackupMetadata> retrievedResponse = await databaseAdminClient.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, CreateBackupMetadata>> CreateBackupAsync(CreateBackupRequest request, CancellationToken cancellationToken)
Starts creating a new Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track creation of the backup. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
creation and delete the backup.
There can be only one pending backup creation per database. Backup creation
of different databases can run concurrently.
Parameters | |
---|---|
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. |
Returns | |
---|---|
Type | Description |
TaskOperationBackupCreateBackupMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
CreateBackupRequest request = new CreateBackupRequest
{
ParentAsInstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
BackupId = "",
Backup = new Backup(),
EncryptionConfig = new CreateBackupEncryptionConfig(),
};
// Make the request
Operation<Backup, CreateBackupMetadata> response = await databaseAdminClient.CreateBackupAsync(request);
// Poll until the returned long-running operation is complete
Operation<Backup, CreateBackupMetadata> 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, CreateBackupMetadata> retrievedResponse = await databaseAdminClient.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(InstanceName, Backup, string, CallSettings)
public virtual Task<Operation<Backup, CreateBackupMetadata>> CreateBackupAsync(InstanceName parent, Backup backup, string backupId, CallSettings callSettings = null)
Starts creating a new Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track creation of the backup. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
creation and delete the backup.
There can be only one pending backup creation per database. Backup creation
of different databases can run concurrently.
Parameters | |
---|---|
Name | Description |
parent | Google.Cloud.Spanner.Common.V1.InstanceName Required. The name of the instance in which the backup will be
created. This must be the same instance that contains the database the
backup will be created from. The backup will be stored in the
location(s) specified in the instance configuration of this
instance. Values are of the form
|
backup | Backup Required. The backup to create. |
backupId | string Required. The id of the backup to be created. The |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationBackupCreateBackupMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
InstanceName parent = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
Backup backup = new Backup();
string backupId = "";
// Make the request
Operation<Backup, CreateBackupMetadata> response = await databaseAdminClient.CreateBackupAsync(parent, backup, backupId);
// Poll until the returned long-running operation is complete
Operation<Backup, CreateBackupMetadata> 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, CreateBackupMetadata> retrievedResponse = await databaseAdminClient.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(InstanceName, Backup, string, CancellationToken)
public virtual Task<Operation<Backup, CreateBackupMetadata>> CreateBackupAsync(InstanceName parent, Backup backup, string backupId, CancellationToken cancellationToken)
Starts creating a new Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track creation of the backup. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
creation and delete the backup.
There can be only one pending backup creation per database. Backup creation
of different databases can run concurrently.
Parameters | |
---|---|
Name | Description |
parent | Google.Cloud.Spanner.Common.V1.InstanceName Required. The name of the instance in which the backup will be
created. This must be the same instance that contains the database the
backup will be created from. The backup will be stored in the
location(s) specified in the instance configuration of this
instance. Values are of the form
|
backup | Backup Required. The backup to create. |
backupId | string Required. The id of the backup to be created. The |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationBackupCreateBackupMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
InstanceName parent = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
Backup backup = new Backup();
string backupId = "";
// Make the request
Operation<Backup, CreateBackupMetadata> response = await databaseAdminClient.CreateBackupAsync(parent, backup, backupId);
// Poll until the returned long-running operation is complete
Operation<Backup, CreateBackupMetadata> 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, CreateBackupMetadata> retrievedResponse = await databaseAdminClient.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, CreateBackupMetadata>> CreateBackupAsync(string parent, Backup backup, string backupId, CallSettings callSettings = null)
Starts creating a new Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track creation of the backup. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
creation and delete the backup.
There can be only one pending backup creation per database. Backup creation
of different databases can run concurrently.
Parameters | |
---|---|
Name | Description |
parent | string Required. The name of the instance in which the backup will be
created. This must be the same instance that contains the database the
backup will be created from. The backup will be stored in the
location(s) specified in the instance configuration of this
instance. Values are of the form
|
backup | Backup Required. The backup to create. |
backupId | string Required. The id of the backup to be created. The |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationBackupCreateBackupMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/instances/[INSTANCE]";
Backup backup = new Backup();
string backupId = "";
// Make the request
Operation<Backup, CreateBackupMetadata> response = await databaseAdminClient.CreateBackupAsync(parent, backup, backupId);
// Poll until the returned long-running operation is complete
Operation<Backup, CreateBackupMetadata> 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, CreateBackupMetadata> retrievedResponse = await databaseAdminClient.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, CreateBackupMetadata>> CreateBackupAsync(string parent, Backup backup, string backupId, CancellationToken cancellationToken)
Starts creating a new Cloud Spanner Backup.
The returned backup [long-running operation][google.longrunning.Operation]
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track creation of the backup. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
creation and delete the backup.
There can be only one pending backup creation per database. Backup creation
of different databases can run concurrently.
Parameters | |
---|---|
Name | Description |
parent | string Required. The name of the instance in which the backup will be
created. This must be the same instance that contains the database the
backup will be created from. The backup will be stored in the
location(s) specified in the instance configuration of this
instance. Values are of the form
|
backup | Backup Required. The backup to create. |
backupId | string Required. The id of the backup to be created. The |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationBackupCreateBackupMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/instances/[INSTANCE]";
Backup backup = new Backup();
string backupId = "";
// Make the request
Operation<Backup, CreateBackupMetadata> response = await databaseAdminClient.CreateBackupAsync(parent, backup, backupId);
// Poll until the returned long-running operation is complete
Operation<Backup, CreateBackupMetadata> 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, CreateBackupMetadata> retrievedResponse = await databaseAdminClient.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;
}
CreateDatabase(CreateDatabaseRequest, CallSettings)
public virtual Operation<Database, CreateDatabaseMetadata> CreateDatabase(CreateDatabaseRequest request, CallSettings callSettings = null)
Creates a new Cloud Spanner database and starts to prepare it for serving.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format <database_name>/operations/<operation_id>
and
can be used to track preparation of the database. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Database][google.spanner.admin.database.v1.Database], if successful.
Parameters | |
---|---|
Name | Description |
request | CreateDatabaseRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationDatabaseCreateDatabaseMetadata | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
CreateDatabaseRequest request = new CreateDatabaseRequest
{
ParentAsInstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
CreateStatement = "",
ExtraStatements = { "", },
EncryptionConfig = new EncryptionConfig(),
DatabaseDialect = DatabaseDialect.Unspecified,
};
// Make the request
Operation<Database, CreateDatabaseMetadata> response = databaseAdminClient.CreateDatabase(request);
// Poll until the returned long-running operation is complete
Operation<Database, CreateDatabaseMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Database 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<Database, CreateDatabaseMetadata> retrievedResponse = databaseAdminClient.PollOnceCreateDatabase(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Database retrievedResult = retrievedResponse.Result;
}
CreateDatabase(InstanceName, string, CallSettings)
public virtual Operation<Database, CreateDatabaseMetadata> CreateDatabase(InstanceName parent, string createStatement, CallSettings callSettings = null)
Creates a new Cloud Spanner database and starts to prepare it for serving.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format <database_name>/operations/<operation_id>
and
can be used to track preparation of the database. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Database][google.spanner.admin.database.v1.Database], if successful.
Parameters | |
---|---|
Name | Description |
parent | Google.Cloud.Spanner.Common.V1.InstanceName Required. The name of the instance that will serve the new database.
Values are of the form |
createStatement | string Required. A |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationDatabaseCreateDatabaseMetadata | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
InstanceName parent = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
string createStatement = "";
// Make the request
Operation<Database, CreateDatabaseMetadata> response = databaseAdminClient.CreateDatabase(parent, createStatement);
// Poll until the returned long-running operation is complete
Operation<Database, CreateDatabaseMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Database 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<Database, CreateDatabaseMetadata> retrievedResponse = databaseAdminClient.PollOnceCreateDatabase(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Database retrievedResult = retrievedResponse.Result;
}
CreateDatabase(string, string, CallSettings)
public virtual Operation<Database, CreateDatabaseMetadata> CreateDatabase(string parent, string createStatement, CallSettings callSettings = null)
Creates a new Cloud Spanner database and starts to prepare it for serving.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format <database_name>/operations/<operation_id>
and
can be used to track preparation of the database. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Database][google.spanner.admin.database.v1.Database], if successful.
Parameters | |
---|---|
Name | Description |
parent | string Required. The name of the instance that will serve the new database.
Values are of the form |
createStatement | string Required. A |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationDatabaseCreateDatabaseMetadata | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/instances/[INSTANCE]";
string createStatement = "";
// Make the request
Operation<Database, CreateDatabaseMetadata> response = databaseAdminClient.CreateDatabase(parent, createStatement);
// Poll until the returned long-running operation is complete
Operation<Database, CreateDatabaseMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Database 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<Database, CreateDatabaseMetadata> retrievedResponse = databaseAdminClient.PollOnceCreateDatabase(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Database retrievedResult = retrievedResponse.Result;
}
CreateDatabaseAsync(CreateDatabaseRequest, CallSettings)
public virtual Task<Operation<Database, CreateDatabaseMetadata>> CreateDatabaseAsync(CreateDatabaseRequest request, CallSettings callSettings = null)
Creates a new Cloud Spanner database and starts to prepare it for serving.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format <database_name>/operations/<operation_id>
and
can be used to track preparation of the database. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Database][google.spanner.admin.database.v1.Database], if successful.
Parameters | |
---|---|
Name | Description |
request | CreateDatabaseRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationDatabaseCreateDatabaseMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
CreateDatabaseRequest request = new CreateDatabaseRequest
{
ParentAsInstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
CreateStatement = "",
ExtraStatements = { "", },
EncryptionConfig = new EncryptionConfig(),
DatabaseDialect = DatabaseDialect.Unspecified,
};
// Make the request
Operation<Database, CreateDatabaseMetadata> response = await databaseAdminClient.CreateDatabaseAsync(request);
// Poll until the returned long-running operation is complete
Operation<Database, CreateDatabaseMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Database 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<Database, CreateDatabaseMetadata> retrievedResponse = await databaseAdminClient.PollOnceCreateDatabaseAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Database retrievedResult = retrievedResponse.Result;
}
CreateDatabaseAsync(CreateDatabaseRequest, CancellationToken)
public virtual Task<Operation<Database, CreateDatabaseMetadata>> CreateDatabaseAsync(CreateDatabaseRequest request, CancellationToken cancellationToken)
Creates a new Cloud Spanner database and starts to prepare it for serving.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format <database_name>/operations/<operation_id>
and
can be used to track preparation of the database. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Database][google.spanner.admin.database.v1.Database], if successful.
Parameters | |
---|---|
Name | Description |
request | CreateDatabaseRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationDatabaseCreateDatabaseMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
CreateDatabaseRequest request = new CreateDatabaseRequest
{
ParentAsInstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
CreateStatement = "",
ExtraStatements = { "", },
EncryptionConfig = new EncryptionConfig(),
DatabaseDialect = DatabaseDialect.Unspecified,
};
// Make the request
Operation<Database, CreateDatabaseMetadata> response = await databaseAdminClient.CreateDatabaseAsync(request);
// Poll until the returned long-running operation is complete
Operation<Database, CreateDatabaseMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Database 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<Database, CreateDatabaseMetadata> retrievedResponse = await databaseAdminClient.PollOnceCreateDatabaseAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Database retrievedResult = retrievedResponse.Result;
}
CreateDatabaseAsync(InstanceName, string, CallSettings)
public virtual Task<Operation<Database, CreateDatabaseMetadata>> CreateDatabaseAsync(InstanceName parent, string createStatement, CallSettings callSettings = null)
Creates a new Cloud Spanner database and starts to prepare it for serving.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format <database_name>/operations/<operation_id>
and
can be used to track preparation of the database. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Database][google.spanner.admin.database.v1.Database], if successful.
Parameters | |
---|---|
Name | Description |
parent | Google.Cloud.Spanner.Common.V1.InstanceName Required. The name of the instance that will serve the new database.
Values are of the form |
createStatement | string Required. A |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationDatabaseCreateDatabaseMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
InstanceName parent = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
string createStatement = "";
// Make the request
Operation<Database, CreateDatabaseMetadata> response = await databaseAdminClient.CreateDatabaseAsync(parent, createStatement);
// Poll until the returned long-running operation is complete
Operation<Database, CreateDatabaseMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Database 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<Database, CreateDatabaseMetadata> retrievedResponse = await databaseAdminClient.PollOnceCreateDatabaseAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Database retrievedResult = retrievedResponse.Result;
}
CreateDatabaseAsync(InstanceName, string, CancellationToken)
public virtual Task<Operation<Database, CreateDatabaseMetadata>> CreateDatabaseAsync(InstanceName parent, string createStatement, CancellationToken cancellationToken)
Creates a new Cloud Spanner database and starts to prepare it for serving.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format <database_name>/operations/<operation_id>
and
can be used to track preparation of the database. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Database][google.spanner.admin.database.v1.Database], if successful.
Parameters | |
---|---|
Name | Description |
parent | Google.Cloud.Spanner.Common.V1.InstanceName Required. The name of the instance that will serve the new database.
Values are of the form |
createStatement | string Required. A |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationDatabaseCreateDatabaseMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
InstanceName parent = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
string createStatement = "";
// Make the request
Operation<Database, CreateDatabaseMetadata> response = await databaseAdminClient.CreateDatabaseAsync(parent, createStatement);
// Poll until the returned long-running operation is complete
Operation<Database, CreateDatabaseMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Database 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<Database, CreateDatabaseMetadata> retrievedResponse = await databaseAdminClient.PollOnceCreateDatabaseAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Database retrievedResult = retrievedResponse.Result;
}
CreateDatabaseAsync(string, string, CallSettings)
public virtual Task<Operation<Database, CreateDatabaseMetadata>> CreateDatabaseAsync(string parent, string createStatement, CallSettings callSettings = null)
Creates a new Cloud Spanner database and starts to prepare it for serving.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format <database_name>/operations/<operation_id>
and
can be used to track preparation of the database. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Database][google.spanner.admin.database.v1.Database], if successful.
Parameters | |
---|---|
Name | Description |
parent | string Required. The name of the instance that will serve the new database.
Values are of the form |
createStatement | string Required. A |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationDatabaseCreateDatabaseMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/instances/[INSTANCE]";
string createStatement = "";
// Make the request
Operation<Database, CreateDatabaseMetadata> response = await databaseAdminClient.CreateDatabaseAsync(parent, createStatement);
// Poll until the returned long-running operation is complete
Operation<Database, CreateDatabaseMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Database 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<Database, CreateDatabaseMetadata> retrievedResponse = await databaseAdminClient.PollOnceCreateDatabaseAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Database retrievedResult = retrievedResponse.Result;
}
CreateDatabaseAsync(string, string, CancellationToken)
public virtual Task<Operation<Database, CreateDatabaseMetadata>> CreateDatabaseAsync(string parent, string createStatement, CancellationToken cancellationToken)
Creates a new Cloud Spanner database and starts to prepare it for serving.
The returned [long-running operation][google.longrunning.Operation] will
have a name of the format <database_name>/operations/<operation_id>
and
can be used to track preparation of the database. The
[metadata][google.longrunning.Operation.metadata] field type is
[CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Database][google.spanner.admin.database.v1.Database], if successful.
Parameters | |
---|---|
Name | Description |
parent | string Required. The name of the instance that will serve the new database.
Values are of the form |
createStatement | string Required. A |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationDatabaseCreateDatabaseMetadata | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/instances/[INSTANCE]";
string createStatement = "";
// Make the request
Operation<Database, CreateDatabaseMetadata> response = await databaseAdminClient.CreateDatabaseAsync(parent, createStatement);
// Poll until the returned long-running operation is complete
Operation<Database, CreateDatabaseMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Database 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<Database, CreateDatabaseMetadata> retrievedResponse = await databaseAdminClient.PollOnceCreateDatabaseAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Database retrievedResult = retrievedResponse.Result;
}
DeleteBackup(BackupName, CallSettings)
public virtual void DeleteBackup(BackupName name, CallSettings callSettings = null)
Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Parameters | |
---|---|
Name | Description |
name | BackupName Required. Name of the backup to delete.
Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
BackupName name = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]");
// Make the request
databaseAdminClient.DeleteBackup(name);
DeleteBackup(DeleteBackupRequest, CallSettings)
public virtual void DeleteBackup(DeleteBackupRequest request, CallSettings callSettings = null)
Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Parameters | |
---|---|
Name | Description |
request | DeleteBackupRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
DeleteBackupRequest request = new DeleteBackupRequest
{
BackupName = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]"),
};
// Make the request
databaseAdminClient.DeleteBackup(request);
DeleteBackup(string, CallSettings)
public virtual void DeleteBackup(string name, CallSettings callSettings = null)
Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Parameters | |
---|---|
Name | Description |
name | string Required. Name of the backup to delete.
Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instances/[INSTANCE]/backups/[BACKUP]";
// Make the request
databaseAdminClient.DeleteBackup(name);
DeleteBackupAsync(BackupName, CallSettings)
public virtual Task DeleteBackupAsync(BackupName name, CallSettings callSettings = null)
Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Parameters | |
---|---|
Name | Description |
name | BackupName Required. Name of the backup to delete.
Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
BackupName name = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]");
// Make the request
await databaseAdminClient.DeleteBackupAsync(name);
DeleteBackupAsync(BackupName, CancellationToken)
public virtual Task DeleteBackupAsync(BackupName name, CancellationToken cancellationToken)
Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Parameters | |
---|---|
Name | Description |
name | BackupName Required. Name of the backup to delete.
Values are of the form
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
BackupName name = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]");
// Make the request
await databaseAdminClient.DeleteBackupAsync(name);
DeleteBackupAsync(DeleteBackupRequest, CallSettings)
public virtual Task DeleteBackupAsync(DeleteBackupRequest request, CallSettings callSettings = null)
Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Parameters | |
---|---|
Name | Description |
request | DeleteBackupRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
DeleteBackupRequest request = new DeleteBackupRequest
{
BackupName = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]"),
};
// Make the request
await databaseAdminClient.DeleteBackupAsync(request);
DeleteBackupAsync(DeleteBackupRequest, CancellationToken)
public virtual Task DeleteBackupAsync(DeleteBackupRequest request, CancellationToken cancellationToken)
Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Parameters | |
---|---|
Name | Description |
request | DeleteBackupRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
DeleteBackupRequest request = new DeleteBackupRequest
{
BackupName = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]"),
};
// Make the request
await databaseAdminClient.DeleteBackupAsync(request);
DeleteBackupAsync(string, CallSettings)
public virtual Task DeleteBackupAsync(string name, CallSettings callSettings = null)
Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Parameters | |
---|---|
Name | Description |
name | string Required. Name of the backup to delete.
Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
|