15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_DATABASE_ADMIN_CONNECTION_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_DATABASE_ADMIN_CONNECTION_H
18#include "google/cloud/spanner/backoff_policy.h"
19#include "google/cloud/spanner/backup.h"
20#include "google/cloud/spanner/database.h"
21#include "google/cloud/spanner/encryption_config.h"
22#include "google/cloud/spanner/instance.h"
23#include "google/cloud/spanner/internal/database_admin_stub.h"
24#include "google/cloud/spanner/polling_policy.h"
25#include "google/cloud/spanner/retry_policy.h"
26#include "google/cloud/spanner/timestamp.h"
27#include "google/cloud/spanner/version.h"
28#include "google/cloud/backoff_policy.h"
29#include "google/cloud/internal/pagination_range.h"
30#include "google/cloud/options.h"
31#include "absl/types/optional.h"
32#include <google/spanner/admin/database/v1/spanner_database_admin.pb.h>
40GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
43
44
45
46
47
48
49
50
51using ListDatabaseRange = ::
google::
cloud::internal::PaginationRange<
52 google::spanner::admin::database::v1::Database>;
55
56
57
58
59
60
61
62
63using ListBackupOperationsRange =
67
68
69
70
71
72
73
74
75using ListDatabaseOperationsRange =
79
80
81
82
83
84
85
86
87using ListBackupsRange = ::
google::
cloud::internal::PaginationRange<
88 google::spanner::admin::database::v1::Backup>;
91
92
93
94
95
96
97
98
99
100
101
102
103
111
112
113
114
115
116
117
229 google::spanner::admin::database::v1::UpdateBackupRequest
request;
251 virtual future<StatusOr<
google::spanner::admin::database::v1::Database>>
261 virtual StatusOr<
google::spanner::admin::database::v1::GetDatabaseDdlResponse>
267 StatusOr<
google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata>>
280 virtual future<StatusOr<
google::spanner::admin::database::v1::Database>>
295 virtual StatusOr<
google::iam::v1::TestIamPermissionsResponse>
300 virtual future<StatusOr<
google::spanner::admin::database::v1::Backup>>
304 virtual StatusOr<
google::spanner::admin::database::v1::Backup>
GetBackup(
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
356
357
358
359
360
361
362
363
364
365
366
367
368
369
372 ConnectionOptions
const& options);
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
398 ConnectionOptions
const& options, std::unique_ptr<RetryPolicy> retry_policy,
399 std::unique_ptr<BackoffPolicy> backoff_policy,
400 std::unique_ptr<PollingPolicy> polling_policy);
402GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
405namespace spanner_internal {
406GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
410MakeDatabaseAdminConnectionForTesting(std::shared_ptr<DatabaseAdminStub> stub,
413GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
friend friend class future
A connection to the Cloud Spanner instance administration service.
Definition: database_admin_connection.h:105
virtual future< StatusOr< google::spanner::admin::database::v1::Backup > > CreateBackup(CreateBackupParams)
Define the interface for a google.spanner.v1.DatabaseAdmin.CreateBackup RPC.
virtual StatusOr< google::spanner::admin::database::v1::Backup > UpdateBackup(UpdateBackupParams)
Define the interface for a google.spanner.v1.DatabaseAdmin.UpdateBackup RPC.
virtual StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(TestIamPermissionsParams)=0
Define the interface for a google.spanner.v1.DatabaseAdmin.TestIamPermissions RPC.
virtual Status DropDatabase(DropDatabaseParams)=0
Define the interface for a google.spanner.v1.DatabaseAdmin.DropDatabase RPC.
virtual ListDatabaseRange ListDatabases(ListDatabasesParams)=0
Define the interface for a google.spanner.v1.DatabaseAdmin.DropDatabase RPC.
virtual StatusOr< google::spanner::admin::database::v1::Backup > GetBackup(GetBackupParams)
Define the interface for a google.spanner.v1.DatabaseAdmin.GetBackup RPC.
virtual ListBackupsRange ListBackups(ListBackupsParams)
Define the interface for a google.spanner.v1.DatabaseAdmin.ListBackups RPC.
virtual StatusOr< google::iam::v1::Policy > GetIamPolicy(GetIamPolicyParams)=0
Define the interface for a google.spanner.v1.DatabaseAdmin.GetIamPolicy RPC.
virtual future< StatusOr< google::spanner::admin::database::v1::Database > > CreateDatabase(CreateDatabaseParams)=0
Define the interface for a google.spanner.v1.DatabaseAdmin.CreateDatabase RPC.
virtual future< StatusOr< google::spanner::admin::database::v1::Database > > RestoreDatabase(RestoreDatabaseParams)
Define the interface for a google.spanner.v1.DatabaseAdmin.RestoreDatabase RPC.
virtual ~DatabaseAdminConnection()=0
virtual Options options()
Definition: database_admin_connection.h:247
virtual StatusOr< google::iam::v1::Policy > SetIamPolicy(SetIamPolicyParams)=0
Define the interface for a google.spanner.v1.DatabaseAdmin.SetIamPolicy RPC.
virtual ListDatabaseOperationsRange ListDatabaseOperations(ListDatabaseOperationsParams)
Define the interface for a google.spanner.v1.DatabaseAdmin.ListDatabaseOperations RPC.
virtual ListBackupOperationsRange ListBackupOperations(ListBackupOperationsParams)
Define the interface for a google.spanner.v1.DatabaseAdmin.ListBackupOperations RPC.
virtual StatusOr< google::spanner::admin::database::v1::Database > GetDatabase(GetDatabaseParams)=0
Define the interface for a google.spanner.v1.DatabaseAdmin.GetDatabase RPC.
virtual future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > > UpdateDatabase(UpdateDatabaseParams)=0
Define the interface for a google.spanner.v1.DatabaseAdmin.UpdateDatabase RPC.
virtual Status DeleteBackup(DeleteBackupParams)
Define the interface for a google.spanner.v1.DatabaseAdmin.DeleteBackup RPC.
virtual StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse > GetDatabaseDdl(GetDatabaseDdlParams)=0
Define the interface for a google.spanner.v1.DatabaseAdmin.GetDatabaseDdl RPC.
This class identifies a Cloud Spanner Database.
Definition: database.h:43
This class identifies a Cloud Spanner Instance.
Definition: instance.h:42
A representation of the Spanner TIMESTAMP type: An instant in time.
Definition: timestamp.h:54
Contains all the Cloud Spanner C++ client types and functions.
Definition: backoff_policy.h:23
std::shared_ptr< DatabaseAdminConnection > MakeDatabaseAdminConnection(ConnectionOptions const &options, std::unique_ptr< RetryPolicy > retry_policy, std::unique_ptr< BackoffPolicy > backoff_policy, std::unique_ptr< PollingPolicy > polling_policy)
Returns a DatabaseAdminConnection object that can be used for interacting with Cloud Spanner's admin ...
std::shared_ptr< DatabaseAdminConnection > MakeDatabaseAdminConnection(ConnectionOptions const &options)
Returns a DatabaseAdminConnection object that can be used for interacting with Cloud Spanner's admin ...
std::shared_ptr< spanner::DatabaseAdminConnection > MakeDatabaseAdminConnection(Options opts={})
Returns a DatabaseAdminConnection object that can be used for interacting with Cloud Spanner's admin ...
Wrap the arguments for CreateBackup().
Definition: database_admin_connection.h:181
EncryptionConfig encryption_config
How to encrypt the backup.
Definition: database_admin_connection.h:195
Timestamp expire_timestamp
Definition: database_admin_connection.h:189
std::string backup_id
Definition: database_admin_connection.h:184
Database database
The name of the database.
Definition: database_admin_connection.h:183
absl::optional< Timestamp > version_time
The backup will contain an externally consistent copy of the database at version_time.
Definition: database_admin_connection.h:193
std::chrono::system_clock::time_point expire_time
Definition: database_admin_connection.h:188
Wrap the arguments for CreateDatabase().
Definition: database_admin_connection.h:119
Database database
The name of the database.
Definition: database_admin_connection.h:121
EncryptionConfig encryption_config
How to encrypt the database.
Definition: database_admin_connection.h:125
std::vector< std::string > extra_statements
Any additional statements to execute after creating the database.
Definition: database_admin_connection.h:123
Wrap the arguments for DeleteBackup().
Definition: database_admin_connection.h:205
std::string backup_full_name
The name of the backup.
Definition: database_admin_connection.h:207
Wrap the arguments for DropDatabase().
Definition: database_admin_connection.h:149
Database database
The name of the database.
Definition: database_admin_connection.h:151
Wrap the arguments for GetBackup().
Definition: database_admin_connection.h:199
std::string backup_full_name
The name of the backup.
Definition: database_admin_connection.h:201
Wrap the arguments for GetDatabaseDdl().
Definition: database_admin_connection.h:135
Database database
The name of the database.
Definition: database_admin_connection.h:137
Wrap the arguments for GetDatabase().
Definition: database_admin_connection.h:129
Database database
The name of the database.
Definition: database_admin_connection.h:131
Wrap the arguments for GetIamPolicy().
Definition: database_admin_connection.h:161
Database database
The name of the database.
Definition: database_admin_connection.h:163
Wrap the arguments for ListBackupOperations().
Definition: database_admin_connection.h:233
Instance instance
The name of the instance.
Definition: database_admin_connection.h:235
std::string filter
Definition: database_admin_connection.h:236
Wrap the arguments for ListBackups().
Definition: database_admin_connection.h:211
Instance instance
The name of the instance.
Definition: database_admin_connection.h:213
std::string filter
Definition: database_admin_connection.h:214
Wrap the arguments for ListDatabaseOperations().
Definition: database_admin_connection.h:240
Instance instance
The name of the instance.
Definition: database_admin_connection.h:242
std::string filter
Definition: database_admin_connection.h:243
Wrap the arguments for ListDatabases().
Definition: database_admin_connection.h:155
Instance instance
The name of the instance.
Definition: database_admin_connection.h:157
Wrap the arguments for RestoreDatabase().
Definition: database_admin_connection.h:218
std::string backup_full_name
The source backup for the restore.
Definition: database_admin_connection.h:222
Database database
The name of the database.
Definition: database_admin_connection.h:220
EncryptionConfig encryption_config
How to encrypt the database.
Definition: database_admin_connection.h:224
Wrap the arguments for SetIamPolicy().
Definition: database_admin_connection.h:167
Database database
The name of the database.
Definition: database_admin_connection.h:169
google::iam::v1::Policy policy
Definition: database_admin_connection.h:170
Wrap the arguments for TestIamPermissions().
Definition: database_admin_connection.h:174
std::vector< std::string > permissions
Definition: database_admin_connection.h:177
Database database
The name of the database.
Definition: database_admin_connection.h:176
Wrap the arguments for UpdateBackup().
Definition: database_admin_connection.h:228
google::spanner::admin::database::v1::UpdateBackupRequest request
Definition: database_admin_connection.h:229
Wrap the arguments for UpdateDatabase().
Definition: database_admin_connection.h:141
Database database
The name of the database.
Definition: database_admin_connection.h:143
std::vector< std::string > statements
The DDL statements updating the database schema.
Definition: database_admin_connection.h:145
#define GOOGLE_CLOUD_CPP_SPANNER_ADMIN_API_DEPRECATED(name)
Definition: version.h:23