Class: Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client
- Inherits:
-
Object
- Object
- Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client
- Includes:
- Paths
- Defined in:
- lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb
Overview
Client for the DatabaseAdmin service.
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, copy and list backups for a database
- restore a database from an existing backup
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#operations_client ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Operations
readonly
Get the associated client for long-running operations.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the DatabaseAdmin Client class.
Instance Method Summary collapse
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the DatabaseAdmin Client instance.
-
#copy_backup(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Starts copying a Cloud Spanner Backup.
-
#create_backup(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Starts creating a new Cloud Spanner Backup.
-
#create_backup_schedule(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule
Creates a new backup schedule.
-
#create_database(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Creates a new Cloud Spanner database and starts to prepare it for serving.
-
#delete_backup(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a pending or completed Backup.
-
#delete_backup_schedule(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a backup schedule.
-
#drop_database(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Drops (aka deletes) a Cloud Spanner database.
-
#get_backup(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::Backup
Gets metadata on a pending or completed Backup.
-
#get_backup_schedule(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule
Gets backup schedule for the input schedule name.
-
#get_database(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::Database
Gets the state of a Cloud Spanner database.
-
#get_database_ddl(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements.
-
#get_iam_policy(request, options = nil) {|response, operation| ... } ⇒ ::Google::Iam::V1::Policy
Gets the access control policy for a database or backup resource.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new DatabaseAdmin client object.
-
#list_backup_operations(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Gapic::Operation>
Lists the backup long-running operations in the given instance.
-
#list_backup_schedules(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>
Lists all the backup schedules for the database.
-
#list_backups(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Backup>
Lists completed and pending backups.
-
#list_database_operations(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Gapic::Operation>
Lists database longrunning-operations.
-
#list_database_roles(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>
Lists Cloud Spanner database roles.
-
#list_databases(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Database>
Lists Cloud Spanner databases.
-
#logger ⇒ Logger
The logger used for request/response debug logging.
-
#restore_database(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Create a new database by restoring from a completed backup.
-
#set_iam_policy(request, options = nil) {|response, operation| ... } ⇒ ::Google::Iam::V1::Policy
Sets the access control policy on a database or backup resource.
-
#test_iam_permissions(request, options = nil) {|response, operation| ... } ⇒ ::Google::Iam::V1::TestIamPermissionsResponse
Returns permissions that the caller has on the specified database or backup resource.
-
#universe_domain ⇒ String
The effective universe domain.
-
#update_backup(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::Backup
Updates a pending or completed Backup.
-
#update_backup_schedule(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule
Updates a backup schedule.
-
#update_database(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Updates a Cloud Spanner database.
-
#update_database_ddl(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc.
Methods included from Paths
#backup_path, #backup_schedule_path, #crypto_key_path, #crypto_key_version_path, #database_path, #instance_path
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new DatabaseAdmin client object.
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 239 def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "google/spanner/admin/database/v1/spanner_database_admin_services_pb" # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint.nil? || (@config.endpoint == Configuration::DEFAULT_ENDPOINT && !@config.endpoint.split(".").first.include?("-")) credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_client = Operations.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint config.universe_domain = @config.universe_domain end @database_admin_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Stub, credentials: credentials, endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, channel_args: @config.channel_args, interceptors: @config.interceptors, channel_pool_config: @config.channel_pool, logger: @config.logger ) @database_admin_stub.stub_logger&.info do |entry| entry.set_system_name entry.set_service entry. = "Created client for #{entry.service}" entry.set_credentials_fields credentials entry.set "customEndpoint", @config.endpoint if @config.endpoint entry.set "defaultTimeout", @config.timeout if @config.timeout entry.set "quotaProject", @quota_project_id if @quota_project_id end end |
Instance Attribute Details
#operations_client ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Operations (readonly)
Get the associated client for long-running operations.
302 303 304 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 302 def operations_client @operations_client end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the DatabaseAdmin Client class.
See Configuration for a description of the configuration fields.
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 120 121 122 123 124 125 126 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 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 70 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Spanner", "Admin", "Database", "V1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.rpcs.list_databases.timeout = 3600.0 default_config.rpcs.list_databases.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.create_database.timeout = 3600.0 default_config.rpcs.get_database.timeout = 3600.0 default_config.rpcs.get_database.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.update_database.timeout = 3600.0 default_config.rpcs.update_database.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.update_database_ddl.timeout = 3600.0 default_config.rpcs.update_database_ddl.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.drop_database.timeout = 3600.0 default_config.rpcs.drop_database.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.get_database_ddl.timeout = 3600.0 default_config.rpcs.get_database_ddl.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.set_iam_policy.timeout = 30.0 default_config.rpcs.get_iam_policy.timeout = 30.0 default_config.rpcs.get_iam_policy.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs..timeout = 30.0 default_config.rpcs.create_backup.timeout = 3600.0 default_config.rpcs.copy_backup.timeout = 3600.0 default_config.rpcs.get_backup.timeout = 3600.0 default_config.rpcs.get_backup.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.update_backup.timeout = 3600.0 default_config.rpcs.update_backup.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.delete_backup.timeout = 3600.0 default_config.rpcs.delete_backup.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.list_backups.timeout = 3600.0 default_config.rpcs.list_backups.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.restore_database.timeout = 3600.0 default_config.rpcs.list_database_operations.timeout = 3600.0 default_config.rpcs.list_database_operations.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.list_backup_operations.timeout = 3600.0 default_config.rpcs.list_backup_operations.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.list_database_roles.timeout = 3600.0 default_config.rpcs.list_database_roles.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.create_backup_schedule.timeout = 3600.0 default_config.rpcs.create_backup_schedule.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.get_backup_schedule.timeout = 3600.0 default_config.rpcs.get_backup_schedule.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.update_backup_schedule.timeout = 3600.0 default_config.rpcs.update_backup_schedule.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.delete_backup_schedule.timeout = 3600.0 default_config.rpcs.delete_backup_schedule.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.list_backup_schedules.timeout = 3600.0 default_config.rpcs.list_backup_schedules.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config end yield @configure if block_given? @configure end |
Instance Method Details
#configure {|config| ... } ⇒ Client::Configuration
Configure the DatabaseAdmin Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.
See Configuration for a description of the configuration fields.
209 210 211 212 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 209 def configure yield @config if block_given? @config end |
#copy_backup(request, options = nil) ⇒ ::Gapic::Operation #copy_backup(parent: nil, backup_id: nil, source_backup: nil, expire_time: nil, encryption_config: nil) ⇒ ::Gapic::Operation
Starts copying a Cloud Spanner Backup.
The returned backup long-running operation
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track copying of the backup. The operation is associated
with the destination backup.
The metadata field type is
CopyBackupMetadata.
The response field type is
Backup, if successful.
Cancelling the returned operation will stop the copying and delete the
destination backup. Concurrent CopyBackup requests can run on the same
source backup.
1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 1596 def copy_backup request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.copy_backup..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.copy_backup.timeout, metadata: , retry_policy: @config.rpcs.copy_backup.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :copy_backup, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_backup(request, options = nil) ⇒ ::Gapic::Operation #create_backup(parent: nil, backup_id: nil, backup: nil, encryption_config: nil) ⇒ ::Gapic::Operation
Starts creating a new Cloud Spanner Backup.
The returned backup long-running operation
will have a name of the format
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>
and can be used to track creation of the backup. The
metadata field type is
CreateBackupMetadata.
The response field type is
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.
1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 1466 def create_backup request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_backup..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_backup.timeout, metadata: , retry_policy: @config.rpcs.create_backup.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :create_backup, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_backup_schedule(request, options = nil) ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule #create_backup_schedule(parent: nil, backup_schedule_id: nil, backup_schedule: nil) ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule
Creates a new backup schedule.
2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 2671 def create_backup_schedule request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_backup_schedule..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_backup_schedule.timeout, metadata: , retry_policy: @config.rpcs.create_backup_schedule.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :create_backup_schedule, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_database(request, options = nil) ⇒ ::Gapic::Operation #create_database(parent: nil, create_statement: nil, extra_statements: nil, encryption_config: nil, database_dialect: nil, proto_descriptors: nil) ⇒ ::Gapic::Operation
Creates a new Cloud Spanner database and starts to prepare it for serving.
The returned long-running operation will
have a name of the format <database_name>/operations/<operation_id>
and
can be used to track preparation of the database. The
metadata field type is
CreateDatabaseMetadata.
The response field type is
Database, if successful.
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 507 def create_database request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_database..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_database.timeout, metadata: , retry_policy: @config.rpcs.create_database.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :create_database, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_backup(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_backup(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a pending or completed Backup.
1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 1869 def delete_backup request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_backup..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_backup.timeout, metadata: , retry_policy: @config.rpcs.delete_backup.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :delete_backup, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_backup_schedule(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_backup_schedule(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a backup schedule.
2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 2938 def delete_backup_schedule request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_backup_schedule..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_backup_schedule.timeout, metadata: , retry_policy: @config.rpcs.delete_backup_schedule.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :delete_backup_schedule, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#drop_database(request, options = nil) ⇒ ::Google::Protobuf::Empty #drop_database(database: nil) ⇒ ::Google::Protobuf::Empty
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.
958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 958 def drop_database request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.drop_database..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.database header_params["database"] = request.database end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.drop_database.timeout, metadata: , retry_policy: @config.rpcs.drop_database.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :drop_database, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_backup(request, options = nil) ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::Backup #get_backup(name: nil) ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::Backup
Gets metadata on a pending or completed Backup.
1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 1686 def get_backup request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_backup..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_backup.timeout, metadata: , retry_policy: @config.rpcs.get_backup.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :get_backup, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_backup_schedule(request, options = nil) ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule #get_backup_schedule(name: nil) ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule
Gets backup schedule for the input schedule name.
2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 2758 def get_backup_schedule request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_backup_schedule..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_backup_schedule.timeout, metadata: , retry_policy: @config.rpcs.get_backup_schedule.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :get_backup_schedule, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_database(request, options = nil) ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::Database #get_database(name: nil) ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::Database
Gets the state of a Cloud Spanner database.
595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 595 def get_database request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_database..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_database.timeout, metadata: , retry_policy: @config.rpcs.get_database.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :get_database, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_database_ddl(request, options = nil) ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse #get_database_ddl(database: nil) ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse
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 API.
1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 1047 def get_database_ddl request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_database_ddl..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.database header_params["database"] = request.database end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_database_ddl.timeout, metadata: , retry_policy: @config.rpcs.get_database_ddl.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :get_database_ddl, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #get_iam_policy(resource: nil, options: nil) ⇒ ::Google::Iam::V1::Policy
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.
For backups, authorization requires spanner.backups.getIamPolicy
permission on resource.
1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 1246 def get_iam_policy request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_iam_policy..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.resource header_params["resource"] = request.resource end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, metadata: , retry_policy: @config.rpcs.get_iam_policy.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :get_iam_policy, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_backup_operations(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Gapic::Operation> #list_backup_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Gapic::Operation>
Lists the backup long-running operations in
the given instance. A backup operation has a name of the form
projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>
.
The long-running 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.
2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 2476 def list_backup_operations request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_backup_operations..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_backup_operations.timeout, metadata: , retry_policy: @config.rpcs.list_backup_operations.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :list_backup_operations, request, options: do |response, operation| wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_backup_operations, request, response, operation, , format_resource: wrap_lro_operation yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_backup_schedules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule> #list_backup_schedules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>
Lists all the backup schedules for the database.
3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 3038 def list_backup_schedules request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_backup_schedules..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_backup_schedules.timeout, metadata: , retry_policy: @config.rpcs.list_backup_schedules.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :list_backup_schedules, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_backup_schedules, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_backups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Backup> #list_backups(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Backup>
Lists completed and pending backups.
Backups returned are ordered by create_time
in descending order,
starting from the most recent create_time
.
2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 2011 def list_backups request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_backups..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_backups.timeout, metadata: , retry_policy: @config.rpcs.list_backups.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :list_backups, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_backups, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_database_operations(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Gapic::Operation> #list_database_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Gapic::Operation>
Lists database longrunning-operations.
A database operation has a name of the form
projects/<project>/instances/<instance>/databases/<database>/operations/<operation>
.
The long-running 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.
2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 2294 def list_database_operations request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_database_operations..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_database_operations.timeout, metadata: , retry_policy: @config.rpcs.list_database_operations.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :list_database_operations, request, options: do |response, operation| wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_database_operations, request, response, operation, , format_resource: wrap_lro_operation yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_database_roles(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole> #list_database_roles(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole>
Lists Cloud Spanner database roles.
2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 2578 def list_database_roles request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_database_roles..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_database_roles.timeout, metadata: , retry_policy: @config.rpcs.list_database_roles.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :list_database_roles, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_database_roles, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_databases(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Database> #list_databases(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::Database>
Lists Cloud Spanner databases.
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 400 401 402 403 404 405 406 407 408 409 410 411 412 413 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 372 def list_databases request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_databases..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_databases.timeout, metadata: , retry_policy: @config.rpcs.list_databases.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :list_databases, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_databases, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#logger ⇒ Logger
The logger used for request/response debug logging.
309 310 311 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 309 def logger @database_admin_stub.logger end |
#restore_database(request, options = nil) ⇒ ::Gapic::Operation #restore_database(parent: nil, database_id: nil, backup: nil, encryption_config: nil) ⇒ ::Gapic::Operation
Create a new database by restoring from a completed backup. The new
database must be in the same project and in an instance with the same
instance configuration as the instance containing
the backup. The returned database [long-running
operation][google.longrunning.Operation] has a name of the format
projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>
,
and can be used to track the progress of the operation, and to cancel it.
The metadata field type is
RestoreDatabaseMetadata.
The response type
is Database, if
successful. Cancelling the returned operation will stop the restore and
delete the database.
There can be only one database being restored into an instance at a time.
Once the restore operation completes, a new restore operation can be
initiated, without waiting for the optimize operation associated with the
first restore to complete.
2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 2140 def restore_database request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.restore_database..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.restore_database.timeout, metadata: , retry_policy: @config.rpcs.restore_database.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :restore_database, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#set_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #set_iam_policy(resource: nil, policy: nil, update_mask: nil) ⇒ ::Google::Iam::V1::Policy
1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 1150 def set_iam_policy request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.set_iam_policy..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.resource header_params["resource"] = request.resource end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, metadata: , retry_policy: @config.rpcs.set_iam_policy.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :set_iam_policy, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#test_iam_permissions(request, options = nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse
Returns permissions that the caller has on the specified database or backup resource.
Attempting this RPC on a non-existent Cloud Spanner database will
result in a NOT_FOUND error if the user has
spanner.databases.list
permission on the containing Cloud
Spanner instance. Otherwise returns an empty set of permissions.
Calling this method on a backup that does not exist will
result in a NOT_FOUND error if the user has
spanner.backups.list
permission on the containing instance.
1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 1346 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs...to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.resource header_params["resource"] = request.resource end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs..timeout, metadata: , retry_policy: @config.rpcs..retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :test_iam_permissions, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#universe_domain ⇒ String
The effective universe domain
219 220 221 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 219 def universe_domain @database_admin_stub.universe_domain end |
#update_backup(request, options = nil) ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::Backup #update_backup(backup: nil, update_mask: nil) ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::Backup
Updates a pending or completed Backup.
1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 1781 def update_backup request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_backup..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.backup&.name header_params["backup.name"] = request.backup.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_backup.timeout, metadata: , retry_policy: @config.rpcs.update_backup.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :update_backup, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_backup_schedule(request, options = nil) ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule #update_backup_schedule(backup_schedule: nil, update_mask: nil) ⇒ ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule
Updates a backup schedule.
2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 2851 def update_backup_schedule request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_backup_schedule..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.backup_schedule&.name header_params["backup_schedule.name"] = request.backup_schedule.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_backup_schedule.timeout, metadata: , retry_policy: @config.rpcs.update_backup_schedule.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :update_backup_schedule, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_database(request, options = nil) ⇒ ::Gapic::Operation #update_database(database: nil, update_mask: nil) ⇒ ::Gapic::Operation
Updates a Cloud Spanner database. The returned
long-running operation can be used to track
the progress of updating the database. If the named database does not
exist, returns NOT_FOUND
.
While the operation is pending:
- The database's reconciling field is set to true.
- Cancelling the operation is best-effort. If the cancellation succeeds,
the operation metadata's
cancel_time
is set, the updates are reverted, and the operation terminates with a
CANCELLED
status. - New UpdateDatabase requests will return a
FAILED_PRECONDITION
error until the pending operation is done (returns successfully or with error). - Reading the database via the API continues to give the pre-request values.
Upon completion of the returned operation:
- The new values are in effect and readable via the API.
- The database's reconciling field becomes false.
The returned long-running operation will
have a name of the format
projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>
and can be used to track the database modification. The
metadata field type is
UpdateDatabaseMetadata.
The response field type is
Database, if successful.
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 727 def update_database request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_database..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.database&.name header_params["database.name"] = request.database.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_database.timeout, metadata: , retry_policy: @config.rpcs.update_database.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :update_database, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_database_ddl(request, options = nil) ⇒ ::Gapic::Operation #update_database_ddl(database: nil, statements: nil, operation_id: nil, proto_descriptors: nil) ⇒ ::Gapic::Operation
Updates the schema of a Cloud Spanner database by
creating/altering/dropping tables, columns, indexes, etc. The returned
long-running operation will have a name of
the format <database_name>/operations/<operation_id>
and can be used to
track execution of the schema change(s). The
metadata field type is
UpdateDatabaseDdlMetadata.
The operation has no response.
867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 |
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb', line 867 def update_database_ddl request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_database_ddl..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.database header_params["database"] = request.database end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_database_ddl.timeout, metadata: , retry_policy: @config.rpcs.update_database_ddl.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @database_admin_stub.call_rpc :update_database_ddl, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |