public abstract 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
.
Type | Description |
OperationsClient |
CreateBackupOperationsClient
public virtual OperationsClient CreateBackupOperationsClient { get; }
The long-running operations client for CreateBackup
.
Type | Description |
OperationsClient |
CreateDatabaseOperationsClient
public virtual OperationsClient CreateDatabaseOperationsClient { get; }
The long-running operations client for CreateDatabase
.
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.
Type | Description |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default DatabaseAdmin scopes.
Type | Description |
IReadOnlyList<String> |
The default DatabaseAdmin scopes are:
GrpcClient
public virtual DatabaseAdmin.DatabaseAdminClient GrpcClient { get; }
The underlying gRPC DatabaseAdmin client
Type | Description |
DatabaseAdmin.DatabaseAdminClient |
RestoreDatabaseOperationsClient
public virtual OperationsClient RestoreDatabaseOperationsClient { get; }
The long-running operations client for RestoreDatabase
.
Type | Description |
OperationsClient |
UpdateDatabaseDdlOperationsClient
public virtual OperationsClient UpdateDatabaseDdlOperationsClient { get; }
The long-running operations client for UpdateDatabaseDdl
.
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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Operation<Backup, CopyBackupMetadata> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Operation<Backup, CopyBackupMetadata> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Operation<Backup, CopyBackupMetadata> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Task<Operation<Backup, CopyBackupMetadata>> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Task<Operation<Backup, CopyBackupMetadata>> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Task<Operation<Backup, CopyBackupMetadata>> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Task<Operation<Backup, CopyBackupMetadata>> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Task<Operation<Backup, CopyBackupMetadata>> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Task<Operation<Backup, CopyBackupMetadata>> | 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.
Type | Description |
DatabaseAdminClient | The created DatabaseAdminClient. |
CreateAsync(CancellationToken)
public static Task<DatabaseAdminClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a DatabaseAdminClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use DatabaseAdminClientBuilder.
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Type | Description |
Task<DatabaseAdminClient> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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 |
Operation<Backup, CreateBackupMetadata> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Operation<Backup, CreateBackupMetadata> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Operation<Backup, CreateBackupMetadata> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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 |
Task<Operation<Backup, CreateBackupMetadata>> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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 |
Task<Operation<Backup, CreateBackupMetadata>> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Task<Operation<Backup, CreateBackupMetadata>> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Task<Operation<Backup, CreateBackupMetadata>> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Task<Operation<Backup, CreateBackupMetadata>> | 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/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Task<Operation<Backup, CreateBackupMetadata>> | 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 &lt;database_name&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Operation<Database, CreateDatabaseMetadata> | 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 &lt;database_name&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Operation<Database, CreateDatabaseMetadata> | 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 &lt;database_name&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Operation<Database, CreateDatabaseMetadata> | 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 &lt;database_name&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Task<Operation<Database, CreateDatabaseMetadata>> | 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 &lt;database_name&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Task<Operation<Database, CreateDatabaseMetadata>> | 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 &lt;database_name&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Task<Operation<Database, CreateDatabaseMetadata>> | 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 &lt;database_name&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Task<Operation<Database, CreateDatabaseMetadata>> | 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 &lt;database_name&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Task<Operation<Database, CreateDatabaseMetadata>> | 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 &lt;database_name&gt;/operations/&lt;operation_id&gt;
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.
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. |
Type | Description |
Task<Operation<Database, CreateDatabaseMetadata>> | 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].
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].
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].
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].
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. |
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].
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. |
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].
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. |
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].
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. |
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].
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. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instances/[INSTANCE]/backups/[BACKUP]";
// Make the request
await databaseAdminClient.DeleteBackupAsync(name);
DeleteBackupAsync(String, CancellationToken)
public virtual Task DeleteBackupAsync(string name, CancellationToken cancellationToken)
Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Name | Description |
name | String Required. Name of the backup to delete.
Values are of the form
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instances/[INSTANCE]/backups/[BACKUP]";
// Make the request
await databaseAdminClient.DeleteBackupAsync(name);
DropDatabase(DropDatabaseRequest, CallSettings)
public virtual void DropDatabase(DropDatabaseRequest request, CallSettings callSettings = null)
Drops (aka deletes) a Cloud Spanner database.
Completed backups for the database will be retained according to their
expire_time
.
Note: Cloud Spanner might continue to accept requests for a few seconds
after the database has been deleted.
Name | Description |
request | DropDatabaseRequest 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)
DropDatabaseRequest request = new DropDatabaseRequest
{
DatabaseAsDatabaseName = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]"),
};
// Make the request
databaseAdminClient.DropDatabase(request);
DropDatabase(DatabaseName, CallSettings)
public virtual void DropDatabase(DatabaseName database, CallSettings callSettings = null)
Drops (aka deletes) a Cloud Spanner database.
Completed backups for the database will be retained according to their
expire_time
.
Note: Cloud Spanner might continue to accept requests for a few seconds
after the database has been deleted.
Name | Description |
database | Google.Cloud.Spanner.Common.V1.DatabaseName Required. The database to be dropped. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
DatabaseName database = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]");
// Make the request
databaseAdminClient.DropDatabase(database);
DropDatabase(String, CallSettings)
public virtual void DropDatabase(string database, CallSettings callSettings = null)
Drops (aka deletes) a Cloud Spanner database.
Completed backups for the database will be retained according to their
expire_time
.
Note: Cloud Spanner might continue to accept requests for a few seconds
after the database has been deleted.
Name | Description |
database | String Required. The database to be dropped. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
string database = "projects/[PROJECT]/instances/[INSTANCE]/databases/[DATABASE]";
// Make the request
databaseAdminClient.DropDatabase(database);
DropDatabaseAsync(DropDatabaseRequest, CallSettings)
public virtual Task DropDatabaseAsync(DropDatabaseRequest request, CallSettings callSettings = null)
Drops (aka deletes) a Cloud Spanner database.
Completed backups for the database will be retained according to their
expire_time
.
Note: Cloud Spanner might continue to accept requests for a few seconds
after the database has been deleted.
Name | Description |
request | DropDatabaseRequest 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 |
Task | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
DropDatabaseRequest request = new DropDatabaseRequest
{
DatabaseAsDatabaseName = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]"),
};
// Make the request
await databaseAdminClient.DropDatabaseAsync(request);
DropDatabaseAsync(DropDatabaseRequest, CancellationToken)
public virtual Task DropDatabaseAsync(DropDatabaseRequest request, CancellationToken cancellationToken)
Drops (aka deletes) a Cloud Spanner database.
Completed backups for the database will be retained according to their
expire_time
.
Note: Cloud Spanner might continue to accept requests for a few seconds
after the database has been deleted.
Name | Description |
request | DropDatabaseRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
DropDatabaseRequest request = new DropDatabaseRequest
{
DatabaseAsDatabaseName = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]"),
};
// Make the request
await databaseAdminClient.DropDatabaseAsync(request);
DropDatabaseAsync(DatabaseName, CallSettings)
public virtual Task DropDatabaseAsync(DatabaseName database, CallSettings callSettings = null)
Drops (aka deletes) a Cloud Spanner database.
Completed backups for the database will be retained according to their
expire_time
.
Note: Cloud Spanner might continue to accept requests for a few seconds
after the database has been deleted.
Name | Description |
database | Google.Cloud.Spanner.Common.V1.DatabaseName Required. The database to be dropped. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
DatabaseName database = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]");
// Make the request
await databaseAdminClient.DropDatabaseAsync(database);
DropDatabaseAsync(DatabaseName, CancellationToken)
public virtual Task DropDatabaseAsync(DatabaseName database, CancellationToken cancellationToken)
Drops (aka deletes) a Cloud Spanner database.
Completed backups for the database will be retained according to their
expire_time
.
Note: Cloud Spanner might continue to accept requests for a few seconds
after the database has been deleted.
Name | Description |
database | Google.Cloud.Spanner.Common.V1.DatabaseName Required. The database to be dropped. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
DatabaseName database = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]");
// Make the request
await databaseAdminClient.DropDatabaseAsync(database);
DropDatabaseAsync(String, CallSettings)
public virtual Task DropDatabaseAsync(string database, CallSettings callSettings = null)
Drops (aka deletes) a Cloud Spanner database.
Completed backups for the database will be retained according to their
expire_time
.
Note: Cloud Spanner might continue to accept requests for a few seconds
after the database has been deleted.
Name | Description |
database | String Required. The database to be dropped. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string database = "projects/[PROJECT]/instances/[INSTANCE]/databases/[DATABASE]";
// Make the request
await databaseAdminClient.DropDatabaseAsync(database);
DropDatabaseAsync(String, CancellationToken)
public virtual Task DropDatabaseAsync(string database, CancellationToken cancellationToken)
Drops (aka deletes) a Cloud Spanner database.
Completed backups for the database will be retained according to their
expire_time
.
Note: Cloud Spanner might continue to accept requests for a few seconds
after the database has been deleted.
Name | Description |
database | String Required. The database to be dropped. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string database = "projects/[PROJECT]/instances/[INSTANCE]/databases/[DATABASE]";
// Make the request
await databaseAdminClient.DropDatabaseAsync(database);
GetBackup(BackupName, CallSettings)
public virtual Backup GetBackup(BackupName name, CallSettings callSettings = null)
Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Name | Description |
name | BackupName Required. Name of the backup.
Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Backup | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
BackupName name = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]");
// Make the request
Backup response = databaseAdminClient.GetBackup(name);
GetBackup(GetBackupRequest, CallSettings)
public virtual Backup GetBackup(GetBackupRequest request, CallSettings callSettings = null)
Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Name | Description |
request | GetBackupRequest 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 |
Backup | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
GetBackupRequest request = new GetBackupRequest
{
BackupName = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]"),
};
// Make the request
Backup response = databaseAdminClient.GetBackup(request);
GetBackup(String, CallSettings)
public virtual Backup GetBackup(string name, CallSettings callSettings = null)
Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Name | Description |
name | String Required. Name of the backup.
Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Backup | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instances/[INSTANCE]/backups/[BACKUP]";
// Make the request
Backup response = databaseAdminClient.GetBackup(name);
GetBackupAsync(BackupName, CallSettings)
public virtual Task<Backup> GetBackupAsync(BackupName name, CallSettings callSettings = null)
Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Name | Description |
name | BackupName Required. Name of the backup.
Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Backup> | 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
Backup response = await databaseAdminClient.GetBackupAsync(name);
GetBackupAsync(BackupName, CancellationToken)
public virtual Task<Backup> GetBackupAsync(BackupName name, CancellationToken cancellationToken)
Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Name | Description |
name | BackupName Required. Name of the backup.
Values are of the form
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Backup> | 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
Backup response = await databaseAdminClient.GetBackupAsync(name);
GetBackupAsync(GetBackupRequest, CallSettings)
public virtual Task<Backup> GetBackupAsync(GetBackupRequest request, CallSettings callSettings = null)
Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Name | Description |
request | GetBackupRequest 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 |
Task<Backup> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
GetBackupRequest request = new GetBackupRequest
{
BackupName = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]"),
};
// Make the request
Backup response = await databaseAdminClient.GetBackupAsync(request);
GetBackupAsync(GetBackupRequest, CancellationToken)
public virtual Task<Backup> GetBackupAsync(GetBackupRequest request, CancellationToken cancellationToken)
Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Name | Description |
request | GetBackupRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Backup> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
GetBackupRequest request = new GetBackupRequest
{
BackupName = BackupName.FromProjectInstanceBackup("[PROJECT]", "[INSTANCE]", "[BACKUP]"),
};
// Make the request
Backup response = await databaseAdminClient.GetBackupAsync(request);
GetBackupAsync(String, CallSettings)
public virtual Task<Backup> GetBackupAsync(string name, CallSettings callSettings = null)
Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Name | Description |
name | String Required. Name of the backup.
Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Backup> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instances/[INSTANCE]/backups/[BACKUP]";
// Make the request
Backup response = await databaseAdminClient.GetBackupAsync(name);
GetBackupAsync(String, CancellationToken)
public virtual Task<Backup> GetBackupAsync(string name, CancellationToken cancellationToken)
Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
Name | Description |
name | String Required. Name of the backup.
Values are of the form
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Backup> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instances/[INSTANCE]/backups/[BACKUP]";
// Make the request
Backup response = await databaseAdminClient.GetBackupAsync(name);
GetDatabase(GetDatabaseRequest, CallSettings)
public virtual Database GetDatabase(GetDatabaseRequest request, CallSettings callSettings = null)
Gets the state of a Cloud Spanner database.
Name | Description |
request | GetDatabaseRequest 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 |
Database | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
GetDatabaseRequest request = new GetDatabaseRequest
{
DatabaseName = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]"),
};
// Make the request
Database response = databaseAdminClient.GetDatabase(request);
GetDatabase(DatabaseName, CallSettings)
public virtual Database GetDatabase(DatabaseName name, CallSettings callSettings = null)
Gets the state of a Cloud Spanner database.
Name | Description |
name | Google.Cloud.Spanner.Common.V1.DatabaseName Required. The name of the requested database. Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Database | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
DatabaseName name = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]");
// Make the request
Database response = databaseAdminClient.GetDatabase(name);
GetDatabase(String, CallSettings)
public virtual Database GetDatabase(string name, CallSettings callSettings = null)
Gets the state of a Cloud Spanner database.
Name | Description |
name | String Required. The name of the requested database. Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Database | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instances/[INSTANCE]/databases/[DATABASE]";
// Make the request
Database response = databaseAdminClient.GetDatabase(name);
GetDatabaseAsync(GetDatabaseRequest, CallSettings)
public virtual Task<Database> GetDatabaseAsync(GetDatabaseRequest request, CallSettings callSettings = null)
Gets the state of a Cloud Spanner database.
Name | Description |
request | GetDatabaseRequest 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 |
Task<Database> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
GetDatabaseRequest request = new GetDatabaseRequest
{
DatabaseName = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]"),
};
// Make the request
Database response = await databaseAdminClient.GetDatabaseAsync(request);
GetDatabaseAsync(GetDatabaseRequest, CancellationToken)
public virtual Task<Database> GetDatabaseAsync(GetDatabaseRequest request, CancellationToken cancellationToken)
Gets the state of a Cloud Spanner database.
Name | Description |
request | GetDatabaseRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Database> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
GetDatabaseRequest request = new GetDatabaseRequest
{
DatabaseName = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]"),
};
// Make the request
Database response = await databaseAdminClient.GetDatabaseAsync(request);
GetDatabaseAsync(DatabaseName, CallSettings)
public virtual Task<Database> GetDatabaseAsync(DatabaseName name, CallSettings callSettings = null)
Gets the state of a Cloud Spanner database.
Name | Description |
name | Google.Cloud.Spanner.Common.V1.DatabaseName Required. The name of the requested database. Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Database> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
DatabaseName name = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]");
// Make the request
Database response = await databaseAdminClient.GetDatabaseAsync(name);
GetDatabaseAsync(DatabaseName, CancellationToken)
public virtual Task<Database> GetDatabaseAsync(DatabaseName name, CancellationToken cancellationToken)
Gets the state of a Cloud Spanner database.
Name | Description |
name | Google.Cloud.Spanner.Common.V1.DatabaseName Required. The name of the requested database. Values are of the form
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Database> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
DatabaseName name = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]");
// Make the request
Database response = await databaseAdminClient.GetDatabaseAsync(name);
GetDatabaseAsync(String, CallSettings)
public virtual Task<Database> GetDatabaseAsync(string name, CallSettings callSettings = null)
Gets the state of a Cloud Spanner database.
Name | Description |
name | String Required. The name of the requested database. Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Database> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instances/[INSTANCE]/databases/[DATABASE]";
// Make the request
Database response = await databaseAdminClient.GetDatabaseAsync(name);
GetDatabaseAsync(String, CancellationToken)
public virtual Task<Database> GetDatabaseAsync(string name, CancellationToken cancellationToken)
Gets the state of a Cloud Spanner database.
Name | Description |
name | String Required. The name of the requested database. Values are of the form
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Database> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/instances/[INSTANCE]/databases/[DATABASE]";
// Make the request
Database response = await databaseAdminClient.GetDatabaseAsync(name);
GetDatabaseDdl(GetDatabaseDdlRequest, CallSettings)
public virtual GetDatabaseDdlResponse GetDatabaseDdl(GetDatabaseDdlRequest request, CallSettings callSettings = null)
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the [Operations][google.longrunning.Operations] API.
Name | Description |
request | GetDatabaseDdlRequest 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 |
GetDatabaseDdlResponse | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
GetDatabaseDdlRequest request = new GetDatabaseDdlRequest
{
DatabaseAsDatabaseName = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]"),
};
// Make the request
GetDatabaseDdlResponse response = databaseAdminClient.GetDatabaseDdl(request);
GetDatabaseDdl(DatabaseName, CallSettings)
public virtual GetDatabaseDdlResponse GetDatabaseDdl(DatabaseName database, CallSettings callSettings = null)
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the [Operations][google.longrunning.Operations] API.
Name | Description |
database | Google.Cloud.Spanner.Common.V1.DatabaseName Required. The database whose schema we wish to get.
Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
GetDatabaseDdlResponse | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
DatabaseName database = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]");
// Make the request
GetDatabaseDdlResponse response = databaseAdminClient.GetDatabaseDdl(database);
GetDatabaseDdl(String, CallSettings)
public virtual GetDatabaseDdlResponse GetDatabaseDdl(string database, CallSettings callSettings = null)
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the [Operations][google.longrunning.Operations] API.
Name | Description |
database | String Required. The database whose schema we wish to get.
Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
GetDatabaseDdlResponse | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
string database = "projects/[PROJECT]/instances/[INSTANCE]/databases/[DATABASE]";
// Make the request
GetDatabaseDdlResponse response = databaseAdminClient.GetDatabaseDdl(database);
GetDatabaseDdlAsync(GetDatabaseDdlRequest, CallSettings)
public virtual Task<GetDatabaseDdlResponse> GetDatabaseDdlAsync(GetDatabaseDdlRequest request, CallSettings callSettings = null)
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the [Operations][google.longrunning.Operations] API.
Name | Description |
request | GetDatabaseDdlRequest 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 |
Task<GetDatabaseDdlResponse> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
GetDatabaseDdlRequest request = new GetDatabaseDdlRequest
{
DatabaseAsDatabaseName = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]"),
};
// Make the request
GetDatabaseDdlResponse response = await databaseAdminClient.GetDatabaseDdlAsync(request);
GetDatabaseDdlAsync(GetDatabaseDdlRequest, CancellationToken)
public virtual Task<GetDatabaseDdlResponse> GetDatabaseDdlAsync(GetDatabaseDdlRequest request, CancellationToken cancellationToken)
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the [Operations][google.longrunning.Operations] API.
Name | Description |
request | GetDatabaseDdlRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<GetDatabaseDdlResponse> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
GetDatabaseDdlRequest request = new GetDatabaseDdlRequest
{
DatabaseAsDatabaseName = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]"),
};
// Make the request
GetDatabaseDdlResponse response = await databaseAdminClient.GetDatabaseDdlAsync(request);
GetDatabaseDdlAsync(DatabaseName, CallSettings)
public virtual Task<GetDatabaseDdlResponse> GetDatabaseDdlAsync(DatabaseName database, CallSettings callSettings = null)
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the [Operations][google.longrunning.Operations] API.
Name | Description |
database | Google.Cloud.Spanner.Common.V1.DatabaseName Required. The database whose schema we wish to get.
Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<GetDatabaseDdlResponse> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
DatabaseName database = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]");
// Make the request
GetDatabaseDdlResponse response = await databaseAdminClient.GetDatabaseDdlAsync(database);
GetDatabaseDdlAsync(DatabaseName, CancellationToken)
public virtual Task<GetDatabaseDdlResponse> GetDatabaseDdlAsync(DatabaseName database, CancellationToken cancellationToken)
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the [Operations][google.longrunning.Operations] API.
Name | Description |
database | Google.Cloud.Spanner.Common.V1.DatabaseName Required. The database whose schema we wish to get.
Values are of the form
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<GetDatabaseDdlResponse> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
DatabaseName database = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]");
// Make the request
GetDatabaseDdlResponse response = await databaseAdminClient.GetDatabaseDdlAsync(database);
GetDatabaseDdlAsync(String, CallSettings)
public virtual Task<GetDatabaseDdlResponse> GetDatabaseDdlAsync(string database, CallSettings callSettings = null)
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the [Operations][google.longrunning.Operations] API.
Name | Description |
database | String Required. The database whose schema we wish to get.
Values are of the form
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<GetDatabaseDdlResponse> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string database = "projects/[PROJECT]/instances/[INSTANCE]/databases/[DATABASE]";
// Make the request
GetDatabaseDdlResponse response = await databaseAdminClient.GetDatabaseDdlAsync(database);
GetDatabaseDdlAsync(String, CancellationToken)
public virtual Task<GetDatabaseDdlResponse> GetDatabaseDdlAsync(string database, CancellationToken cancellationToken)
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the [Operations][google.longrunning.Operations] API.
Name | Description |
database | String Required. The database whose schema we wish to get.
Values are of the form
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<GetDatabaseDdlResponse> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string database = "projects/[PROJECT]/instances/[INSTANCE]/databases/[DATABASE]";
// Make the request
GetDatabaseDdlResponse response = await databaseAdminClient.GetDatabaseDdlAsync(database);
GetIamPolicy(IResourceName, CallSettings)
public virtual Policy GetIamPolicy(IResourceName resource, CallSettings callSettings = null)
Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set.
Authorization requires spanner.databases.getIamPolicy
permission on
[resource][google.iam.v1.GetIamPolicyRequest.resource].
For backups, authorization requires spanner.backups.getIamPolicy
permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Policy | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = databaseAdminClient.GetIamPolicy(resource);
GetIamPolicy(GetIamPolicyRequest, CallSettings)
public virtual Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)
Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set.
Authorization requires spanner.databases.getIamPolicy
permission on
[resource][google.iam.v1.GetIamPolicyRequest.resource].
For backups, authorization requires spanner.backups.getIamPolicy
permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
Name | Description |
request | GetIamPolicyRequest 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 |
Policy | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Options = new GetPolicyOptions(),
};
// Make the request
Policy response = databaseAdminClient.GetIamPolicy(request);
GetIamPolicy(String, CallSettings)
public virtual Policy GetIamPolicy(string resource, CallSettings callSettings = null)
Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set.
Authorization requires spanner.databases.getIamPolicy
permission on
[resource][google.iam.v1.GetIamPolicyRequest.resource].
For backups, authorization requires spanner.backups.getIamPolicy
permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
Name | Description |
resource | String REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Policy | The RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = databaseAdminClient.GetIamPolicy(resource);
GetIamPolicyAsync(IResourceName, CallSettings)
public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CallSettings callSettings = null)
Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set.
Authorization requires spanner.databases.getIamPolicy
permission on
[resource][google.iam.v1.GetIamPolicyRequest.resource].
For backups, authorization requires spanner.backups.getIamPolicy
permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await databaseAdminClient.GetIamPolicyAsync(resource);
GetIamPolicyAsync(IResourceName, CancellationToken)
public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CancellationToken cancellationToken)
Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set.
Authorization requires spanner.databases.getIamPolicy
permission on
[resource][google.iam.v1.GetIamPolicyRequest.resource].
For backups, authorization requires spanner.backups.getIamPolicy
permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await databaseAdminClient.GetIamPolicyAsync(resource);
GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)
public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)
Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set.
Authorization requires spanner.databases.getIamPolicy
permission on
[resource][google.iam.v1.GetIamPolicyRequest.resource].
For backups, authorization requires spanner.backups.getIamPolicy
permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
Name | Description |
request | GetIamPolicyRequest 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 |
Task<Policy> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await databaseAdminClient.GetIamPolicyAsync(request);
GetIamPolicyAsync(GetIamPolicyRequest, CancellationToken)
public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CancellationToken cancellationToken)
Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set.
Authorization requires spanner.databases.getIamPolicy
permission on
[resource][google.iam.v1.GetIamPolicyRequest.resource].
For backups, authorization requires spanner.backups.getIamPolicy
permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
Name | Description |
request | GetIamPolicyRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await databaseAdminClient.GetIamPolicyAsync(request);
GetIamPolicyAsync(String, CallSettings)
public virtual Task<Policy> GetIamPolicyAsync(string resource, CallSettings callSettings = null)
Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set.
Authorization requires spanner.databases.getIamPolicy
permission on
[resource][google.iam.v1.GetIamPolicyRequest.resource].
For backups, authorization requires spanner.backups.getIamPolicy
permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
Name | Description |
resource | String REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await databaseAdminClient.GetIamPolicyAsync(resource);
GetIamPolicyAsync(String, CancellationToken)
public virtual Task<Policy> GetIamPolicyAsync(string resource, CancellationToken cancellationToken)
Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set.
Authorization requires spanner.databases.getIamPolicy
permission on
[resource][google.iam.v1.GetIamPolicyRequest.resource].
For backups, authorization requires spanner.backups.getIamPolicy
permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
Name | Description |
resource | String REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task<Policy> | A Task containing the RPC response. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await databaseAdminClient.GetIamPolicyAsync(resource);
ListBackupOperations(ListBackupOperationsRequest, CallSettings)
public virtual PagedEnumerable<ListBackupOperationsResponse, Operation> ListBackupOperations(ListBackupOperationsRequest request, CallSettings callSettings = null)
Lists the backup [long-running operations][google.longrunning.Operation] in
the given instance. A backup operation has a name of the form
projects/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation&gt;
.
The long-running operation
[metadata][google.longrunning.Operation.metadata] field type
metadata.type_url
describes the type of the metadata. Operations returned
include those that have completed/failed/canceled within the last 7 days,
and pending operations. Operations returned are ordered by
operation.metadata.value.progress.start_time
in descending order starting
from the most recently started operation.
Name | Description |
request | ListBackupOperationsRequest 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 |
PagedEnumerable<ListBackupOperationsResponse, Operation> | A pageable sequence of Operation resources. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
ListBackupOperationsRequest request = new ListBackupOperationsRequest
{
ParentAsInstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
Filter = "",
};
// Make the request
PagedEnumerable<ListBackupOperationsResponse, Operation> response = databaseAdminClient.ListBackupOperations(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Operation item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListBackupOperationsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Operation item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Operation> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Operation item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListBackupOperations(InstanceName, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListBackupOperationsResponse, Operation> ListBackupOperations(InstanceName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the backup [long-running operations][google.longrunning.Operation] in
the given instance. A backup operation has a name of the form
projects/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation&gt;
.
The long-running operation
[metadata][google.longrunning.Operation.metadata] field type
metadata.type_url
describes the type of the metadata. Operations returned
include those that have completed/failed/canceled within the last 7 days,
and pending operations. Operations returned are ordered by
operation.metadata.value.progress.start_time
in descending order starting
from the most recently started operation.
Name | Description |
parent | Google.Cloud.Spanner.Common.V1.InstanceName Required. The instance of the backup operations. Values are of
the form |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
PagedEnumerable<ListBackupOperationsResponse, Operation> | A pageable sequence of Operation resources. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
InstanceName parent = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
// Make the request
PagedEnumerable<ListBackupOperationsResponse, Operation> response = databaseAdminClient.ListBackupOperations(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Operation item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListBackupOperationsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Operation item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Operation> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Operation item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListBackupOperations(String, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListBackupOperationsResponse, Operation> ListBackupOperations(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the backup [long-running operations][google.longrunning.Operation] in
the given instance. A backup operation has a name of the form
projects/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation&gt;
.
The long-running operation
[metadata][google.longrunning.Operation.metadata] field type
metadata.type_url
describes the type of the metadata. Operations returned
include those that have completed/failed/canceled within the last 7 days,
and pending operations. Operations returned are ordered by
operation.metadata.value.progress.start_time
in descending order starting
from the most recently started operation.
Name | Description |
parent | String Required. The instance of the backup operations. Values are of
the form |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
PagedEnumerable<ListBackupOperationsResponse, Operation> | A pageable sequence of Operation resources. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/instances/[INSTANCE]";
// Make the request
PagedEnumerable<ListBackupOperationsResponse, Operation> response = databaseAdminClient.ListBackupOperations(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Operation item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListBackupOperationsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Operation item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Operation> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Operation item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListBackupOperationsAsync(ListBackupOperationsRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListBackupOperationsResponse, Operation> ListBackupOperationsAsync(ListBackupOperationsRequest request, CallSettings callSettings = null)
Lists the backup [long-running operations][google.longrunning.Operation] in
the given instance. A backup operation has a name of the form
projects/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation&gt;
.
The long-running operation
[metadata][google.longrunning.Operation.metadata] field type
metadata.type_url
describes the type of the metadata. Operations returned
include those that have completed/failed/canceled within the last 7 days,
and pending operations. Operations returned are ordered by
operation.metadata.value.progress.start_time
in descending order starting
from the most recently started operation.
Name | Description |
request | ListBackupOperationsRequest 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 |
PagedAsyncEnumerable<ListBackupOperationsResponse, Operation> | A pageable asynchronous sequence of Operation resources. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
ListBackupOperationsRequest request = new ListBackupOperationsRequest
{
ParentAsInstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListBackupOperationsResponse, Operation> response = databaseAdminClient.ListBackupOperationsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Operation item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListBackupOperationsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Operation item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Operation> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Operation item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListBackupOperationsAsync(InstanceName, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListBackupOperationsResponse, Operation> ListBackupOperationsAsync(InstanceName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the backup [long-running operations][google.longrunning.Operation] in
the given instance. A backup operation has a name of the form
projects/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation&gt;
.
The long-running operation
[metadata][google.longrunning.Operation.metadata] field type
metadata.type_url
describes the type of the metadata. Operations returned
include those that have completed/failed/canceled within the last 7 days,
and pending operations. Operations returned are ordered by
operation.metadata.value.progress.start_time
in descending order starting
from the most recently started operation.
Name | Description |
parent | Google.Cloud.Spanner.Common.V1.InstanceName Required. The instance of the backup operations. Values are of
the form |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
PagedAsyncEnumerable<ListBackupOperationsResponse, Operation> | A pageable asynchronous sequence of Operation resources. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
InstanceName parent = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
// Make the request
PagedAsyncEnumerable<ListBackupOperationsResponse, Operation> response = databaseAdminClient.ListBackupOperationsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Operation item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListBackupOperationsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Operation item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Operation> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Operation item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListBackupOperationsAsync(String, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListBackupOperationsResponse, Operation> ListBackupOperationsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the backup [long-running operations][google.longrunning.Operation] in
the given instance. A backup operation has a name of the form
projects/&lt;project&gt;/instances/&lt;instance&gt;/backups/&lt;backup&gt;/operations/&lt;operation&gt;
.
The long-running operation
[metadata][google.longrunning.Operation.metadata] field type
metadata.type_url
describes the type of the metadata. Operations returned
include those that have completed/failed/canceled within the last 7 days,
and pending operations. Operations returned are ordered by
operation.metadata.value.progress.start_time
in descending order starting
from the most recently started operation.
Name | Description |
parent | String Required. The instance of the backup operations. Values are of
the form |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
PagedAsyncEnumerable<ListBackupOperationsResponse, Operation> | A pageable asynchronous sequence of Operation resources. |
// Create client
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/instances/[INSTANCE]";
// Make the request
PagedAsyncEnumerable<ListBackupOperationsResponse, Operation> response = databaseAdminClient.ListBackupOperationsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Operation item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListBackupOperationsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Operation item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Operation> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Operation item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListBackups(ListBackupsRequest, CallSettings)
public virtual PagedEnumerable<ListBackupsResponse, Backup> ListBackups(ListBackupsRequest request, CallSettings callSettings = null)
Lists completed and pending backups.
Backups returned are ordered by create_time
in descending order,
starting from the most recent create_time
.
Name | Description |
request | ListBackupsRequest 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 |
PagedEnumerable<ListBackupsResponse, Backup> | A pageable sequence of Backup resources. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
ListBackupsRequest request = new ListBackupsRequest
{
ParentAsInstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"),
Filter = "",
};
// Make the request
PagedEnumerable<ListBackupsResponse, Backup> response = databaseAdminClient.ListBackups(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Backup item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListBackupsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Backup item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Backup> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Backup item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListBackups(InstanceName, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListBackupsResponse, Backup> ListBackups(InstanceName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists completed and pending backups.
Backups returned are ordered by create_time
in descending order,
starting from the most recent create_time
.
Name | Description |
parent | Google.Cloud.Spanner.Common.V1.InstanceName Required. The instance to list backups from. Values are of the
form |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
PagedEnumerable<ListBackupsResponse, Backup> | A pageable sequence of Backup resources. |
// Create client
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create();
// Initialize request argument(s)
InstanceName parent = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]");
// Make the request
PagedEnumerable<ListBackupsResponse, Backup> response = databaseAdminClient.ListBackups(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Backup item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListBackupsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Backup item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Backup> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Backup item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListBackups(String, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListBackupsResponse, Backup> ListBackups(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists completed and pending backups.
Backups returned are ordered by create_time
in descending order,
starting from the most recent create_time
.
Name | Description |
parent | String Required. The instance to list backups from. Values are of the
form |
pageToken | String The token returned from the previous request. A value of |