google-cloud-spanner-admin-database-v1 0.3.0 → 0.6.1

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.
@@ -562,7 +562,7 @@ module Google
562
562
  config_attr :scope, nil, ::String, ::Array, nil
563
563
  config_attr :lib_name, nil, ::String, nil
564
564
  config_attr :lib_version, nil, ::String, nil
565
- 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)
566
566
  config_attr :interceptors, nil, ::Array, nil
567
567
  config_attr :timeout, nil, ::Numeric, nil
568
568
  config_attr :metadata, nil, ::Hash, nil
@@ -583,7 +583,7 @@ module Google
583
583
  def rpcs
584
584
  @rpcs ||= begin
585
585
  parent_rpcs = nil
586
- 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)
587
587
  Rpcs.new parent_rpcs
588
588
  end
589
589
  end
@@ -634,15 +634,15 @@ module Google
634
634
 
635
635
  # @private
636
636
  def initialize parent_rpcs = nil
637
- 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
638
638
  @list_operations = ::Gapic::Config::Method.new list_operations_config
639
- 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
640
640
  @get_operation = ::Gapic::Config::Method.new get_operation_config
641
- 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
642
642
  @delete_operation = ::Gapic::Config::Method.new delete_operation_config
643
- 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
644
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
645
+ wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation
646
646
  @wait_operation = ::Gapic::Config::Method.new wait_operation_config
647
647
 
648
648
  yield self if block_given?
@@ -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.3.0"
26
+ VERSION = "0.6.1"
27
27
  end
28
28
  end
29
29
  end
@@ -21,6 +21,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
21
21
  optional :size_bytes, :int64, 5
22
22
  optional :state, :enum, 6, "google.spanner.admin.database.v1.Backup.State"
23
23
  repeated :referencing_databases, :string, 7
24
+ optional :encryption_info, :message, 8, "google.spanner.admin.database.v1.EncryptionInfo"
24
25
  end
25
26
  add_enum "google.spanner.admin.database.v1.Backup.State" do
26
27
  value :STATE_UNSPECIFIED, 0
@@ -31,6 +32,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
31
32
  optional :parent, :string, 1
32
33
  optional :backup_id, :string, 2
33
34
  optional :backup, :message, 3, "google.spanner.admin.database.v1.Backup"
35
+ optional :encryption_config, :message, 4, "google.spanner.admin.database.v1.CreateBackupEncryptionConfig"
34
36
  end
35
37
  add_message "google.spanner.admin.database.v1.CreateBackupMetadata" do
36
38
  optional :name, :string, 1
@@ -74,6 +76,16 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
74
76
  optional :create_time, :message, 2, "google.protobuf.Timestamp"
75
77
  optional :source_database, :string, 3
76
78
  end
79
+ add_message "google.spanner.admin.database.v1.CreateBackupEncryptionConfig" do
80
+ optional :encryption_type, :enum, 1, "google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType"
81
+ optional :kms_key_name, :string, 2
82
+ end
83
+ add_enum "google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType" do
84
+ value :ENCRYPTION_TYPE_UNSPECIFIED, 0
85
+ value :USE_DATABASE_ENCRYPTION, 1
86
+ value :GOOGLE_DEFAULT_ENCRYPTION, 2
87
+ value :CUSTOMER_MANAGED_ENCRYPTION, 3
88
+ end
77
89
  end
78
90
  end
79
91
 
@@ -95,6 +107,8 @@ module Google
95
107
  ListBackupOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupOperationsRequest").msgclass
96
108
  ListBackupOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupOperationsResponse").msgclass
97
109
  BackupInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.BackupInfo").msgclass
110
+ CreateBackupEncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupEncryptionConfig").msgclass
111
+ CreateBackupEncryptionConfig::EncryptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType").enummodule
98
112
  end
99
113
  end
100
114
  end
@@ -4,7 +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'
9
+ require 'google/rpc/status_pb'
8
10
  require 'google/api/annotations_pb'
9
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
12
  add_file("google/spanner/admin/database/v1/common.proto", :syntax => :proto3) do
