google-cloud-spanner-admin-database-v1 0.1.3 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -105,8 +105,13 @@ module Google
105
105
  # Lists operations that match the specified filter in the request. If the
106
106
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
107
107
  #
108
- # NOTE: the `name` binding below allows API services to override the binding
109
- # to use different resource name schemes, such as `users/*/operations`.
108
+ # NOTE: the `name` binding allows API services to override the binding
109
+ # to use different resource name schemes, such as `users/*/operations`. To
110
+ # override the binding, API services can add a binding such as
111
+ # `"/v1/{name=users/*}/operations"` to their service configuration.
112
+ # For backwards compatibility, the default name includes the operations
113
+ # collection id, however overriding users must ensure the name binding
114
+ # is the parent resource, without the operations collection id.
110
115
  #
111
116
  # @overload list_operations(request, options = nil)
112
117
  # Pass arguments to `list_operations` via a request object, either of type
@@ -124,7 +129,7 @@ module Google
124
129
  # the default parameter values, pass an empty Hash as a request object (see above).
125
130
  #
126
131
  # @param name [::String]
127
- # The name of the operation collection.
132
+ # The name of the operation's parent resource.
128
133
  # @param filter [::String]
129
134
  # The standard list filter.
130
135
  # @param page_size [::Integer]
@@ -392,6 +397,79 @@ module Google
392
397
  raise ::Google::Cloud::Error.from_error(e)
393
398
  end
394
399
 
400
+ ##
401
+ # Waits for the specified long-running operation until it is done or reaches
402
+ # at most a specified timeout, returning the latest state. If the operation
403
+ # is already done, the latest state is immediately returned. If the timeout
404
+ # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
405
+ # timeout is used. If the server does not support this method, it returns
406
+ # `google.rpc.Code.UNIMPLEMENTED`.
407
+ # Note that this method is on a best-effort basis. It may return the latest
408
+ # state before the specified timeout (including immediately), meaning even an
409
+ # immediate response is no guarantee that the operation is done.
410
+ #
411
+ # @overload wait_operation(request, options = nil)
412
+ # Pass arguments to `wait_operation` via a request object, either of type
413
+ # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash.
414
+ #
415
+ # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash]
416
+ # A request object representing the call parameters. Required. To specify no
417
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
418
+ # @param options [::Gapic::CallOptions, ::Hash]
419
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
420
+ #
421
+ # @overload wait_operation(name: nil, timeout: nil)
422
+ # Pass arguments to `wait_operation` via keyword arguments. Note that at
423
+ # least one keyword argument is required. To specify no parameters, or to keep all
424
+ # the default parameter values, pass an empty Hash as a request object (see above).
425
+ #
426
+ # @param name [::String]
427
+ # The name of the operation resource to wait on.
428
+ # @param timeout [::Google::Protobuf::Duration, ::Hash]
429
+ # The maximum duration to wait before timing out. If left blank, the wait
430
+ # will be at most the time permitted by the underlying HTTP/RPC protocol.
431
+ # If RPC context deadline is also specified, the shorter one will be used.
432
+ #
433
+ # @yield [response, operation] Access the result along with the RPC operation
434
+ # @yieldparam response [::Gapic::Operation]
435
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
436
+ #
437
+ # @return [::Gapic::Operation]
438
+ #
439
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
440
+ #
441
+ def wait_operation request, options = nil
442
+ raise ::ArgumentError, "request must be provided" if request.nil?
443
+
444
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest
445
+
446
+ # Converts hash and nil to an options object
447
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
448
+
449
+ # Customize the options with defaults
450
+ metadata = @config.rpcs.wait_operation.metadata.to_h
451
+
452
+ # Set x-goog-api-client and x-goog-user-project headers
453
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
454
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
455
+ gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION
456
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
457
+
458
+ options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
459
+ metadata: metadata,
460
+ retry_policy: @config.rpcs.wait_operation.retry_policy
461
+ options.apply_defaults metadata: @config.metadata,
462
+ retry_policy: @config.retry_policy
463
+
464
+ @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
465
+ response = ::Gapic::Operation.new response, @operations_client, options: options
466
+ yield response, operation if block_given?
467
+ return response
468
+ end
469
+ rescue ::GRPC::BadStatus => e
470
+ raise ::Google::Cloud::Error.from_error(e)
471
+ end
472
+
395
473
  ##
