15#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_DATABASE_ADMIN_CLIENT_H
16#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_DATABASE_ADMIN_CLIENT_H
18#include "google/cloud/spanner/backup.h"
19#include "google/cloud/spanner/connection_options.h"
20#include "google/cloud/spanner/database.h"
21#include "google/cloud/spanner/database_admin_connection.h"
22#include "google/cloud/spanner/encryption_config.h"
23#include "google/cloud/spanner/iam_updater.h"
24#include "google/cloud/spanner/instance.h"
25#include "google/cloud/spanner/timestamp.h"
26#include "google/cloud/spanner/version.h"
27#include "google/cloud/future.h"
28#include "google/cloud/status_or.h"
29#include "absl/types/optional.h"
37GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
124 ConnectionOptions
const& options = ConnectionOptions
());
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156 future<StatusOr<
google::spanner::admin::database::v1::Database>>
161
162
163
164
165
166
167
168
169
174
175
176
177
178
179
180
181
182
183 StatusOr<
google::spanner::admin::database::v1::GetDatabaseDdlResponse>
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
203 StatusOr<
google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata>>
207
208
209
210
211
212
213
214
218
219
220
221
222
223
224
225
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245 future<StatusOr<
google::spanner::admin::database::v1::Database>>
250
251
252
253
254
255
256
257
258
259
260
261
262
263 future<StatusOr<
google::spanner::admin::database::v1::Database>>
265 google::spanner::admin::database::v1::Backup
const& backup,
269
270
271
272
273
274
275
276
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
329 IamUpdater
const& updater);
332
333
334
335
336
337
338
340 Database const& db, IamUpdater
const& updater,
341 std::unique_ptr<TransactionRerunPolicy> rerun_policy,
342 std::unique_ptr<BackoffPolicy> backoff_policy);
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
367 Database db, std::vector<std::string> permissions);
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
402 absl::optional<
Timestamp> version_time = absl::nullopt,
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
432 std::chrono::system_clock::time_point expire_time);
435
436
437
438
439
440
441
442
443
448
449
450
451
452
453
455 google::spanner::admin::database::v1::Backup
const& backup);
458
459
460
461
462
463
464
465
466
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
490
491
492
493
494
495
496
497
499 google::spanner::admin::database::v1::Backup
const& backup,
503
504
505
506
507
508
509
510
511
512
513
518
519
520
521
522
523
524
525
526
527
528
530 google::spanner::admin::database::v1::Backup
const& backup,
531 std::chrono::system_clock::time_point
const& expire_time);
534
535
536
537
538
539
540
541
542
543
544
547 std::chrono::system_clock::time_point
const& expire_time);
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
568 std::string filter = {});
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
589 std::string filter = {});
593 : conn_(std::move(c)) {}
599GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
friend friend class future
This class identifies a Cloud Spanner Backup.
Definition: backup.h:39
Performs database administration operations on Spanner.
Definition: database_admin_client.h:121
StatusOr< google::spanner::admin::database::v1::Backup > UpdateBackupExpireTime(google::spanner::admin::database::v1::Backup const &backup, std::chrono::system_clock::time_point const &expire_time)
Update backup's expire_time.
Status DeleteBackup(google::spanner::admin::database::v1::Backup const &backup)
Deletes a pending or completed Backup.
ListDatabaseRange ListDatabases(Instance in)
List all the databases in a give project and instance.
future< StatusOr< google::spanner::admin::database::v1::Backup > > CreateBackup(Database db, std::string backup_id, std::chrono::system_clock::time_point expire_time)
Creates a new Cloud Spanner backup for the given database.
DatabaseAdminClient(ConnectionOptions const &options=ConnectionOptions())
StatusOr< google::spanner::admin::database::v1::Backup > UpdateBackupExpireTime(google::spanner::admin::database::v1::Backup const &backup, Timestamp expire_time)
Update backup's expire_time.
Status DropDatabase(Database db)
Drops (deletes) an existing Cloud Spanner database.
StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse > GetDatabaseDdl(Database db)
Retrieve a database schema.
StatusOr< google::spanner::admin::database::v1::Backup > UpdateBackupExpireTime(Backup const &backup, Timestamp expire_time)
Update backup's expire_time.
StatusOr< google::spanner::admin::database::v1::Backup > UpdateBackupExpireTime(Backup const &backup, std::chrono::system_clock::time_point const &expire_time)
Update backup's expire_time.
StatusOr< google::iam::v1::Policy > SetIamPolicy(Database const &db, IamUpdater const &updater, std::unique_ptr< TransactionRerunPolicy > rerun_policy, std::unique_ptr< BackoffPolicy > backoff_policy)
Updates the IAM policy for an instance using an optimistic concurrency control loop.
ListBackupsRange ListBackups(Instance in, std::string filter={})
List all the backups in a given project and instance that match the filter.
ListDatabaseOperationsRange ListDatabaseOperations(Instance in, std::string filter={})
List all the database operations in a given project and instance that match the filter.
future< StatusOr< google::spanner::admin::database::v1::Backup > > CreateBackup(Database db, std::string backup_id, Timestamp expire_time, absl::optional< Timestamp > version_time=absl::nullopt, EncryptionConfig encryption_config=DefaultEncryption())
Creates a new Cloud Spanner backup for the given database.
StatusOr< google::iam::v1::Policy > GetIamPolicy(Database db)
Gets the IAM policy for a database.
future< StatusOr< google::spanner::admin::database::v1::Database > > RestoreDatabase(Database db, google::spanner::admin::database::v1::Backup const &backup, EncryptionConfig encryption_config=DefaultEncryption())
Create a new database by restoring from a completed backup.
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(Database db, std::vector< std::string > permissions)
Get the subset of the permissions the caller has on the given database.
Status DeleteBackup(Backup const &backup)
Deletes a pending or completed Backup.
future< StatusOr< google::spanner::admin::database::v1::Database > > RestoreDatabase(Database db, Backup const &backup, EncryptionConfig encryption_config=DefaultEncryption())
Create a new database by restoring from a completed backup.
StatusOr< google::iam::v1::Policy > SetIamPolicy(Database const &db, IamUpdater const &updater)
Updates the IAM policy for an instance using an optimistic concurrency control loop.
StatusOr< google::spanner::admin::database::v1::Database > GetDatabase(Database db)
Retrieve metadata information about a database.
StatusOr< google::iam::v1::Policy > SetIamPolicy(Database db, google::iam::v1::Policy policy)
Set the IAM policy for the given database.
future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > > UpdateDatabase(Database db, std::vector< std::string > statements)
Updates the database using a series of DDL statements.
ListBackupOperationsRange ListBackupOperations(Instance in, std::string filter={})
List all the backup operations in a given project and instance that match the filter.
future< StatusOr< google::spanner::admin::database::v1::Database > > CreateDatabase(Database db, std::vector< std::string > extra_statements={}, EncryptionConfig encryption_config=DefaultEncryption())
Creates a new Cloud Spanner database in the given project and instance.
StatusOr< google::spanner::admin::database::v1::Backup > GetBackup(Backup const &backup)
Retrieve metadata information about a Backup.
DatabaseAdminClient(std::shared_ptr< DatabaseAdminConnection > c)
Create a new client with the given stub. For testing only.
Definition: database_admin_client.h:592
A connection to the Cloud Spanner instance administration service.
Definition: database_admin_connection.h:105
This class identifies a Cloud Spanner Database.
Definition: database.h:43
Use the per-operation default encryption:
Definition: encryption_config.h:33
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
#define GOOGLE_CLOUD_CPP_SPANNER_ADMIN_API_DEPRECATED(name)
Definition: version.h:23