google-cloud-spanner-admin-database-v1 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +188 -190
- data/lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb +73 -37
- data/lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb +44 -0
- data/lib/google/cloud/spanner/admin/database/v1/version.rb +1 -1
- data/lib/google/spanner/admin/database/v1/backup_pb.rb +14 -1
- data/lib/google/spanner/admin/database/v1/common_pb.rb +18 -1
- data/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb +16 -0
- data/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb +16 -12
- data/proto_docs/google/spanner/admin/database/v1/backup.rb +107 -38
- data/proto_docs/google/spanner/admin/database/v1/common.rb +45 -0
- data/proto_docs/google/spanner/admin/database/v1/spanner_database_admin.rb +113 -31
- metadata +2 -2
@@ -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
|
62
|
+
# underlying data for this database or backup. Regardless of status, data is
|
63
|
+
# always encrypted 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
|
67
|
+
# database or 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,17 +54,37 @@ 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
|
60
77
|
# for the database. This is the same as the value of version_retention_period
|
61
78
|
# database option set using
|
62
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl}.
|
63
|
-
# if not set.
|
79
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl}.
|
80
|
+
# Defaults to 1 hour, if not set.
|
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
|
@@ -93,7 +113,8 @@ module Google
|
|
93
113
|
end
|
94
114
|
end
|
95
115
|
|
96
|
-
# The request for
|
116
|
+
# The request for
|
117
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases ListDatabases}.
|
97
118
|
# @!attribute [rw] parent
|
98
119
|
# @return [::String]
|
99
120
|
# Required. The instance whose databases should be listed.
|
@@ -105,28 +126,31 @@ module Google
|
|
105
126
|
# @!attribute [rw] page_token
|
106
127
|
# @return [::String]
|
107
128
|
# If non-empty, `page_token` should contain a
|
108
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse#next_page_token next_page_token}
|
109
|
-
#
|
129
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse#next_page_token next_page_token}
|
130
|
+
# from a previous
|
131
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse ListDatabasesResponse}.
|
110
132
|
class ListDatabasesRequest
|
111
133
|
include ::Google::Protobuf::MessageExts
|
112
134
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
113
135
|
end
|
114
136
|
|
115
|
-
# The response for
|
137
|
+
# The response for
|
138
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases ListDatabases}.
|
116
139
|
# @!attribute [rw] databases
|
117
140
|
# @return [::Array<::Google::Cloud::Spanner::Admin::Database::V1::Database>]
|
118
141
|
# Databases that matched the request.
|
119
142
|
# @!attribute [rw] next_page_token
|
120
143
|
# @return [::String]
|
121
144
|
# `next_page_token` can be sent in a subsequent
|
122
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases ListDatabases}
|
123
|
-
# of the matching databases.
|
145
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases ListDatabases}
|
146
|
+
# call to fetch more of the matching databases.
|
124
147
|
class ListDatabasesResponse
|
125
148
|
include ::Google::Protobuf::MessageExts
|
126
149
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
127
150
|
end
|
128
151
|
|
129
|
-
# The request for
|
152
|
+
# The request for
|
153
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_database CreateDatabase}.
|
130
154
|
# @!attribute [rw] parent
|
131
155
|
# @return [::String]
|
132
156
|
# Required. The name of the instance that will serve the new database.
|
@@ -144,6 +168,11 @@ module Google
|
|
144
168
|
# database. Statements can create tables, indexes, etc. These
|
145
169
|
# statements execute atomically with the creation of the database:
|
146
170
|
# if there is an error in any statement, the database is not created.
|
171
|
+
# @!attribute [rw] encryption_config
|
172
|
+
# @return [::Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig]
|
173
|
+
# Optional. The encryption configuration for the database. If this field is
|
174
|
+
# not specified, Cloud Spanner will encrypt/decrypt all data at rest using
|
175
|
+
# Google default encryption.
|
147
176
|
class CreateDatabaseRequest
|
148
177
|
include ::Google::Protobuf::MessageExts
|
149
178
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -159,7 +188,8 @@ module Google
|
|
159
188
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
160
189
|
end
|
161
190
|
|
162
|
-
# The request for
|
191
|
+
# The request for
|
192
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database GetDatabase}.
|
163
193
|
# @!attribute [rw] name
|
164
194
|
# @return [::String]
|
165
195
|
# Required. The name of the requested database. Values are of the form
|
@@ -183,8 +213,8 @@ module Google
|
|
183
213
|
# Each batch of statements is assigned a name which can be used with
|
184
214
|
# the Operations API to monitor
|
185
215
|
# progress. See the
|
186
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest#operation_id operation_id}
|
187
|
-
# details.
|
216
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest#operation_id operation_id}
|
217
|
+
# field for more details.
|
188
218
|
# @!attribute [rw] database
|
189
219
|
# @return [::String]
|
190
220
|
# Required. The database to update.
|
@@ -200,18 +230,20 @@ module Google
|
|
200
230
|
#
|
201
231
|
# Specifying an explicit operation ID simplifies determining
|
202
232
|
# whether the statements were executed in the event that the
|
203
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl}
|
204
|
-
# or the return value is otherwise lost: the
|
205
|
-
#
|
233
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl}
|
234
|
+
# call is replayed, or the return value is otherwise lost: the
|
235
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest#database database}
|
236
|
+
# and `operation_id` fields can be combined to form the
|
206
237
|
# {::Google::Longrunning::Operation#name name} of the resulting
|
207
|
-
# {::Google::Longrunning::Operation longrunning.Operation}:
|
238
|
+
# {::Google::Longrunning::Operation longrunning.Operation}:
|
239
|
+
# `<database>/operations/<operation_id>`.
|
208
240
|
#
|
209
241
|
# `operation_id` should be unique within the database, and must be
|
210
242
|
# a valid identifier: `[a-z][a-z0-9_]*`. Note that
|
211
243
|
# automatically-generated operation IDs always begin with an
|
212
244
|
# underscore. If the named operation already exists,
|
213
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl}
|
214
|
-
# `ALREADY_EXISTS`.
|
245
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl UpdateDatabaseDdl}
|
246
|
+
# returns `ALREADY_EXISTS`.
|
215
247
|
class UpdateDatabaseDdlRequest
|
216
248
|
include ::Google::Protobuf::MessageExts
|
217
249
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -241,7 +273,8 @@ module Google
|
|
241
273
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
242
274
|
end
|
243
275
|
|
244
|
-
# The request for
|
276
|
+
# The request for
|
277
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#drop_database DropDatabase}.
|
245
278
|
# @!attribute [rw] database
|
246
279
|
# @return [::String]
|
247
280
|
# Required. The database to be dropped.
|
@@ -250,7 +283,8 @@ module Google
|
|
250
283
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
251
284
|
end
|
252
285
|
|
253
|
-
# The request for
|
286
|
+
# The request for
|
287
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database_ddl GetDatabaseDdl}.
|
254
288
|
# @!attribute [rw] database
|
255
289
|
# @return [::String]
|
256
290
|
# Required. The database whose schema we wish to get.
|
@@ -261,7 +295,8 @@ module Google
|
|
261
295
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
262
296
|
end
|
263
297
|
|
264
|
-
# The response for
|
298
|
+
# The response for
|
299
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database_ddl GetDatabaseDdl}.
|
265
300
|
# @!attribute [rw] statements
|
266
301
|
# @return [::Array<::String>]
|
267
302
|
# A list of formatted DDL statements defining the schema of the database
|
@@ -293,7 +328,9 @@ module Google
|
|
293
328
|
# * `name` - The name of the long-running operation
|
294
329
|
# * `done` - False if the operation is in progress, else true.
|
295
330
|
# * `metadata.@type` - the type of metadata. For example, the type string
|
296
|
-
# for
|
331
|
+
# for
|
332
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}
|
333
|
+
# is
|
297
334
|
# `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
|
298
335
|
# * `metadata.<field_name>` - any field in metadata.value.
|
299
336
|
# * `error` - Error associated with the long-running operation.
|
@@ -313,7 +350,8 @@ module Google
|
|
313
350
|
# `(metadata.name:restored_howl) AND` \
|
314
351
|
# `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
|
315
352
|
# `(error:*)` - Return operations where:
|
316
|
-
# * The operation's metadata type is
|
353
|
+
# * The operation's metadata type is
|
354
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata RestoreDatabaseMetadata}.
|
317
355
|
# * The database is restored from a backup.
|
318
356
|
# * The backup name contains "backup_howl".
|
319
357
|
# * The restored database's name contains "restored_howl".
|
@@ -327,8 +365,9 @@ module Google
|
|
327
365
|
# @return [::String]
|
328
366
|
# If non-empty, `page_token` should contain a
|
329
367
|
# {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse#next_page_token next_page_token}
|
330
|
-
# from a previous
|
331
|
-
#
|
368
|
+
# from a previous
|
369
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse ListDatabaseOperationsResponse}
|
370
|
+
# to the same `parent` and with the same `filter`.
|
332
371
|
class ListDatabaseOperationsRequest
|
333
372
|
include ::Google::Protobuf::MessageExts
|
334
373
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -372,11 +411,53 @@ module Google
|
|
372
411
|
# @return [::String]
|
373
412
|
# Name of the backup from which to restore. Values are of the form
|
374
413
|
# `projects/<project>/instances/<instance>/backups/<backup>`.
|
414
|
+
# @!attribute [rw] encryption_config
|
415
|
+
# @return [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig]
|
416
|
+
# Optional. An encryption configuration describing the encryption type and
|
417
|
+
# key resources in Cloud KMS used to encrypt/decrypt the database to restore
|
418
|
+
# to. If this field is not specified, the restored database will use the same
|
419
|
+
# encryption configuration as the backup by default, namely
|
420
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig#encryption_type encryption_type}
|
421
|
+
# = `USE_CONFIG_DEFAULT_OR_DATABASE_ENCRYPTION`.
|
375
422
|
class RestoreDatabaseRequest
|
376
423
|
include ::Google::Protobuf::MessageExts
|
377
424
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
378
425
|
end
|
379
426
|
|
427
|
+
# Encryption configuration for the restored database.
|
428
|
+
# @!attribute [rw] encryption_type
|
429
|
+
# @return [::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig::EncryptionType]
|
430
|
+
# Required. The encryption type of the restored database.
|
431
|
+
# @!attribute [rw] kms_key_name
|
432
|
+
# @return [::String]
|
433
|
+
# Optional. The Cloud KMS key that will be used to encrypt/decrypt the
|
434
|
+
# restored database. This field should be set only when
|
435
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig#encryption_type encryption_type}
|
436
|
+
# is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form
|
437
|
+
# `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
|
438
|
+
class RestoreDatabaseEncryptionConfig
|
439
|
+
include ::Google::Protobuf::MessageExts
|
440
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
441
|
+
|
442
|
+
# Encryption types for the database to be restored.
|
443
|
+
module EncryptionType
|
444
|
+
# Unspecified. Do not use.
|
445
|
+
ENCRYPTION_TYPE_UNSPECIFIED = 0
|
446
|
+
|
447
|
+
# This is the default option when
|
448
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseEncryptionConfig encryption_config}
|
449
|
+
# is not specified.
|
450
|
+
USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1
|
451
|
+
|
452
|
+
# Use Google default encryption.
|
453
|
+
GOOGLE_DEFAULT_ENCRYPTION = 2
|
454
|
+
|
455
|
+
# Use customer managed encryption. If specified, `kms_key_name` must
|
456
|
+
# must contain a valid Cloud KMS key.
|
457
|
+
CUSTOMER_MANAGED_ENCRYPTION = 3
|
458
|
+
end
|
459
|
+
end
|
460
|
+
|
380
461
|
# Metadata type for the long-running operation returned by
|
381
462
|
# {::Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#restore_database RestoreDatabase}.
|
382
463
|
# @!attribute [rw] name
|
@@ -405,7 +486,8 @@ module Google
|
|
405
486
|
# operation completed despite cancellation. On successful cancellation,
|
406
487
|
# the operation is not deleted; instead, it becomes an operation with
|
407
488
|
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
408
|
-
# {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to
|
489
|
+
# {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to
|
490
|
+
# `Code.CANCELLED`.
|
409
491
|
# @!attribute [rw] optimize_database_operation_name
|
410
492
|
# @return [::String]
|
411
493
|
# If exists, the name of the long-running operation that will be used to
|
@@ -415,10 +497,10 @@ module Google
|
|
415
497
|
# `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`
|
416
498
|
# where the <database> is the name of database being created and restored to.
|
417
499
|
# The metadata type of the long-running operation is
|
418
|
-
# {::Google::Cloud::Spanner::Admin::Database::V1::OptimizeRestoredDatabaseMetadata OptimizeRestoredDatabaseMetadata}.
|
419
|
-
# automatically created by the system
|
420
|
-
#
|
421
|
-
# restore was not successful.
|
500
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::OptimizeRestoredDatabaseMetadata OptimizeRestoredDatabaseMetadata}.
|
501
|
+
# This long-running operation will be automatically created by the system
|
502
|
+
# after the RestoreDatabase long-running operation completes successfully.
|
503
|
+
# This operation will not be created if the restore was not successful.
|
422
504
|
class RestoreDatabaseMetadata
|
423
505
|
include ::Google::Protobuf::MessageExts
|
424
506
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-spanner-admin-database-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|