@@ -13,6 +15,19 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
13
15
  optional :start_time, :message, 2, "google.protobuf.Timestamp"
14
16
  optional :end_time, :message, 3, "google.protobuf.Timestamp"
15
17
  end
18
+ add_message "google.spanner.admin.database.v1.EncryptionConfig" do
19
+ optional :kms_key_name, :string, 2
20
+ end
21
+ add_message "google.spanner.admin.database.v1.EncryptionInfo" do
22
+ optional :encryption_type, :enum, 3, "google.spanner.admin.database.v1.EncryptionInfo.Type"
23
+ optional :encryption_status, :message, 4, "google.rpc.Status"
24
+ optional :kms_key_version, :string, 2
25
+ end
26
+ add_enum "google.spanner.admin.database.v1.EncryptionInfo.Type" do
27
+ value :TYPE_UNSPECIFIED, 0
28
+ value :GOOGLE_DEFAULT_ENCRYPTION, 1
29
+ value :CUSTOMER_MANAGED_ENCRYPTION, 2
30
+ end
16
31
  end
17
32
  end
18
33
 
@@ -23,6 +38,9 @@ module Google
23
38
  module Database
24
39
  module V1
25
40
  OperationProgress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.OperationProgress").msgclass
41
+ EncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionConfig").msgclass
42
+ EncryptionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionInfo").msgclass
43
+ EncryptionInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.EncryptionInfo.Type").enummodule
26
44
  end
27
45
  end
28
46
  end
@@ -27,6 +27,8 @@ 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"
30
32
  optional :version_retention_period, :string, 6
31
33
  optional :earliest_version_time, :message, 7, "google.protobuf.Timestamp"
32
34
  end
@@ -49,6 +51,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
49
51
  optional :parent, :string, 1
50
52
  optional :create_statement, :string, 2
51
53
  repeated :extra_statements, :string, 3
54
+ optional :encryption_config, :message, 4, "google.spanner.admin.database.v1.EncryptionConfig"
52
55
  end
53
56
  add_message "google.spanner.admin.database.v1.CreateDatabaseMetadata" do
54
57
  optional :database, :string, 1
@@ -66,6 +69,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
66
69
  repeated :statements, :string, 2
67
70
  repeated :commit_timestamps, :message, 3, "google.protobuf.Timestamp"
68
71
  optional :throttled, :bool, 4
72
+ repeated :progress, :message, 5, "google.spanner.admin.database.v1.OperationProgress"
69
73
  end
70
74
  add_message "google.spanner.admin.database.v1.DropDatabaseRequest" do
71
75
  optional :database, :string, 1
@@ -89,10 +93,21 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
89
93
  add_message "google.spanner.admin.database.v1.RestoreDatabaseRequest" do
90
94
  optional :parent, :string, 1
91
95
  optional :database_id, :string, 2
96
+ optional :encryption_config, :message, 4, "google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig"
92
97
  oneof :source do
93
98
  optional :backup, :string, 3
94
99
  end
95
100
  end
101
+ add_message "google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig" do
102
+ optional :encryption_type, :enum, 1, "google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType"
103
+ optional :kms_key_name, :string, 2
104
+ end
105
+ add_enum "google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType" do
106
+ value :ENCRYPTION_TYPE_UNSPECIFIED, 0
107
+ value :USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION, 1
108
+ value :GOOGLE_DEFAULT_ENCRYPTION, 2
109
+ value :CUSTOMER_MANAGED_ENCRYPTION, 3
110
+ end
96
111
  add_message "google.spanner.admin.database.v1.RestoreDatabaseMetadata" do
97
112
  optional :name, :string, 1
98
113
  optional :source_type, :enum, 2, "google.spanner.admin.database.v1.RestoreSourceType"
@@ -136,6 +151,8 @@ module Google
136
151
  ListDatabaseOperationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseOperationsRequest").msgclass
137
152
  ListDatabaseOperationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseOperationsResponse").msgclass
138
153
  RestoreDatabaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseRequest").msgclass