396
474
  # Configuration class for the Operations API.
397
475
  #
@@ -484,7 +562,7 @@ module Google
484
562
  config_attr :scope, nil, ::String, ::Array, nil
485
563
  config_attr :lib_name, nil, ::String, nil
486
564
  config_attr :lib_version, nil, ::String, nil
487
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
565
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
488
566
  config_attr :interceptors, nil, ::Array, nil
489
567
  config_attr :timeout, nil, ::Numeric, nil
490
568
  config_attr :metadata, nil, ::Hash, nil
@@ -505,7 +583,7 @@ module Google
505
583
  def rpcs
506
584
  @rpcs ||= begin
507
585
  parent_rpcs = nil
508
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
586
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
509
587
  Rpcs.new parent_rpcs
510
588
  end
511
589
  end
@@ -517,7 +595,7 @@ module Google
517
595
  # Each configuration object is of type `Gapic::Config::Method` and includes
518
596
  # the following configuration fields:
519
597
  #
520
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
598
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
521
599
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
522
600
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
523
601
  # include the following keys:
@@ -548,17 +626,24 @@ module Google
548
626
  # @return [::Gapic::Config::Method]
549
627
  #
550
628
  attr_reader :cancel_operation
629
+ ##
630
+ # RPC-specific configuration for `wait_operation`
631
+ # @return [::Gapic::Config::Method]
632
+ #
633
+ attr_reader :wait_operation
551
634
 
552
635
  # @private
553
636
  def initialize parent_rpcs = nil
554
- list_operations_config = parent_rpcs&.list_operations if parent_rpcs&.respond_to? :list_operations
637
+ list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
555
638
  @list_operations = ::Gapic::Config::Method.new list_operations_config
556
- get_operation_config = parent_rpcs&.get_operation if parent_rpcs&.respond_to? :get_operation
639
+ get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
557
640
  @get_operation = ::Gapic::Config::Method.new get_operation_config
558
- delete_operation_config = parent_rpcs&.delete_operation if parent_rpcs&.respond_to? :delete_operation
641
+ delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
559
642
  @delete_operation = ::Gapic::Config::Method.new delete_operation_config
560
- cancel_operation_config = parent_rpcs&.cancel_operation if parent_rpcs&.respond_to? :cancel_operation
643
+ cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
561
644
  @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
645
+ wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation
646
+ @wait_operation = ::Gapic::Config::Method.new wait_operation_config
562
647
 
563
648
  yield self if block_given?
564
649
  end
@@ -45,6 +45,50 @@ module Google
45
45
  "projects/#{project}/instances/#{instance}/backups/#{backup}"
46
46
  end
47
47
 
48
+ ##
49
+ # Create a fully-qualified CryptoKey resource string.
50
+ #
51
+ # The resource will be in the following format:
52
+ #
53
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`
54
+ #
55
+ # @param project [String]
56
+ # @param location [String]
57
+ # @param key_ring [String]
58
+ # @param crypto_key [String]
59
+ #
60
+ # @return [::String]
61
+ def crypto_key_path project:, location:, key_ring:, crypto_key:
62
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
63
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
64
+ raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/"
65
+
66
+ "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}"
67
+ end
68
+
69
+ ##
70
+ # Create a fully-qualified CryptoKeyVersion resource string.
71
+ #
72
+ # The resource will be in the following format:
73
+ #
74
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`
75
+ #
76
+ # @param project [String]
77
+ # @param location [String]
78
+ # @param key_ring [String]
79
+ # @param crypto_key [String]
80
+ # @param crypto_key_version [String]
81
+ #
82
+ # @return [::String]
83
+ def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version:
84
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
85
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
86
+ raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/"
87
+ raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/"
88
+
89
+ "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}"
90
+ end
91
+
48
92
  ##
49
93
  # Create a fully-qualified Database resource string.
50
94
  #
@@ -23,7 +23,7 @@ module Google
23
23
  module Admin
24
24
  module Database
25
25
  module V1
26
- VERSION = "0.1.3"
26
+ VERSION = "0.5.0"
27
27
  end
28
28
  end
