19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_DATABASE_ADMIN_CLIENT_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPANNER_ADMIN_DATABASE_ADMIN_CLIENT_H
22#include "google/cloud/spanner/admin/database_admin_connection.h"
23#include "google/cloud/future.h"
24#include "google/cloud/iam_updater.h"
25#include "google/cloud/options.h"
26#include "google/cloud/polling_policy.h"
27#include "google/cloud/status_or.h"
28#include "google/cloud/version.h"
29#include <google/longrunning/operations.grpc.pb.h>
35GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
87 return a.connection_ == b.connection_;
129 std::string
const& parent,
Options opts
= {});
169 google::spanner::admin::database::v1::ListDatabasesRequest request,
218 future<StatusOr<
google::spanner::admin::database::v1::Database>>
219 CreateDatabase(std::string
const& parent, std::string
const& create_statement,
267 future<StatusOr<
google::spanner::admin::database::v1::Database>>
269 google::spanner::admin::database::v1::CreateDatabaseRequest
const&
329 google::spanner::admin::database::v1::GetDatabaseRequest
const& request,
406 future<StatusOr<
google::spanner::admin::database::v1::Database>>
408 google::protobuf::FieldMask
const& update_mask,
486 future<StatusOr<
google::spanner::admin::database::v1::Database>>
488 google::spanner::admin::database::v1::UpdateDatabaseRequest
const&
531 StatusOr<
google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata>>
533 std::vector<std::string>
const& statements,
579 StatusOr<
google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata>>
581 google::spanner::admin::database::v1::UpdateDatabaseDdlRequest
const&
641 google::spanner::admin::database::v1::DropDatabaseRequest
const& request,
672 StatusOr<
google::spanner::admin::database::v1::GetDatabaseDdlResponse>
706 StatusOr<
google::spanner::admin::database::v1::GetDatabaseDdlResponse>
708 google::spanner::admin::database::v1::GetDatabaseDdlRequest
const&
748 std::string
const& resource,
google::iam::v1::Policy
const& policy,
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
772 IamUpdater
const& updater,
925 std::string
const& resource, std::vector<std::string>
const& permissions,
966 google::iam::v1::TestIamPermissionsRequest
const& request,
1023 std::string
const& parent,
1024 google::spanner::admin::database::v1::Backup
const& backup,
1025 std::string
const& backup_id,
Options opts
= {});
1077 google::spanner::admin::database::v1::CreateBackupRequest
const& request,
1140 std::string
const& parent, std::string
const& backup_id,
1141 std::string
const& source_backup,
1194 google::spanner::admin::database::v1::CopyBackupRequest
const& request,
1254 google::spanner::admin::database::v1::GetBackupRequest
const& request,
1289 google::spanner::admin::database::v1::Backup
const& backup,
1321 google::spanner::admin::database::v1::UpdateBackupRequest
const& request,
1376 google::spanner::admin::database::v1::DeleteBackupRequest
const& request,
1415 std::string
const& parent,
Options opts
= {});
1457 google::spanner::admin::database::v1::ListBackupsRequest request,
1519 future<StatusOr<
google::spanner::admin::database::v1::Database>>
1520 RestoreDatabase(std::string
const& parent, std::string
const& database_id,
1521 std::string
const& backup,
Options opts
= {});
1577 future<StatusOr<
google::spanner::admin::database::v1::Database>>
1579 google::spanner::admin::database::v1::RestoreDatabaseRequest
const&
1625 std::string
const& parent,
Options opts
= {});
1673 google::spanner::admin::database::v1::ListDatabaseOperationsRequest
1721 std::string
const& parent,
Options opts
= {});
1771 google::spanner::admin::database::v1::ListBackupOperationsRequest request,
1808 StreamRange<
google::spanner::admin::database::v1::DatabaseRole>
1848 StreamRange<
google::spanner::admin::database::v1::DatabaseRole>
1850 google::spanner::admin::database::v1::ListDatabaseRolesRequest request,
1858GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
1859namespace gcpcxxV1 = GOOGLE_CLOUD_CPP_NS;
friend friend class future
Cloud Spanner Database Admin API.
Definition: database_admin_client.h:69
friend bool operator!=(DatabaseAdminClient const &a, DatabaseAdminClient const &b)
Definition: database_admin_client.h:89
StreamRange< google::spanner::admin::database::v1::Database > ListDatabases(std::string const &parent, Options opts={})
Lists Cloud Spanner databases.
StatusOr< google::iam::v1::Policy > SetIamPolicy(std::string const &resource, IamUpdater const &updater, Options opts={})
Updates the IAM policy for resource using an optimistic concurrency control loop.
StreamRange< google::longrunning::Operation > ListBackupOperations(std::string const &parent, Options opts={})
Lists the backup long-running operations in the given instance.
future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > > UpdateDatabaseDdl(google::spanner::admin::database::v1::UpdateDatabaseDdlRequest const &request, Options opts={})
Updates the schema of a Cloud Spanner database by creating/altering/dropping tables,...
DatabaseAdminClient(std::shared_ptr< DatabaseAdminConnection > connection, Options opts={})
future< StatusOr< google::spanner::admin::database::v1::Database > > RestoreDatabase(google::spanner::admin::database::v1::RestoreDatabaseRequest const &request, Options opts={})
Create a new database by restoring from a completed backup.
DatabaseAdminClient & operator=(DatabaseAdminClient &&)=default
StatusOr< google::iam::v1::Policy > SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &request, Options opts={})
Sets the access control policy on a database or backup resource.
StreamRange< google::longrunning::Operation > ListDatabaseOperations(std::string const &parent, Options opts={})
Lists database longrunning-operations.
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &request, Options opts={})
Returns permissions that the caller has on the specified database or backup resource.
future< StatusOr< google::spanner::admin::database::v1::Database > > CreateDatabase(google::spanner::admin::database::v1::CreateDatabaseRequest const &request, Options opts={})
Creates a new Cloud Spanner database and starts to prepare it for serving.
StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse > GetDatabaseDdl(google::spanner::admin::database::v1::GetDatabaseDdlRequest const &request, Options opts={})
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements.
future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > > UpdateDatabaseDdl(std::string const &database, std::vector< std::string > const &statements, Options opts={})
Updates the schema of a Cloud Spanner database by creating/altering/dropping tables,...
StatusOr< google::spanner::admin::database::v1::Backup > GetBackup(google::spanner::admin::database::v1::GetBackupRequest const &request, Options opts={})
Gets metadata on a pending or completed Backup.
StatusOr< google::iam::v1::Policy > GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &request, Options opts={})
Gets the access control policy for a database or backup resource.
future< StatusOr< google::spanner::admin::database::v1::Database > > RestoreDatabase(std::string const &parent, std::string const &database_id, std::string const &backup, Options opts={})
Create a new database by restoring from a completed backup.
StatusOr< google::iam::v1::Policy > SetIamPolicy(std::string const &resource, google::iam::v1::Policy const &policy, Options opts={})
Sets the access control policy on a database or backup resource.
Status DropDatabase(google::spanner::admin::database::v1::DropDatabaseRequest const &request, Options opts={})
Drops (aka deletes) a Cloud Spanner database.
future< StatusOr< google::spanner::admin::database::v1::Database > > CreateDatabase(std::string const &parent, std::string const &create_statement, Options opts={})
Creates a new Cloud Spanner database and starts to prepare it for serving.
StreamRange< google::spanner::admin::database::v1::DatabaseRole > ListDatabaseRoles(std::string const &parent, Options opts={})
Lists Cloud Spanner database roles.
StreamRange< google::spanner::admin::database::v1::Database > ListDatabases(google::spanner::admin::database::v1::ListDatabasesRequest request, Options opts={})
Lists Cloud Spanner databases.
future< StatusOr< google::spanner::admin::database::v1::Backup > > CopyBackup(google::spanner::admin::database::v1::CopyBackupRequest const &request, Options opts={})
Starts copying a Cloud Spanner Backup.
future< StatusOr< google::spanner::admin::database::v1::Database > > UpdateDatabase(google::spanner::admin::database::v1::Database const &database, google::protobuf::FieldMask const &update_mask, Options opts={})
Updates a Cloud Spanner database.
Status DeleteBackup(std::string const &name, Options opts={})
Deletes a pending or completed Backup.
StreamRange< google::spanner::admin::database::v1::DatabaseRole > ListDatabaseRoles(google::spanner::admin::database::v1::ListDatabaseRolesRequest request, Options opts={})
Lists Cloud Spanner database roles.
StreamRange< google::spanner::admin::database::v1::Backup > ListBackups(google::spanner::admin::database::v1::ListBackupsRequest request, Options opts={})
Lists completed and pending backups.
DatabaseAdminClient(DatabaseAdminClient &&)=default
DatabaseAdminClient(DatabaseAdminClient const &)=default
StatusOr< google::iam::v1::Policy > GetIamPolicy(std::string const &resource, Options opts={})
Gets the access control policy for a database or backup resource.
StatusOr< google::spanner::admin::database::v1::Database > GetDatabase(std::string const &name, Options opts={})
Gets the state of a Cloud Spanner database.
StatusOr< google::spanner::admin::database::v1::Backup > GetBackup(std::string const &name, Options opts={})
Gets metadata on a pending or completed Backup.
StatusOr< google::spanner::admin::database::v1::Backup > UpdateBackup(google::spanner::admin::database::v1::UpdateBackupRequest const &request, Options opts={})
Updates a pending or completed Backup.
future< StatusOr< google::spanner::admin::database::v1::Database > > UpdateDatabase(google::spanner::admin::database::v1::UpdateDatabaseRequest const &request, Options opts={})
Updates a Cloud Spanner database.
StatusOr< google::spanner::admin::database::v1::Database > GetDatabase(google::spanner::admin::database::v1::GetDatabaseRequest const &request, Options opts={})
Gets the state of a Cloud Spanner database.
friend bool operator==(DatabaseAdminClient const &a, DatabaseAdminClient const &b)
Definition: database_admin_client.h:85
StatusOr< google::iam::v1::TestIamPermissionsResponse > TestIamPermissions(std::string const &resource, std::vector< std::string > const &permissions, Options opts={})
Returns permissions that the caller has on the specified database or backup resource.
Status DeleteBackup(google::spanner::admin::database::v1::DeleteBackupRequest const &request, Options opts={})
Deletes a pending or completed Backup.
future< StatusOr< google::spanner::admin::database::v1::Backup > > CreateBackup(google::spanner::admin::database::v1::CreateBackupRequest const &request, Options opts={})
Starts creating a new Cloud Spanner Backup.
future< StatusOr< google::spanner::admin::database::v1::Backup > > CopyBackup(std::string const &parent, std::string const &backup_id, std::string const &source_backup, google::protobuf::Timestamp const &expire_time, Options opts={})
Starts copying a Cloud Spanner Backup.
DatabaseAdminClient & operator=(DatabaseAdminClient const &)=default
StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse > GetDatabaseDdl(std::string const &database, Options opts={})
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements.
StatusOr< google::spanner::admin::database::v1::Backup > UpdateBackup(google::spanner::admin::database::v1::Backup const &backup, google::protobuf::FieldMask const &update_mask, Options opts={})
Updates a pending or completed Backup.
StreamRange< google::longrunning::Operation > ListDatabaseOperations(google::spanner::admin::database::v1::ListDatabaseOperationsRequest request, Options opts={})
Lists database longrunning-operations.
StreamRange< google::spanner::admin::database::v1::Backup > ListBackups(std::string const &parent, Options opts={})
Lists completed and pending backups.
StreamRange< google::longrunning::Operation > ListBackupOperations(google::spanner::admin::database::v1::ListBackupOperationsRequest request, Options opts={})
Lists the backup long-running operations in the given instance.
Status DropDatabase(std::string const &database, Options opts={})
Drops (aka deletes) a Cloud Spanner database.
future< StatusOr< google::spanner::admin::database::v1::Backup > > CreateBackup(std::string const &parent, google::spanner::admin::database::v1::Backup const &backup, std::string const &backup_id, Options opts={})
Starts creating a new Cloud Spanner Backup.
The DatabaseAdminConnection object for DatabaseAdminClient.
Definition: database_admin_connection.h:64
Definition: database_admin_client.h:34