154
+ RestoreDatabaseEncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig").msgclass
155
+ RestoreDatabaseEncryptionConfig::EncryptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType").enummodule
139
156
  RestoreDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseMetadata").msgclass
140
157
  OptimizeRestoredDatabaseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata").msgclass
141
158
  RestoreSourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreSourceType").enummodule
@@ -34,7 +34,7 @@ module Google
34
34
  # database and to restore from an existing backup.
35
35
  class Service
36
36
 
37
- include GRPC::GenericService
37
+ include ::GRPC::GenericService
38
38
 
39
39
  self.marshal_class_method = :encode
40
40
  self.unmarshal_class_method = :decode
@@ -80,6 +80,9 @@ module Google
80
80
  # any referencing database prevents the backup from being deleted. When a
81
81
  # restored database from the backup enters the `READY` state, the reference
82
82
  # to the backup is removed.
83
+ # @!attribute [r] encryption_info
84
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo]
85
+ # Output only. The encryption information for the backup.
83
86
  class Backup
84
87
  include ::Google::Protobuf::MessageExts
85
88
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -115,6 +118,13 @@ module Google
115
118
  # @!attribute [rw] backup
116
119
  # @return [::Google::Cloud::Spanner::Admin::Database::V1::Backup]
117
120
  # Required. The backup to create.
121
+ # @!attribute [rw] encryption_config
122
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig]
123
+ # Optional. The encryption configuration used to encrypt the backup. If this field is
124
+ # not specified, the backup will use the same
125
+ # encryption configuration as the database by default, namely
126
+ # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig#encryption_type encryption_type} =
127
+ # `USE_DATABASE_ENCRYPTION`.
118
128
  class CreateBackupRequest
119
129
  include ::Google::Protobuf::MessageExts
120
130
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -143,7 +153,8 @@ module Google
143
153
  # other methods to check whether the cancellation succeeded or whether the
144
154
  # operation completed despite cancellation. On successful cancellation,
145
155
  # the operation is not deleted; instead, it becomes an operation with
146
- # an [Operation.error][] value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
156
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
157
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
147
158
  # corresponding to `Code.CANCELLED`.
148
159
  class CreateBackupMetadata
149
160
  include ::Google::Protobuf::MessageExts
@@ -211,8 +222,9 @@ module Google
211
222
  # * `name`
212
223
  # * `database`
213
224
  # * `state`
214
- # * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
215
- # * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
225
+ # * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
226
+ # * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
227
+ # * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
216
228
  # * `size_bytes`
217
229
  #
218
230
  # You can combine multiple expressions by enclosing each expression in
@@ -368,6 +380,42 @@ module Google
368
380
  include ::Google::Protobuf::MessageExts
369
381
  extend ::Google::Protobuf::MessageExts::ClassMethods
370
382
  end
383
+
384
+ # Encryption configuration for the backup to create.
385
+ # @!attribute [rw] encryption_type
386
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig::EncryptionType]
387
+ # Required. The encryption type of the backup.
388
+ # @!attribute [rw] kms_key_name
389
+ # @return [::String]
390
+ # Optional. The Cloud KMS key that will be used to protect the backup.
391
+ # This field should be set only when
392
+ # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig#encryption_type encryption_type} is
393
+ # `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
394
+ # `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
395
+ class CreateBackupEncryptionConfig
396
+ include ::Google::Protobuf::MessageExts
397
+ extend ::Google::Protobuf::MessageExts::ClassMethods
398
+
399
+ # Encryption types for the backup.
400
+ module EncryptionType
401
+ # Unspecified. Do not use.
402
+ ENCRYPTION_TYPE_UNSPECIFIED = 0
403
+
404
+ # Use the same encryption configuration as the database. This is the
405
+ # default option when
406
+ # {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupEncryptionConfig encryption_config} is empty.
407
+ # For example, if the database is using `Customer_Managed_Encryption`, the
408
+ # backup will be using the same Cloud KMS key as the database.
409
+ USE_DATABASE_ENCRYPTION = 1
410
+
411
+ # Use Google default encryption.
412
+ GOOGLE_DEFAULT_ENCRYPTION = 2
413
+
414
+ # Use customer managed encryption. If specified, `kms_key_name`
415
+ # must contain a valid Cloud KMS key.
416
+ CUSTOMER_MANAGED_ENCRYPTION = 3
417
+ end
418
+ end
371
419
  end