29
29
  end
@@ -9,17 +9,18 @@ require 'google/longrunning/operations_pb'
9
9
  require 'google/protobuf/field_mask_pb'
10
10
  require 'google/protobuf/timestamp_pb'
11
11
  require 'google/spanner/admin/database/v1/common_pb'
12
- require 'google/api/annotations_pb'
13
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
14
13
  add_file("google/spanner/admin/database/v1/backup.proto", :syntax => :proto3) do
15
14
  add_message "google.spanner.admin.database.v1.Backup" do
16
15
  optional :database, :string, 2
16
+ optional :version_time, :message, 9, "google.protobuf.Timestamp"
17
17
  optional :expire_time, :message, 3, "google.protobuf.Timestamp"
18
18
  optional :name, :string, 1
19
19
  optional :create_time, :message, 4, "google.protobuf.Timestamp"
20
20
  optional :size_bytes, :int64, 5
21
21
  optional :state, :enum, 6, "google.spanner.admin.database.v1.Backup.State"
22
22
  repeated :referencing_databases, :string, 7
23
+ optional :encryption_info, :message, 8, "google.spanner.admin.database.v1.EncryptionInfo"
23
24
  end
24
25
  add_enum "google.spanner.admin.database.v1.Backup.State" do
25
26
  value :STATE_UNSPECIFIED, 0
@@ -30,6 +31,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
30
31
  optional :parent, :string, 1
31
32
  optional :backup_id, :string, 2
32
33
  optional :backup, :message, 3, "google.spanner.admin.database.v1.Backup"
34
+ optional :encryption_config, :message, 4, "google.spanner.admin.database.v1.CreateBackupEncryptionConfig"
33
35
  end
34
36
  add_message "google.spanner.admin.database.v1.CreateBackupMetadata" do
35
37
  optional :name, :string, 1
@@ -69,9 +71,20 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
69
71
  end
70
72
  add_message "google.spanner.admin.database.v1.BackupInfo" do
71
73
  optional :backup, :string, 1
74
+ optional :version_time, :message, 4, "google.protobuf.Timestamp"
72
75
  optional :create_time, :message, 2, "google.protobuf.Timestamp"
73
76
  optional :source_database, :string, 3
74
77
  end
78
+ add_message "google.spanner.admin.database.v1.CreateBackupEncryptionConfig" do
79
+ optional :encryption_type, :enum, 1, "google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType"
80
+ optional :kms_key_name, :string, 2
81
+ end
82
+ add_enum "google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType" do
83
+ value :ENCRYPTION_TYPE_UNSPECIFIED, 0
84
+ value :USE_DATABASE_ENCRYPTION, 1
85
+ value :GOOGLE_DEFAULT_ENCRYPTION, 2
86
+ value :CUSTOMER_MANAGED_ENCRYPTION, 3
87
+ end
75
88
  end
76
89
  end
77
90
 
@@ -93,6 +106,8 @@ module Google
93
106
  ListBackupOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupOperationsRequest").msgclass
94
107
  ListBackupOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupOperationsResponse").msgclass
95
108
  BackupInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.BackupInfo").msgclass
109
+ CreateBackupEncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupEncryptionConfig").msgclass
110
+ CreateBackupEncryptionConfig::EncryptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType").enummodule
96
111
  end
97
112
  end
98
113
  end
@@ -4,8 +4,9 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  require 'google/api/field_behavior_pb'
7
+ require 'google/api/resource_pb'
7
8
  require 'google/protobuf/timestamp_pb'
8
- require 'google/api/annotations_pb'
9
+ require 'google/rpc/status_pb'
9
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
11
  add_file("google/spanner/admin/database/v1/common.proto", :syntax => :proto3) do
11
12
  add_message "google.spanner.admin.database.v1.OperationProgress" do
@@ -13,6 +14,19 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
13
14
  optional :start_time, :message, 2, "google.protobuf.Timestamp"
14
15
  optional :end_time, :message, 3, "google.protobuf.Timestamp"
15
16
  end
17
+ add_message "google.spanner.admin.database.v1.EncryptionConfig" do
18
+ optional :kms_key_name, :string, 2
19
+ end
20
+ add_message "google.spanner.admin.database.v1.EncryptionInfo" do
21
+ optional :encryption_type, :enum, 3, "google.spanner.admin.database.v1.EncryptionInfo.Type"
22
+ optional :encryption_status, :message, 4, "google.rpc.Status"
23
+ optional :kms_key_version, :string, 2
24
+ end
25
+ add_enum "google.spanner.admin.database.v1.EncryptionInfo.Type" do
26
+ value :TYPE_UNSPECIFIED, 0
27
+ value :GOOGLE_DEFAULT_ENCRYPTION, 1
28
+ value :CUSTOMER_MANAGED_ENCRYPTION, 2
29
+ end
16
30
  end
17
31
  end
18
32
 
@@ -23,6 +37,9 @@ module Google
23
37
  module Database
24
38
  module V1
25
39
  OperationProgress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.OperationProgress").msgclass
40
+ EncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionConfig").msgclass
41
+ EncryptionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionInfo").msgclass
42
+ EncryptionInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionInfo.Type").enummodule
26
43
  end
27
44
  end
28
45
  end
@@ -27,6 +27,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
27
27
  optional :state, :enum, 2, "google.spanner.admin.database.v1.Database.State"
28
28
  optional :create_time, :message, 3, "google.protobuf.Timestamp"
29
29
  optional :restore_info, :message, 4, "google.spanner.admin.database.v1.RestoreInfo"
30
+ optional :encryption_config, :message, 5, "google.spanner.admin.database.v1.EncryptionConfig"
31
+ repeated :encryption_info, :message, 8, "google.spanner.admin.database.v1.EncryptionInfo"
32
+ optional :version_retention_period, :string, 6
33
+ optional :earliest_version_time, :message, 7, "google.protobuf.Timestamp"
30
34
  end
31
35
  add_enum "google.spanner.admin.database.v1.Database.State" do
32
36
  value :STATE_UNSPECIFIED, 0
@@ -47,6 +51,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
47
51
  optional :parent, :string, 1
48
52
  optional :create_statement, :string, 2
49
53
  repeated :extra_statements, :string, 3
54
+ optional :encryption_config, :message, 4, "google.spanner.admin.database.v1.EncryptionConfig"
50
55
  end
51
56
  add_message "google.spanner.admin.database.v1.CreateDatabaseMetadata" do
52
57
  optional :database, :string, 1
@@ -63,6 +68,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
63
68
  optional :database, :string, 1
64
69
  repeated :statements, :string, 2
65
70
  repeated :commit_timestamps, :message, 3, "google.protobuf.Timestamp"
71
+ optional :throttled, :bool, 4
66
72
  end
67
73
  add_message "google.spanner.admin.database.v1.DropDatabaseRequest" do
68
74
  optional :database, :string, 1
@@ -86,10 +92,21 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
86
92
  add_message "google.spanner.admin.database.v1.RestoreDatabaseRequest" do
87
93
  optional :parent, :string, 1
88
94
  optional :database_id, :string, 2
95
+ optional :encryption_config, :message, 4, "google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig"
89
96
  oneof :source do
90
97
  optional :backup, :string, 3
91
98
  end
92
99
  end
100
+ add_message "google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig" do
101
+ optional :encryption_type, :enum, 1, "google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType"
102
+ optional :kms_key_name, :string, 2
103
+ end
104
+ add_enum "google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType" do
105
+ value :ENCRYPTION_TYPE_UNSPECIFIED, 0
106
+ value :USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION, 1
107
+ value :GOOGLE_DEFAULT_ENCRYPTION, 2
108
+ value :CUSTOMER_MANAGED_ENCRYPTION, 3
109
+ end
93
110
  add_message "google.spanner.admin.database.v1.RestoreDatabaseMetadata" do
94
111
  optional :name, :string, 1
95
112
  optional :source_type, :enum, 2, "google.spanner.admin.database.v1.RestoreSourceType"
@@ -133,6 +150,8 @@ module Google
133
150
  ListDatabaseOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseOperationsRequest").msgclass
134
151
  ListDatabaseOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseOperationsResponse").msgclass
135
152
  RestoreDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseRequest").msgclass
153
+ RestoreDatabaseEncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig").msgclass
154
+ RestoreDatabaseEncryptionConfig::EncryptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType").enummodule
136
155
  RestoreDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseMetadata").msgclass