372
420
  end
373
421
  end
@@ -40,6 +40,51 @@ module Google
40
40
  include ::Google::Protobuf::MessageExts
41
41
  extend ::Google::Protobuf::MessageExts::ClassMethods
42
42
  end
43
+
44
+ # Encryption configuration for a Cloud Spanner database.
45
+ # @!attribute [rw] kms_key_name
46
+ # @return [::String]
47
+ # The Cloud KMS key to be used for encrypting and decrypting
48
+ # the database. Values are of the form
49
+ # `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
50
+ class EncryptionConfig
51
+ include ::Google::Protobuf::MessageExts
52
+ extend ::Google::Protobuf::MessageExts::ClassMethods
53
+ end
54
+
55
+ # Encryption information for a Cloud Spanner database or backup.
56
+ # @!attribute [r] encryption_type
57
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo::Type]
58
+ # Output only. The type of encryption.
59
+ # @!attribute [r] encryption_status
60
+ # @return [::Google::Rpc::Status]
61
+ # Output only. If present, the status of a recent encrypt/decrypt call on underlying data
62
+ # for this database or backup. Regardless of status, data is always encrypted
63
+ # at rest.
64
+ # @!attribute [r] kms_key_version
65
+ # @return [::String]
66
+ # Output only. A Cloud KMS key version that is being used to protect the database or
67
+ # backup.
68
+ class EncryptionInfo
69
+ include ::Google::Protobuf::MessageExts
70
+ extend ::Google::Protobuf::MessageExts::ClassMethods
71
+
72
+ # Possible encryption types.
73
+ module Type
74
+ # Encryption type was not specified, though data at rest remains encrypted.
75
+ TYPE_UNSPECIFIED = 0
76
+
77
+ # The data is encrypted at rest with a key that is
78
+ # fully managed by Google. No key version or status will be populated.
79
+ # This is the default state.
80
+ GOOGLE_DEFAULT_ENCRYPTION = 1
81
+
82
+ # The data is encrypted at rest with a key that is
83
+ # managed by the customer. The active version of the key. `kms_key_version`
84
+ # will be populated, and `encryption_status` may be populated.
85
+ CUSTOMER_MANAGED_ENCRYPTION = 2
86
+ end
87
+ end
43
88
  end
44
89
  end
45
90
  end
@@ -54,6 +54,23 @@ module Google
54
54
  # @return [::Google::Cloud::Spanner::Admin::Database::V1::RestoreInfo]
55
55
  # Output only. Applicable only for restored databases. Contains information
56
56
  # about the restore source.
57
+ # @!attribute [r] encryption_config
58
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig]
59
+ # Output only. For databases that are using customer managed encryption, this
60
+ # field contains the encryption configuration for the database.
61
+ # For databases that are using Google default or other types of encryption,
62
+ # this field is empty.
63
+ # @!attribute [r] encryption_info
64
+ # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo>]
65
+ # Output only. For databases that are using customer managed encryption, this
66
+ # field contains the encryption information for the database, such as
67
+ # encryption state and the Cloud KMS key versions that are in use.
68
+ #
69
+ # For databases that are using Google default or other types of encryption,
70
+ # this field is empty.
71
+ #
72
+ # This field is propagated lazily from the backend. There might be a delay
73
+ # from when a key version is being used and when it appears in this field.
57
74
  # @!attribute [r] version_retention_period
58
75
  # @return [::String]
59
76
  # Output only. The period in which Cloud Spanner retains all versions of data
@@ -64,7 +81,10 @@ module Google
64
81
  # @!attribute [r] earliest_version_time
65
82
  # @return [::Google::Protobuf::Timestamp]
66
83
  # Output only. Earliest timestamp at which older versions of the data can be