137
156
  OptimizeRestoredDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata").msgclass
138
157
  RestoreSourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreSourceType").enummodule
@@ -41,34 +41,35 @@ module Google
41
41
  self.service_name = 'google.spanner.admin.database.v1.DatabaseAdmin'
42
42
 
43
43
  # Lists Cloud Spanner databases.
44
- rpc :ListDatabases, Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest, Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse
44
+ rpc :ListDatabases, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse
45
45
  # Creates a new Cloud Spanner database and starts to prepare it for serving.
46
46
  # The returned [long-running operation][google.longrunning.Operation] will
47
47
  # have a name of the format `<database_name>/operations/<operation_id>` and
48
48
  # can be used to track preparation of the database. The
49
49
  # [metadata][google.longrunning.Operation.metadata] field type is
50
- # [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
51
- # [response][google.longrunning.Operation.response] field type is
50
+ # [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata].
51
+ # The [response][google.longrunning.Operation.response] field type is
52
52
  # [Database][google.spanner.admin.database.v1.Database], if successful.
53
- rpc :CreateDatabase, Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest, Google::Longrunning::Operation
53
+ rpc :CreateDatabase, ::Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest, ::Google::Longrunning::Operation
54
54
  # Gets the state of a Cloud Spanner database.
55
- rpc :GetDatabase, Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest, Google::Cloud::Spanner::Admin::Database::V1::Database
55
+ rpc :GetDatabase, ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest, ::Google::Cloud::Spanner::Admin::Database::V1::Database
56
56
  # Updates the schema of a Cloud Spanner database by
57
57
  # creating/altering/dropping tables, columns, indexes, etc. The returned
58
58
  # [long-running operation][google.longrunning.Operation] will have a name of
59
59
  # the format `<database_name>/operations/<operation_id>` and can be used to
60
60
  # track execution of the schema change(s). The
61
61
  # [metadata][google.longrunning.Operation.metadata] field type is
62
- # [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response.
63
- rpc :UpdateDatabaseDdl, Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest, Google::Longrunning::Operation
62
+ # [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata].
63
+ # The operation has no response.
64
+ rpc :UpdateDatabaseDdl, ::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest, ::Google::Longrunning::Operation
64
65
  # Drops (aka deletes) a Cloud Spanner database.
65
66
  # Completed backups for the database will be retained according to their
66
67
  # `expire_time`.
67
- rpc :DropDatabase, Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest, Google::Protobuf::Empty
68
+ rpc :DropDatabase, ::Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest, ::Google::Protobuf::Empty
68
69
  # Returns the schema of a Cloud Spanner database as a list of formatted
69
70
  # DDL statements. This method does not show pending schema updates, those may
70
71
  # be queried using the [Operations][google.longrunning.Operations] API.
71
- rpc :GetDatabaseDdl, Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest, Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse
72
+ rpc :GetDatabaseDdl, ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest, ::Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse
72
73
  # Sets the access control policy on a database or backup resource.
73
74
  # Replaces any existing policy.
74
75
  #
@@ -76,7 +77,7 @@ module Google
76
77
  # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
77
78
  # For backups, authorization requires `spanner.backups.setIamPolicy`
78
79
  # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
79
- rpc :SetIamPolicy, Google::Iam::V1::SetIamPolicyRequest, Google::Iam::V1::Policy
80
+ rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy
80
81
  # Gets the access control policy for a database or backup resource.
81
82
  # Returns an empty policy if a database or backup exists but does not have a
82
83
  # policy set.
@@ -85,7 +86,7 @@ module Google
85
86
  # [resource][google.iam.v1.GetIamPolicyRequest.resource].
86
87
  # For backups, authorization requires `spanner.backups.getIamPolicy`
87
88
  # permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
88
- rpc :GetIamPolicy, Google::Iam::V1::GetIamPolicyRequest, Google::Iam::V1::Policy
89
+ rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy
89
90
  # Returns permissions that the caller has on the specified database or backup
90
91
  # resource.
91
92
  #
@@ -96,30 +97,33 @@ module Google
96
97
  # Calling this method on a backup that does not exist will
97
98
  # result in a NOT_FOUND error if the user has
98
99
  # `spanner.backups.list` permission on the containing instance.
99
- rpc :TestIamPermissions, Google::Iam::V1::TestIamPermissionsRequest, Google::Iam::V1::TestIamPermissionsResponse
100
+ rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse
100
101
  # Starts creating a new Cloud Spanner Backup.
101
102
  # The returned backup [long-running operation][google.longrunning.Operation]
102
103
  # will have a name of the format
103
104
  # `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
104
105
  # and can be used to track creation of the backup. The
105
106
  # [metadata][google.longrunning.Operation.metadata] field type is
106
- # [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
107
- # [response][google.longrunning.Operation.response] field type is
108
- # [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
109
- # creation and delete the backup.
110
- # There can be only one pending backup creation per database. Backup creation
111
- # of different databases can run concurrently.
112
- rpc :CreateBackup, Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest, Google::Longrunning::Operation
113
- # Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
114
- rpc :GetBackup, Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest, Google::Cloud::Spanner::Admin::Database::V1::Backup
115
- # Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
116
- rpc :UpdateBackup, Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest, Google::Cloud::Spanner::Admin::Database::V1::Backup
117
- # Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
118
- rpc :DeleteBackup, Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest, Google::Protobuf::Empty
107
+ # [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
108
+ # The [response][google.longrunning.Operation.response] field type is
109
+ # [Backup][google.spanner.admin.database.v1.Backup], if successful.
110
+ # Cancelling the returned operation will stop the creation and delete the
111
+ # backup. There can be only one pending backup creation per database. Backup
112
+ # creation of different databases can run concurrently.
113
+ rpc :CreateBackup, ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest, ::Google::Longrunning::Operation
114
+ # Gets metadata on a pending or completed
115
+ # [Backup][google.spanner.admin.database.v1.Backup].
116
+ rpc :GetBackup, ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest, ::Google::Cloud::Spanner::Admin::Database::V1::Backup
117
+ # Updates a pending or completed
118
+ # [Backup][google.spanner.admin.database.v1.Backup].
119
+ rpc :UpdateBackup, ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest, ::Google::Cloud::Spanner::Admin::Database::V1::Backup
120
+ # Deletes a pending or completed
121
+ # [Backup][google.spanner.admin.database.v1.Backup].
122
+ rpc :DeleteBackup, ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest, ::Google::Protobuf::Empty
119
123
  # Lists completed and pending backups.
120
124
  # Backups returned are ordered by `create_time` in descending order,
121
125
  # starting from the most recent `create_time`.
122
- rpc :ListBackups, Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest, Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse
126
+ rpc :ListBackups, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse
123
127
  # Create a new database by restoring from a completed backup. The new
124
128
  # database must be in the same project and in an instance with the same
125
129
  # instance configuration as the instance containing
@@ -137,7 +141,7 @@ module Google
137
141
  # Once the restore operation completes, a new restore operation can be
138
142
  # initiated, without waiting for the optimize operation associated with the
139
143
  # first restore to complete.
140
- rpc :RestoreDatabase, Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest, Google::Longrunning::Operation
144
+ rpc :RestoreDatabase, ::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest, ::Google::Longrunning::Operation
141
145
  # Lists database [longrunning-operations][google.longrunning.Operation].
142
146
  # A database operation has a name of the form
143
147
  # `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
@@ -146,7 +150,7 @@ module Google
146
150
  # `metadata.type_url` describes the type of the metadata. Operations returned
147
151
  # include those that have completed/failed/canceled within the last 7 days,
148
152
  # and pending operations.
149
- rpc :ListDatabaseOperations, Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest, Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse
153
+ rpc :ListDatabaseOperations, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse
150
154
  # Lists the backup [long-running operations][google.longrunning.Operation] in
151
155
  # the given instance. A backup operation has a name of the form
152
156
  # `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`.
@@ -157,7 +161,7 @@ module Google
157
161
  # and pending operations. Operations returned are ordered by
158
162
  # `operation.metadata.value.progress.start_time` in descending order starting
159
163
  # from the most recently started operation.
160
- rpc :ListBackupOperations, Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest, Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse
164
+ rpc :ListBackupOperations, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest, ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse
161
165
  end
162
166
 
163
167
  Stub = Service.rpc_stub_class