67
- # read.
84
+ # read. This value is continuously updated by Cloud Spanner and becomes stale
85
+ # the moment it is queried. If you are using this value to recover data, make
86
+ # sure to account for the time from the moment when the value is queried to
87
+ # the moment when you initiate the recovery.
68
88
  class Database
69
89
  include ::Google::Protobuf::MessageExts
70
90
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -144,6 +164,11 @@ module Google
144
164
  # database. Statements can create tables, indexes, etc. These
145
165
  # statements execute atomically with the creation of the database:
146
166
  # if there is an error in any statement, the database is not created.
167
+ # @!attribute [rw] encryption_config
168
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig]
169
+ # Optional. The encryption configuration for the database. If this field is not
170
+ # specified, Cloud Spanner will encrypt/decrypt all data at rest using
171
+ # Google default encryption.
147
172
  class CreateDatabaseRequest
148
173
  include ::Google::Protobuf::MessageExts
149
174
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -236,6 +261,16 @@ module Google
236
261
  # Output only. When true, indicates that the operation is throttled e.g
237
262
  # due to resource constraints. When resources become available the operation
238
263
  # will resume and this field will be false again.
264
+ # @!attribute [rw] progress
265
+ # @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::OperationProgress>]
266
+ # The progress of the
267
+ # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl} operations.
268
+ # Currently, only index creation statements will have a continuously
269
+ # updating progress.
270
+ # For non-index creation statements, `progress[i]` will have start time
271
+ # and end time populated with commit timestamp of operation,
272
+ # as well as a progress of 100% once the operation has completed.
273
+ # `progress[i]` is the operation progress for `statements[i]`.
239
274
  class UpdateDatabaseDdlMetadata
240
275
  include ::Google::Protobuf::MessageExts
241
276
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -372,11 +407,52 @@ module Google
372
407
  # @return [::String]
373
408
  # Name of the backup from which to restore. Values are of the form
374
409
  # `projects/<project>/instances/<instance>/backups/<backup>`.
410
+ # @!attribute [rw] encryption_config
411
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig]
412
+ # Optional. An encryption configuration describing the encryption type and key
413
+ # resources in Cloud KMS used to encrypt/decrypt the database to restore to.
414
+ # If this field is not specified, the restored database will use
415
+ # the same encryption configuration as the backup by default, namely
416
+ # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig#encryption_type encryption_type} =
417
+ # `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
375
418
  class RestoreDatabaseRequest
376
419
  include ::Google::Protobuf::MessageExts
377
420
  extend ::Google::Protobuf::MessageExts::ClassMethods
378
421
  end
379
422
 
423
+ # Encryption configuration for the restored database.
424
+ # @!attribute [rw] encryption_type
425
+ # @return [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig::EncryptionType]
426
+ # Required. The encryption type of the restored database.
427
+ # @!attribute [rw] kms_key_name
428
+ # @return [::String]
429
+ # Optional. The Cloud KMS key that will be used to encrypt/decrypt the restored
430
+ # database. This field should be set only when
431
+ # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig#encryption_type encryption_type} is
432
+ # `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
433
+ # `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
434
+ class RestoreDatabaseEncryptionConfig
435
+ include ::Google::Protobuf::MessageExts
436
+ extend ::Google::Protobuf::MessageExts::ClassMethods
437
+
438
+ # Encryption types for the database to be restored.
439
+ module EncryptionType
440
+ # Unspecified. Do not use.
441
+ ENCRYPTION_TYPE_UNSPECIFIED = 0
442
+
443
+ # This is the default option when
444
+ # {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig encryption_config} is not specified.
445
+ USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1
446
+
447
+ # Use Google default encryption.
448
+ GOOGLE_DEFAULT_ENCRYPTION = 2
449
+
450
+ # Use customer managed encryption. If specified, `kms_key_name` must
451
+ # must contain a valid Cloud KMS key.
452
+ CUSTOMER_MANAGED_ENCRYPTION = 3
453
+ end
454
+ end
455
+
380
456
  # Metadata type for the long-running operation returned by
381
457
  # {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#restore_database RestoreDatabase}.
382
458
  # @!attribute [rw] name