google-cloud-spanner 3.55.0__py3-none-any.whl

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.
Files changed (119) hide show
  1. google/cloud/spanner.py +47 -0
  2. google/cloud/spanner_admin_database_v1/__init__.py +146 -0
  3. google/cloud/spanner_admin_database_v1/gapic_metadata.json +418 -0
  4. google/cloud/spanner_admin_database_v1/gapic_version.py +16 -0
  5. google/cloud/spanner_admin_database_v1/py.typed +2 -0
  6. google/cloud/spanner_admin_database_v1/services/__init__.py +15 -0
  7. google/cloud/spanner_admin_database_v1/services/database_admin/__init__.py +22 -0
  8. google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py +4097 -0
  9. google/cloud/spanner_admin_database_v1/services/database_admin/client.py +4602 -0
  10. google/cloud/spanner_admin_database_v1/services/database_admin/pagers.py +989 -0
  11. google/cloud/spanner_admin_database_v1/services/database_admin/transports/__init__.py +38 -0
  12. google/cloud/spanner_admin_database_v1/services/database_admin/transports/base.py +820 -0
  13. google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc.py +1303 -0
  14. google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc_asyncio.py +1688 -0
  15. google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest.py +6512 -0
  16. google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest_base.py +1650 -0
  17. google/cloud/spanner_admin_database_v1/types/__init__.py +144 -0
  18. google/cloud/spanner_admin_database_v1/types/backup.py +1106 -0
  19. google/cloud/spanner_admin_database_v1/types/backup_schedule.py +369 -0
  20. google/cloud/spanner_admin_database_v1/types/common.py +180 -0
  21. google/cloud/spanner_admin_database_v1/types/spanner_database_admin.py +1303 -0
  22. google/cloud/spanner_admin_instance_v1/__init__.py +110 -0
  23. google/cloud/spanner_admin_instance_v1/gapic_metadata.json +343 -0
  24. google/cloud/spanner_admin_instance_v1/gapic_version.py +16 -0
  25. google/cloud/spanner_admin_instance_v1/py.typed +2 -0
  26. google/cloud/spanner_admin_instance_v1/services/__init__.py +15 -0
  27. google/cloud/spanner_admin_instance_v1/services/instance_admin/__init__.py +22 -0
  28. google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py +3466 -0
  29. google/cloud/spanner_admin_instance_v1/services/instance_admin/client.py +3881 -0
  30. google/cloud/spanner_admin_instance_v1/services/instance_admin/pagers.py +856 -0
  31. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/__init__.py +38 -0
  32. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/base.py +545 -0
  33. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc.py +1347 -0
  34. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc_asyncio.py +1539 -0
  35. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/rest.py +4834 -0
  36. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/rest_base.py +1198 -0
  37. google/cloud/spanner_admin_instance_v1/types/__init__.py +104 -0
  38. google/cloud/spanner_admin_instance_v1/types/common.py +99 -0
  39. google/cloud/spanner_admin_instance_v1/types/spanner_instance_admin.py +2375 -0
  40. google/cloud/spanner_dbapi/__init__.py +93 -0
  41. google/cloud/spanner_dbapi/_helpers.py +113 -0
  42. google/cloud/spanner_dbapi/batch_dml_executor.py +135 -0
  43. google/cloud/spanner_dbapi/checksum.py +80 -0
  44. google/cloud/spanner_dbapi/client_side_statement_executor.py +140 -0
  45. google/cloud/spanner_dbapi/client_side_statement_parser.py +106 -0
  46. google/cloud/spanner_dbapi/connection.py +818 -0
  47. google/cloud/spanner_dbapi/cursor.py +609 -0
  48. google/cloud/spanner_dbapi/exceptions.py +172 -0
  49. google/cloud/spanner_dbapi/parse_utils.py +392 -0
  50. google/cloud/spanner_dbapi/parsed_statement.py +63 -0
  51. google/cloud/spanner_dbapi/parser.py +258 -0
  52. google/cloud/spanner_dbapi/partition_helper.py +41 -0
  53. google/cloud/spanner_dbapi/transaction_helper.py +294 -0
  54. google/cloud/spanner_dbapi/types.py +106 -0
  55. google/cloud/spanner_dbapi/utils.py +147 -0
  56. google/cloud/spanner_dbapi/version.py +20 -0
  57. google/cloud/spanner_v1/__init__.py +154 -0
  58. google/cloud/spanner_v1/_helpers.py +751 -0
  59. google/cloud/spanner_v1/_opentelemetry_tracing.py +165 -0
  60. google/cloud/spanner_v1/backup.py +397 -0
  61. google/cloud/spanner_v1/batch.py +433 -0
  62. google/cloud/spanner_v1/client.py +538 -0
  63. google/cloud/spanner_v1/data_types.py +350 -0
  64. google/cloud/spanner_v1/database.py +1968 -0
  65. google/cloud/spanner_v1/database_sessions_manager.py +249 -0
  66. google/cloud/spanner_v1/gapic_metadata.json +268 -0
  67. google/cloud/spanner_v1/gapic_version.py +16 -0
  68. google/cloud/spanner_v1/instance.py +735 -0
  69. google/cloud/spanner_v1/keyset.py +193 -0
  70. google/cloud/spanner_v1/merged_result_set.py +146 -0
  71. google/cloud/spanner_v1/metrics/constants.py +71 -0
  72. google/cloud/spanner_v1/metrics/metrics_capture.py +75 -0
  73. google/cloud/spanner_v1/metrics/metrics_exporter.py +384 -0
  74. google/cloud/spanner_v1/metrics/metrics_interceptor.py +156 -0
  75. google/cloud/spanner_v1/metrics/metrics_tracer.py +588 -0
  76. google/cloud/spanner_v1/metrics/metrics_tracer_factory.py +328 -0
  77. google/cloud/spanner_v1/metrics/spanner_metrics_tracer_factory.py +172 -0
  78. google/cloud/spanner_v1/param_types.py +110 -0
  79. google/cloud/spanner_v1/pool.py +813 -0
  80. google/cloud/spanner_v1/py.typed +2 -0
  81. google/cloud/spanner_v1/request_id_header.py +64 -0
  82. google/cloud/spanner_v1/services/__init__.py +15 -0
  83. google/cloud/spanner_v1/services/spanner/__init__.py +22 -0
  84. google/cloud/spanner_v1/services/spanner/async_client.py +2205 -0
  85. google/cloud/spanner_v1/services/spanner/client.py +2624 -0
  86. google/cloud/spanner_v1/services/spanner/pagers.py +196 -0
  87. google/cloud/spanner_v1/services/spanner/transports/__init__.py +38 -0
  88. google/cloud/spanner_v1/services/spanner/transports/base.py +520 -0
  89. google/cloud/spanner_v1/services/spanner/transports/grpc.py +911 -0
  90. google/cloud/spanner_v1/services/spanner/transports/grpc_asyncio.py +1144 -0
  91. google/cloud/spanner_v1/services/spanner/transports/rest.py +3468 -0
  92. google/cloud/spanner_v1/services/spanner/transports/rest_base.py +981 -0
  93. google/cloud/spanner_v1/session.py +631 -0
  94. google/cloud/spanner_v1/session_options.py +133 -0
  95. google/cloud/spanner_v1/snapshot.py +1057 -0
  96. google/cloud/spanner_v1/streamed.py +402 -0
  97. google/cloud/spanner_v1/table.py +181 -0
  98. google/cloud/spanner_v1/testing/__init__.py +0 -0
  99. google/cloud/spanner_v1/testing/database_test.py +121 -0
  100. google/cloud/spanner_v1/testing/interceptors.py +118 -0
  101. google/cloud/spanner_v1/testing/mock_database_admin.py +38 -0
  102. google/cloud/spanner_v1/testing/mock_spanner.py +261 -0
  103. google/cloud/spanner_v1/testing/spanner_database_admin_pb2_grpc.py +1267 -0
  104. google/cloud/spanner_v1/testing/spanner_pb2_grpc.py +882 -0
  105. google/cloud/spanner_v1/transaction.py +747 -0
  106. google/cloud/spanner_v1/types/__init__.py +118 -0
  107. google/cloud/spanner_v1/types/commit_response.py +94 -0
  108. google/cloud/spanner_v1/types/keys.py +248 -0
  109. google/cloud/spanner_v1/types/mutation.py +201 -0
  110. google/cloud/spanner_v1/types/query_plan.py +220 -0
  111. google/cloud/spanner_v1/types/result_set.py +379 -0
  112. google/cloud/spanner_v1/types/spanner.py +1815 -0
  113. google/cloud/spanner_v1/types/transaction.py +818 -0
  114. google/cloud/spanner_v1/types/type.py +288 -0
  115. google_cloud_spanner-3.55.0.dist-info/LICENSE +202 -0
  116. google_cloud_spanner-3.55.0.dist-info/METADATA +318 -0
  117. google_cloud_spanner-3.55.0.dist-info/RECORD +119 -0
  118. google_cloud_spanner-3.55.0.dist-info/WHEEL +5 -0
  119. google_cloud_spanner-3.55.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1106 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2025 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ from __future__ import annotations
17
+
18
+ from typing import MutableMapping, MutableSequence
19
+
20
+ import proto # type: ignore
21
+
22
+ from google.cloud.spanner_admin_database_v1.types import common
23
+ from google.longrunning import operations_pb2 # type: ignore
24
+ from google.protobuf import field_mask_pb2 # type: ignore
25
+ from google.protobuf import timestamp_pb2 # type: ignore
26
+
27
+
28
+ __protobuf__ = proto.module(
29
+ package="google.spanner.admin.database.v1",
30
+ manifest={
31
+ "Backup",
32
+ "CreateBackupRequest",
33
+ "CreateBackupMetadata",
34
+ "CopyBackupRequest",
35
+ "CopyBackupMetadata",
36
+ "UpdateBackupRequest",
37
+ "GetBackupRequest",
38
+ "DeleteBackupRequest",
39
+ "ListBackupsRequest",
40
+ "ListBackupsResponse",
41
+ "ListBackupOperationsRequest",
42
+ "ListBackupOperationsResponse",
43
+ "BackupInfo",
44
+ "CreateBackupEncryptionConfig",
45
+ "CopyBackupEncryptionConfig",
46
+ "FullBackupSpec",
47
+ "IncrementalBackupSpec",
48
+ "BackupInstancePartition",
49
+ },
50
+ )
51
+
52
+
53
+ class Backup(proto.Message):
54
+ r"""A backup of a Cloud Spanner database.
55
+
56
+ Attributes:
57
+ database (str):
58
+ Required for the
59
+ [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
60
+ operation. Name of the database from which this backup was
61
+ created. This needs to be in the same instance as the
62
+ backup. Values are of the form
63
+ ``projects/<project>/instances/<instance>/databases/<database>``.
64
+ version_time (google.protobuf.timestamp_pb2.Timestamp):
65
+ The backup will contain an externally consistent copy of the
66
+ database at the timestamp specified by ``version_time``. If
67
+ ``version_time`` is not specified, the system will set
68
+ ``version_time`` to the ``create_time`` of the backup.
69
+ expire_time (google.protobuf.timestamp_pb2.Timestamp):
70
+ Required for the
71
+ [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
72
+ operation. The expiration time of the backup, with
73
+ microseconds granularity that must be at least 6 hours and
74
+ at most 366 days from the time the CreateBackup request is
75
+ processed. Once the ``expire_time`` has passed, the backup
76
+ is eligible to be automatically deleted by Cloud Spanner to
77
+ free the resources used by the backup.
78
+ name (str):
79
+ Output only for the
80
+ [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
81
+ operation. Required for the
82
+ [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup]
83
+ operation.
84
+
85
+ A globally unique identifier for the backup which cannot be
86
+ changed. Values are of the form
87
+ ``projects/<project>/instances/<instance>/backups/[a-z][a-z0-9_\-]*[a-z0-9]``
88
+ The final segment of the name must be between 2 and 60
89
+ characters in length.
90
+
91
+ The backup is stored in the location(s) specified in the
92
+ instance configuration of the instance containing the
93
+ backup, identified by the prefix of the backup name of the
94
+ form ``projects/<project>/instances/<instance>``.
95
+ create_time (google.protobuf.timestamp_pb2.Timestamp):
96
+ Output only. The time the
97
+ [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
98
+ request is received. If the request does not specify
99
+ ``version_time``, the ``version_time`` of the backup will be
100
+ equivalent to the ``create_time``.
101
+ size_bytes (int):
102
+ Output only. Size of the backup in bytes.
103
+ freeable_size_bytes (int):
104
+ Output only. The number of bytes that will be
105
+ freed by deleting this backup. This value will
106
+ be zero if, for example, this backup is part of
107
+ an incremental backup chain and younger backups
108
+ in the chain require that we keep its data. For
109
+ backups not in an incremental backup chain, this
110
+ is always the size of the backup. This value may
111
+ change if backups on the same chain get created,
112
+ deleted or expired.
113
+ exclusive_size_bytes (int):
114
+ Output only. For a backup in an incremental
115
+ backup chain, this is the storage space needed
116
+ to keep the data that has changed since the
117
+ previous backup. For all other backups, this is
118
+ always the size of the backup. This value may
119
+ change if backups on the same chain get deleted
120
+ or expired.
121
+
122
+ This field can be used to calculate the total
123
+ storage space used by a set of backups. For
124
+ example, the total space used by all backups of
125
+ a database can be computed by summing up this
126
+ field.
127
+ state (google.cloud.spanner_admin_database_v1.types.Backup.State):
128
+ Output only. The current state of the backup.
129
+ referencing_databases (MutableSequence[str]):
130
+ Output only. The names of the restored databases that
131
+ reference the backup. The database names are of the form
132
+ ``projects/<project>/instances/<instance>/databases/<database>``.
133
+ Referencing databases may exist in different instances. The
134
+ existence of any referencing database prevents the backup
135
+ from being deleted. When a restored database from the backup
136
+ enters the ``READY`` state, the reference to the backup is
137
+ removed.
138
+ encryption_info (google.cloud.spanner_admin_database_v1.types.EncryptionInfo):
139
+ Output only. The encryption information for
140
+ the backup.
141
+ encryption_information (MutableSequence[google.cloud.spanner_admin_database_v1.types.EncryptionInfo]):
142
+ Output only. The encryption information for the backup,
143
+ whether it is protected by one or more KMS keys. The
144
+ information includes all Cloud KMS key versions used to
145
+ encrypt the backup. The
146
+ ``encryption_status' field inside of each``\ EncryptionInfo\`
147
+ is not populated. At least one of the key versions must be
148
+ available for the backup to be restored. If a key version is
149
+ revoked in the middle of a restore, the restore behavior is
150
+ undefined.
151
+ database_dialect (google.cloud.spanner_admin_database_v1.types.DatabaseDialect):
152
+ Output only. The database dialect information
153
+ for the backup.
154
+ referencing_backups (MutableSequence[str]):
155
+ Output only. The names of the destination backups being
156
+ created by copying this source backup. The backup names are
157
+ of the form
158
+ ``projects/<project>/instances/<instance>/backups/<backup>``.
159
+ Referencing backups may exist in different instances. The
160
+ existence of any referencing backup prevents the backup from
161
+ being deleted. When the copy operation is done (either
162
+ successfully completed or cancelled or the destination
163
+ backup is deleted), the reference to the backup is removed.
164
+ max_expire_time (google.protobuf.timestamp_pb2.Timestamp):
165
+ Output only. The max allowed expiration time of the backup,
166
+ with microseconds granularity. A backup's expiration time
167
+ can be configured in multiple APIs: CreateBackup,
168
+ UpdateBackup, CopyBackup. When updating or copying an
169
+ existing backup, the expiration time specified must be less
170
+ than ``Backup.max_expire_time``.
171
+ backup_schedules (MutableSequence[str]):
172
+ Output only. List of backup schedule URIs
173
+ that are associated with creating this backup.
174
+ This is only applicable for scheduled backups,
175
+ and is empty for on-demand backups.
176
+
177
+ To optimize for storage, whenever possible,
178
+ multiple schedules are collapsed together to
179
+ create one backup. In such cases, this field
180
+ captures the list of all backup schedule URIs
181
+ that are associated with creating this backup.
182
+ If collapsing is not done, then this field
183
+ captures the single backup schedule URI
184
+ associated with creating this backup.
185
+ incremental_backup_chain_id (str):
186
+ Output only. Populated only for backups in an incremental
187
+ backup chain. Backups share the same chain id if and only if
188
+ they belong to the same incremental backup chain. Use this
189
+ field to determine which backups are part of the same
190
+ incremental backup chain. The ordering of backups in the
191
+ chain can be determined by ordering the backup
192
+ ``version_time``.
193
+ oldest_version_time (google.protobuf.timestamp_pb2.Timestamp):
194
+ Output only. Data deleted at a time older
195
+ than this is guaranteed not to be retained in
196
+ order to support this backup. For a backup in an
197
+ incremental backup chain, this is the version
198
+ time of the oldest backup that exists or ever
199
+ existed in the chain. For all other backups,
200
+ this is the version time of the backup. This
201
+ field can be used to understand what data is
202
+ being retained by the backup system.
203
+ instance_partitions (MutableSequence[google.cloud.spanner_admin_database_v1.types.BackupInstancePartition]):
204
+ Output only. The instance partition(s) storing the backup.
205
+
206
+ This is the same as the list of the instance partition(s)
207
+ that the database had footprint in at the backup's
208
+ ``version_time``.
209
+ """
210
+
211
+ class State(proto.Enum):
212
+ r"""Indicates the current state of the backup.
213
+
214
+ Values:
215
+ STATE_UNSPECIFIED (0):
216
+ Not specified.
217
+ CREATING (1):
218
+ The pending backup is still being created. Operations on the
219
+ backup may fail with ``FAILED_PRECONDITION`` in this state.
220
+ READY (2):
221
+ The backup is complete and ready for use.
222
+ """
223
+ STATE_UNSPECIFIED = 0
224
+ CREATING = 1
225
+ READY = 2
226
+
227
+ database: str = proto.Field(
228
+ proto.STRING,
229
+ number=2,
230
+ )
231
+ version_time: timestamp_pb2.Timestamp = proto.Field(
232
+ proto.MESSAGE,
233
+ number=9,
234
+ message=timestamp_pb2.Timestamp,
235
+ )
236
+ expire_time: timestamp_pb2.Timestamp = proto.Field(
237
+ proto.MESSAGE,
238
+ number=3,
239
+ message=timestamp_pb2.Timestamp,
240
+ )
241
+ name: str = proto.Field(
242
+ proto.STRING,
243
+ number=1,
244
+ )
245
+ create_time: timestamp_pb2.Timestamp = proto.Field(
246
+ proto.MESSAGE,
247
+ number=4,
248
+ message=timestamp_pb2.Timestamp,
249
+ )
250
+ size_bytes: int = proto.Field(
251
+ proto.INT64,
252
+ number=5,
253
+ )
254
+ freeable_size_bytes: int = proto.Field(
255
+ proto.INT64,
256
+ number=15,
257
+ )
258
+ exclusive_size_bytes: int = proto.Field(
259
+ proto.INT64,
260
+ number=16,
261
+ )
262
+ state: State = proto.Field(
263
+ proto.ENUM,
264
+ number=6,
265
+ enum=State,
266
+ )
267
+ referencing_databases: MutableSequence[str] = proto.RepeatedField(
268
+ proto.STRING,
269
+ number=7,
270
+ )
271
+ encryption_info: common.EncryptionInfo = proto.Field(
272
+ proto.MESSAGE,
273
+ number=8,
274
+ message=common.EncryptionInfo,
275
+ )
276
+ encryption_information: MutableSequence[
277
+ common.EncryptionInfo
278
+ ] = proto.RepeatedField(
279
+ proto.MESSAGE,
280
+ number=13,
281
+ message=common.EncryptionInfo,
282
+ )
283
+ database_dialect: common.DatabaseDialect = proto.Field(
284
+ proto.ENUM,
285
+ number=10,
286
+ enum=common.DatabaseDialect,
287
+ )
288
+ referencing_backups: MutableSequence[str] = proto.RepeatedField(
289
+ proto.STRING,
290
+ number=11,
291
+ )
292
+ max_expire_time: timestamp_pb2.Timestamp = proto.Field(
293
+ proto.MESSAGE,
294
+ number=12,
295
+ message=timestamp_pb2.Timestamp,
296
+ )
297
+ backup_schedules: MutableSequence[str] = proto.RepeatedField(
298
+ proto.STRING,
299
+ number=14,
300
+ )
301
+ incremental_backup_chain_id: str = proto.Field(
302
+ proto.STRING,
303
+ number=17,
304
+ )
305
+ oldest_version_time: timestamp_pb2.Timestamp = proto.Field(
306
+ proto.MESSAGE,
307
+ number=18,
308
+ message=timestamp_pb2.Timestamp,
309
+ )
310
+ instance_partitions: MutableSequence[
311
+ "BackupInstancePartition"
312
+ ] = proto.RepeatedField(
313
+ proto.MESSAGE,
314
+ number=19,
315
+ message="BackupInstancePartition",
316
+ )
317
+
318
+
319
+ class CreateBackupRequest(proto.Message):
320
+ r"""The request for
321
+ [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
322
+
323
+ Attributes:
324
+ parent (str):
325
+ Required. The name of the instance in which the backup will
326
+ be created. This must be the same instance that contains the
327
+ database the backup will be created from. The backup will be
328
+ stored in the location(s) specified in the instance
329
+ configuration of this instance. Values are of the form
330
+ ``projects/<project>/instances/<instance>``.
331
+ backup_id (str):
332
+ Required. The id of the backup to be created. The
333
+ ``backup_id`` appended to ``parent`` forms the full backup
334
+ name of the form
335
+ ``projects/<project>/instances/<instance>/backups/<backup_id>``.
336
+ backup (google.cloud.spanner_admin_database_v1.types.Backup):
337
+ Required. The backup to create.
338
+ encryption_config (google.cloud.spanner_admin_database_v1.types.CreateBackupEncryptionConfig):
339
+ Optional. The encryption configuration used to encrypt the
340
+ backup. If this field is not specified, the backup will use
341
+ the same encryption configuration as the database by
342
+ default, namely
343
+ [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type]
344
+ = ``USE_DATABASE_ENCRYPTION``.
345
+ """
346
+
347
+ parent: str = proto.Field(
348
+ proto.STRING,
349
+ number=1,
350
+ )
351
+ backup_id: str = proto.Field(
352
+ proto.STRING,
353
+ number=2,
354
+ )
355
+ backup: "Backup" = proto.Field(
356
+ proto.MESSAGE,
357
+ number=3,
358
+ message="Backup",
359
+ )
360
+ encryption_config: "CreateBackupEncryptionConfig" = proto.Field(
361
+ proto.MESSAGE,
362
+ number=4,
363
+ message="CreateBackupEncryptionConfig",
364
+ )
365
+
366
+
367
+ class CreateBackupMetadata(proto.Message):
368
+ r"""Metadata type for the operation returned by
369
+ [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
370
+
371
+ Attributes:
372
+ name (str):
373
+ The name of the backup being created.
374
+ database (str):
375
+ The name of the database the backup is
376
+ created from.
377
+ progress (google.cloud.spanner_admin_database_v1.types.OperationProgress):
378
+ The progress of the
379
+ [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
380
+ operation.
381
+ cancel_time (google.protobuf.timestamp_pb2.Timestamp):
382
+ The time at which cancellation of this operation was
383
+ received.
384
+ [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
385
+ starts asynchronous cancellation on a long-running
386
+ operation. The server makes a best effort to cancel the
387
+ operation, but success is not guaranteed. Clients can use
388
+ [Operations.GetOperation][google.longrunning.Operations.GetOperation]
389
+ or other methods to check whether the cancellation succeeded
390
+ or whether the operation completed despite cancellation. On
391
+ successful cancellation, the operation is not deleted;
392
+ instead, it becomes an operation with an
393
+ [Operation.error][google.longrunning.Operation.error] value
394
+ with a [google.rpc.Status.code][google.rpc.Status.code] of
395
+ 1, corresponding to ``Code.CANCELLED``.
396
+ """
397
+
398
+ name: str = proto.Field(
399
+ proto.STRING,
400
+ number=1,
401
+ )
402
+ database: str = proto.Field(
403
+ proto.STRING,
404
+ number=2,
405
+ )
406
+ progress: common.OperationProgress = proto.Field(
407
+ proto.MESSAGE,
408
+ number=3,
409
+ message=common.OperationProgress,
410
+ )
411
+ cancel_time: timestamp_pb2.Timestamp = proto.Field(
412
+ proto.MESSAGE,
413
+ number=4,
414
+ message=timestamp_pb2.Timestamp,
415
+ )
416
+
417
+
418
+ class CopyBackupRequest(proto.Message):
419
+ r"""The request for
420
+ [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup].
421
+
422
+ Attributes:
423
+ parent (str):
424
+ Required. The name of the destination instance that will
425
+ contain the backup copy. Values are of the form:
426
+ ``projects/<project>/instances/<instance>``.
427
+ backup_id (str):
428
+ Required. The id of the backup copy. The ``backup_id``
429
+ appended to ``parent`` forms the full backup_uri of the form
430
+ ``projects/<project>/instances/<instance>/backups/<backup>``.
431
+ source_backup (str):
432
+ Required. The source backup to be copied. The source backup
433
+ needs to be in READY state for it to be copied. Once
434
+ CopyBackup is in progress, the source backup cannot be
435
+ deleted or cleaned up on expiration until CopyBackup is
436
+ finished. Values are of the form:
437
+ ``projects/<project>/instances/<instance>/backups/<backup>``.
438
+ expire_time (google.protobuf.timestamp_pb2.Timestamp):
439
+ Required. The expiration time of the backup in microsecond
440
+ granularity. The expiration time must be at least 6 hours
441
+ and at most 366 days from the ``create_time`` of the source
442
+ backup. Once the ``expire_time`` has passed, the backup is
443
+ eligible to be automatically deleted by Cloud Spanner to
444
+ free the resources used by the backup.
445
+ encryption_config (google.cloud.spanner_admin_database_v1.types.CopyBackupEncryptionConfig):
446
+ Optional. The encryption configuration used to encrypt the
447
+ backup. If this field is not specified, the backup will use
448
+ the same encryption configuration as the source backup by
449
+ default, namely
450
+ [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type]
451
+ = ``USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION``.
452
+ """
453
+
454
+ parent: str = proto.Field(
455
+ proto.STRING,
456
+ number=1,
457
+ )
458
+ backup_id: str = proto.Field(
459
+ proto.STRING,
460
+ number=2,
461
+ )
462
+ source_backup: str = proto.Field(
463
+ proto.STRING,
464
+ number=3,
465
+ )
466
+ expire_time: timestamp_pb2.Timestamp = proto.Field(
467
+ proto.MESSAGE,
468
+ number=4,
469
+ message=timestamp_pb2.Timestamp,
470
+ )
471
+ encryption_config: "CopyBackupEncryptionConfig" = proto.Field(
472
+ proto.MESSAGE,
473
+ number=5,
474
+ message="CopyBackupEncryptionConfig",
475
+ )
476
+
477
+
478
+ class CopyBackupMetadata(proto.Message):
479
+ r"""Metadata type for the operation returned by
480
+ [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup].
481
+
482
+ Attributes:
483
+ name (str):
484
+ The name of the backup being created through the copy
485
+ operation. Values are of the form
486
+ ``projects/<project>/instances/<instance>/backups/<backup>``.
487
+ source_backup (str):
488
+ The name of the source backup that is being copied. Values
489
+ are of the form
490
+ ``projects/<project>/instances/<instance>/backups/<backup>``.
491
+ progress (google.cloud.spanner_admin_database_v1.types.OperationProgress):
492
+ The progress of the
493
+ [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]
494
+ operation.
495
+ cancel_time (google.protobuf.timestamp_pb2.Timestamp):
496
+ The time at which cancellation of CopyBackup operation was
497
+ received.
498
+ [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]
499
+ starts asynchronous cancellation on a long-running
500
+ operation. The server makes a best effort to cancel the
501
+ operation, but success is not guaranteed. Clients can use
502
+ [Operations.GetOperation][google.longrunning.Operations.GetOperation]
503
+ or other methods to check whether the cancellation succeeded
504
+ or whether the operation completed despite cancellation. On
505
+ successful cancellation, the operation is not deleted;
506
+ instead, it becomes an operation with an
507
+ [Operation.error][google.longrunning.Operation.error] value
508
+ with a [google.rpc.Status.code][google.rpc.Status.code] of
509
+ 1, corresponding to ``Code.CANCELLED``.
510
+ """
511
+
512
+ name: str = proto.Field(
513
+ proto.STRING,
514
+ number=1,
515
+ )
516
+ source_backup: str = proto.Field(
517
+ proto.STRING,
518
+ number=2,
519
+ )
520
+ progress: common.OperationProgress = proto.Field(
521
+ proto.MESSAGE,
522
+ number=3,
523
+ message=common.OperationProgress,
524
+ )
525
+ cancel_time: timestamp_pb2.Timestamp = proto.Field(
526
+ proto.MESSAGE,
527
+ number=4,
528
+ message=timestamp_pb2.Timestamp,
529
+ )
530
+
531
+
532
+ class UpdateBackupRequest(proto.Message):
533
+ r"""The request for
534
+ [UpdateBackup][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackup].
535
+
536
+ Attributes:
537
+ backup (google.cloud.spanner_admin_database_v1.types.Backup):
538
+ Required. The backup to update. ``backup.name``, and the
539
+ fields to be updated as specified by ``update_mask`` are
540
+ required. Other fields are ignored. Update is only supported
541
+ for the following fields:
542
+
543
+ - ``backup.expire_time``.
544
+ update_mask (google.protobuf.field_mask_pb2.FieldMask):
545
+ Required. A mask specifying which fields (e.g.
546
+ ``expire_time``) in the Backup resource should be updated.
547
+ This mask is relative to the Backup resource, not to the
548
+ request message. The field mask must always be specified;
549
+ this prevents any future fields from being erased
550
+ accidentally by clients that do not know about them.
551
+ """
552
+
553
+ backup: "Backup" = proto.Field(
554
+ proto.MESSAGE,
555
+ number=1,
556
+ message="Backup",
557
+ )
558
+ update_mask: field_mask_pb2.FieldMask = proto.Field(
559
+ proto.MESSAGE,
560
+ number=2,
561
+ message=field_mask_pb2.FieldMask,
562
+ )
563
+
564
+
565
+ class GetBackupRequest(proto.Message):
566
+ r"""The request for
567
+ [GetBackup][google.spanner.admin.database.v1.DatabaseAdmin.GetBackup].
568
+
569
+ Attributes:
570
+ name (str):
571
+ Required. Name of the backup. Values are of the form
572
+ ``projects/<project>/instances/<instance>/backups/<backup>``.
573
+ """
574
+
575
+ name: str = proto.Field(
576
+ proto.STRING,
577
+ number=1,
578
+ )
579
+
580
+
581
+ class DeleteBackupRequest(proto.Message):
582
+ r"""The request for
583
+ [DeleteBackup][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackup].
584
+
585
+ Attributes:
586
+ name (str):
587
+ Required. Name of the backup to delete. Values are of the
588
+ form
589
+ ``projects/<project>/instances/<instance>/backups/<backup>``.
590
+ """
591
+
592
+ name: str = proto.Field(
593
+ proto.STRING,
594
+ number=1,
595
+ )
596
+
597
+
598
+ class ListBackupsRequest(proto.Message):
599
+ r"""The request for
600
+ [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
601
+
602
+ Attributes:
603
+ parent (str):
604
+ Required. The instance to list backups from. Values are of
605
+ the form ``projects/<project>/instances/<instance>``.
606
+ filter (str):
607
+ An expression that filters the list of returned backups.
608
+
609
+ A filter expression consists of a field name, a comparison
610
+ operator, and a value for filtering. The value must be a
611
+ string, a number, or a boolean. The comparison operator must
612
+ be one of: ``<``, ``>``, ``<=``, ``>=``, ``!=``, ``=``, or
613
+ ``:``. Colon ``:`` is the contains operator. Filter rules
614
+ are not case sensitive.
615
+
616
+ The following fields in the
617
+ [Backup][google.spanner.admin.database.v1.Backup] are
618
+ eligible for filtering:
619
+
620
+ - ``name``
621
+ - ``database``
622
+ - ``state``
623
+ - ``create_time`` (and values are of the format
624
+ YYYY-MM-DDTHH:MM:SSZ)
625
+ - ``expire_time`` (and values are of the format
626
+ YYYY-MM-DDTHH:MM:SSZ)
627
+ - ``version_time`` (and values are of the format
628
+ YYYY-MM-DDTHH:MM:SSZ)
629
+ - ``size_bytes``
630
+ - ``backup_schedules``
631
+
632
+ You can combine multiple expressions by enclosing each
633
+ expression in parentheses. By default, expressions are
634
+ combined with AND logic, but you can specify AND, OR, and
635
+ NOT logic explicitly.
636
+
637
+ Here are a few examples:
638
+
639
+ - ``name:Howl`` - The backup's name contains the string
640
+ "howl".
641
+ - ``database:prod`` - The database's name contains the
642
+ string "prod".
643
+ - ``state:CREATING`` - The backup is pending creation.
644
+ - ``state:READY`` - The backup is fully created and ready
645
+ for use.
646
+ - ``(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")``
647
+ - The backup name contains the string "howl" and
648
+ ``create_time`` of the backup is before
649
+ 2018-03-28T14:50:00Z.
650
+ - ``expire_time < \"2018-03-28T14:50:00Z\"`` - The backup
651
+ ``expire_time`` is before 2018-03-28T14:50:00Z.
652
+ - ``size_bytes > 10000000000`` - The backup's size is
653
+ greater than 10GB
654
+ - ``backup_schedules:daily`` - The backup is created from a
655
+ schedule with "daily" in its name.
656
+ page_size (int):
657
+ Number of backups to be returned in the
658
+ response. If 0 or less, defaults to the server's
659
+ maximum allowed page size.
660
+ page_token (str):
661
+ If non-empty, ``page_token`` should contain a
662
+ [next_page_token][google.spanner.admin.database.v1.ListBackupsResponse.next_page_token]
663
+ from a previous
664
+ [ListBackupsResponse][google.spanner.admin.database.v1.ListBackupsResponse]
665
+ to the same ``parent`` and with the same ``filter``.
666
+ """
667
+
668
+ parent: str = proto.Field(
669
+ proto.STRING,
670
+ number=1,
671
+ )
672
+ filter: str = proto.Field(
673
+ proto.STRING,
674
+ number=2,
675
+ )
676
+ page_size: int = proto.Field(
677
+ proto.INT32,
678
+ number=3,
679
+ )
680
+ page_token: str = proto.Field(
681
+ proto.STRING,
682
+ number=4,
683
+ )
684
+
685
+
686
+ class ListBackupsResponse(proto.Message):
687
+ r"""The response for
688
+ [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups].
689
+
690
+ Attributes:
691
+ backups (MutableSequence[google.cloud.spanner_admin_database_v1.types.Backup]):
692
+ The list of matching backups. Backups returned are ordered
693
+ by ``create_time`` in descending order, starting from the
694
+ most recent ``create_time``.
695
+ next_page_token (str):
696
+ ``next_page_token`` can be sent in a subsequent
697
+ [ListBackups][google.spanner.admin.database.v1.DatabaseAdmin.ListBackups]
698
+ call to fetch more of the matching backups.
699
+ """
700
+
701
+ @property
702
+ def raw_page(self):
703
+ return self
704
+
705
+ backups: MutableSequence["Backup"] = proto.RepeatedField(
706
+ proto.MESSAGE,
707
+ number=1,
708
+ message="Backup",
709
+ )
710
+ next_page_token: str = proto.Field(
711
+ proto.STRING,
712
+ number=2,
713
+ )
714
+
715
+
716
+ class ListBackupOperationsRequest(proto.Message):
717
+ r"""The request for
718
+ [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations].
719
+
720
+ Attributes:
721
+ parent (str):
722
+ Required. The instance of the backup operations. Values are
723
+ of the form ``projects/<project>/instances/<instance>``.
724
+ filter (str):
725
+ An expression that filters the list of returned backup
726
+ operations.
727
+
728
+ A filter expression consists of a field name, a comparison
729
+ operator, and a value for filtering. The value must be a
730
+ string, a number, or a boolean. The comparison operator must
731
+ be one of: ``<``, ``>``, ``<=``, ``>=``, ``!=``, ``=``, or
732
+ ``:``. Colon ``:`` is the contains operator. Filter rules
733
+ are not case sensitive.
734
+
735
+ The following fields in the
736
+ [operation][google.longrunning.Operation] are eligible for
737
+ filtering:
738
+
739
+ - ``name`` - The name of the long-running operation
740
+ - ``done`` - False if the operation is in progress, else
741
+ true.
742
+ - ``metadata.@type`` - the type of metadata. For example,
743
+ the type string for
744
+ [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]
745
+ is
746
+ ``type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata``.
747
+ - ``metadata.<field_name>`` - any field in metadata.value.
748
+ ``metadata.@type`` must be specified first if filtering
749
+ on metadata fields.
750
+ - ``error`` - Error associated with the long-running
751
+ operation.
752
+ - ``response.@type`` - the type of response.
753
+ - ``response.<field_name>`` - any field in response.value.
754
+
755
+ You can combine multiple expressions by enclosing each
756
+ expression in parentheses. By default, expressions are
757
+ combined with AND logic, but you can specify AND, OR, and
758
+ NOT logic explicitly.
759
+
760
+ Here are a few examples:
761
+
762
+ - ``done:true`` - The operation is complete.
763
+ - ``(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND``
764
+ ``metadata.database:prod`` - Returns operations where:
765
+
766
+ - The operation's metadata type is
767
+ [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
768
+ - The source database name of backup contains the string
769
+ "prod".
770
+
771
+ - ``(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND``
772
+ ``(metadata.name:howl) AND``
773
+ ``(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND``
774
+ ``(error:*)`` - Returns operations where:
775
+
776
+ - The operation's metadata type is
777
+ [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata].
778
+ - The backup name contains the string "howl".
779
+ - The operation started before 2018-03-28T14:50:00Z.
780
+ - The operation resulted in an error.
781
+
782
+ - ``(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND``
783
+ ``(metadata.source_backup:test) AND``
784
+ ``(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND``
785
+ ``(error:*)`` - Returns operations where:
786
+
787
+ - The operation's metadata type is
788
+ [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata].
789
+ - The source backup name contains the string "test".
790
+ - The operation started before 2022-01-18T14:50:00Z.
791
+ - The operation resulted in an error.
792
+
793
+ - ``((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND``
794
+ ``(metadata.database:test_db)) OR``
795
+ ``((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND``
796
+ ``(metadata.source_backup:test_bkp)) AND``
797
+ ``(error:*)`` - Returns operations where:
798
+
799
+ - The operation's metadata matches either of criteria:
800
+
801
+ - The operation's metadata type is
802
+ [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]
803
+ AND the source database name of the backup contains
804
+ the string "test_db"
805
+ - The operation's metadata type is
806
+ [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]
807
+ AND the source backup name contains the string
808
+ "test_bkp"
809
+
810
+ - The operation resulted in an error.
811
+ page_size (int):
812
+ Number of operations to be returned in the
813
+ response. If 0 or less, defaults to the server's
814
+ maximum allowed page size.
815
+ page_token (str):
816
+ If non-empty, ``page_token`` should contain a
817
+ [next_page_token][google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token]
818
+ from a previous
819
+ [ListBackupOperationsResponse][google.spanner.admin.database.v1.ListBackupOperationsResponse]
820
+ to the same ``parent`` and with the same ``filter``.
821
+ """
822
+
823
+ parent: str = proto.Field(
824
+ proto.STRING,
825
+ number=1,
826
+ )
827
+ filter: str = proto.Field(
828
+ proto.STRING,
829
+ number=2,
830
+ )
831
+ page_size: int = proto.Field(
832
+ proto.INT32,
833
+ number=3,
834
+ )
835
+ page_token: str = proto.Field(
836
+ proto.STRING,
837
+ number=4,
838
+ )
839
+
840
+
841
+ class ListBackupOperationsResponse(proto.Message):
842
+ r"""The response for
843
+ [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations].
844
+
845
+ Attributes:
846
+ operations (MutableSequence[google.longrunning.operations_pb2.Operation]):
847
+ The list of matching backup [long-running
848
+ operations][google.longrunning.Operation]. Each operation's
849
+ name will be prefixed by the backup's name. The operation's
850
+ [metadata][google.longrunning.Operation.metadata] field type
851
+ ``metadata.type_url`` describes the type of the metadata.
852
+ Operations returned include those that are pending or have
853
+ completed/failed/canceled within the last 7 days. Operations
854
+ returned are ordered by
855
+ ``operation.metadata.value.progress.start_time`` in
856
+ descending order starting from the most recently started
857
+ operation.
858
+ next_page_token (str):
859
+ ``next_page_token`` can be sent in a subsequent
860
+ [ListBackupOperations][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupOperations]
861
+ call to fetch more of the matching metadata.
862
+ """
863
+
864
+ @property
865
+ def raw_page(self):
866
+ return self
867
+
868
+ operations: MutableSequence[operations_pb2.Operation] = proto.RepeatedField(
869
+ proto.MESSAGE,
870
+ number=1,
871
+ message=operations_pb2.Operation,
872
+ )
873
+ next_page_token: str = proto.Field(
874
+ proto.STRING,
875
+ number=2,
876
+ )
877
+
878
+
879
+ class BackupInfo(proto.Message):
880
+ r"""Information about a backup.
881
+
882
+ Attributes:
883
+ backup (str):
884
+ Name of the backup.
885
+ version_time (google.protobuf.timestamp_pb2.Timestamp):
886
+ The backup contains an externally consistent copy of
887
+ ``source_database`` at the timestamp specified by
888
+ ``version_time``. If the
889
+ [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
890
+ request did not specify ``version_time``, the
891
+ ``version_time`` of the backup is equivalent to the
892
+ ``create_time``.
893
+ create_time (google.protobuf.timestamp_pb2.Timestamp):
894
+ The time the
895
+ [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup]
896
+ request was received.
897
+ source_database (str):
898
+ Name of the database the backup was created
899
+ from.
900
+ """
901
+
902
+ backup: str = proto.Field(
903
+ proto.STRING,
904
+ number=1,
905
+ )
906
+ version_time: timestamp_pb2.Timestamp = proto.Field(
907
+ proto.MESSAGE,
908
+ number=4,
909
+ message=timestamp_pb2.Timestamp,
910
+ )
911
+ create_time: timestamp_pb2.Timestamp = proto.Field(
912
+ proto.MESSAGE,
913
+ number=2,
914
+ message=timestamp_pb2.Timestamp,
915
+ )
916
+ source_database: str = proto.Field(
917
+ proto.STRING,
918
+ number=3,
919
+ )
920
+
921
+
922
+ class CreateBackupEncryptionConfig(proto.Message):
923
+ r"""Encryption configuration for the backup to create.
924
+
925
+ Attributes:
926
+ encryption_type (google.cloud.spanner_admin_database_v1.types.CreateBackupEncryptionConfig.EncryptionType):
927
+ Required. The encryption type of the backup.
928
+ kms_key_name (str):
929
+ Optional. The Cloud KMS key that will be used to protect the
930
+ backup. This field should be set only when
931
+ [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type]
932
+ is ``CUSTOMER_MANAGED_ENCRYPTION``. Values are of the form
933
+ ``projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>``.
934
+ kms_key_names (MutableSequence[str]):
935
+ Optional. Specifies the KMS configuration for the one or
936
+ more keys used to protect the backup. Values are of the form
937
+ ``projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>``.
938
+
939
+ The keys referenced by kms_key_names must fully cover all
940
+ regions of the backup's instance configuration. Some
941
+ examples:
942
+
943
+ - For single region instance configs, specify a single
944
+ regional location KMS key.
945
+ - For multi-regional instance configs of type
946
+ GOOGLE_MANAGED, either specify a multi-regional location
947
+ KMS key or multiple regional location KMS keys that cover
948
+ all regions in the instance config.
949
+ - For an instance config of type USER_MANAGED, please
950
+ specify only regional location KMS keys to cover each
951
+ region in the instance config. Multi-regional location
952
+ KMS keys are not supported for USER_MANAGED instance
953
+ configs.
954
+ """
955
+
956
+ class EncryptionType(proto.Enum):
957
+ r"""Encryption types for the backup.
958
+
959
+ Values:
960
+ ENCRYPTION_TYPE_UNSPECIFIED (0):
961
+ Unspecified. Do not use.
962
+ USE_DATABASE_ENCRYPTION (1):
963
+ Use the same encryption configuration as the database. This
964
+ is the default option when
965
+ [encryption_config][google.spanner.admin.database.v1.CreateBackupEncryptionConfig]
966
+ is empty. For example, if the database is using
967
+ ``Customer_Managed_Encryption``, the backup will be using
968
+ the same Cloud KMS key as the database.
969
+ GOOGLE_DEFAULT_ENCRYPTION (2):
970
+ Use Google default encryption.
971
+ CUSTOMER_MANAGED_ENCRYPTION (3):
972
+ Use customer managed encryption. If specified,
973
+ ``kms_key_name`` must contain a valid Cloud KMS key.
974
+ """
975
+ ENCRYPTION_TYPE_UNSPECIFIED = 0
976
+ USE_DATABASE_ENCRYPTION = 1
977
+ GOOGLE_DEFAULT_ENCRYPTION = 2
978
+ CUSTOMER_MANAGED_ENCRYPTION = 3
979
+
980
+ encryption_type: EncryptionType = proto.Field(
981
+ proto.ENUM,
982
+ number=1,
983
+ enum=EncryptionType,
984
+ )
985
+ kms_key_name: str = proto.Field(
986
+ proto.STRING,
987
+ number=2,
988
+ )
989
+ kms_key_names: MutableSequence[str] = proto.RepeatedField(
990
+ proto.STRING,
991
+ number=3,
992
+ )
993
+
994
+
995
+ class CopyBackupEncryptionConfig(proto.Message):
996
+ r"""Encryption configuration for the copied backup.
997
+
998
+ Attributes:
999
+ encryption_type (google.cloud.spanner_admin_database_v1.types.CopyBackupEncryptionConfig.EncryptionType):
1000
+ Required. The encryption type of the backup.
1001
+ kms_key_name (str):
1002
+ Optional. The Cloud KMS key that will be used to protect the
1003
+ backup. This field should be set only when
1004
+ [encryption_type][google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encryption_type]
1005
+ is ``CUSTOMER_MANAGED_ENCRYPTION``. Values are of the form
1006
+ ``projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>``.
1007
+ kms_key_names (MutableSequence[str]):
1008
+ Optional. Specifies the KMS configuration for the one or
1009
+ more keys used to protect the backup. Values are of the form
1010
+ ``projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>``.
1011
+ Kms keys specified can be in any order.
1012
+
1013
+ The keys referenced by kms_key_names must fully cover all
1014
+ regions of the backup's instance configuration. Some
1015
+ examples:
1016
+
1017
+ - For single region instance configs, specify a single
1018
+ regional location KMS key.
1019
+ - For multi-regional instance configs of type
1020
+ GOOGLE_MANAGED, either specify a multi-regional location
1021
+ KMS key or multiple regional location KMS keys that cover
1022
+ all regions in the instance config.
1023
+ - For an instance config of type USER_MANAGED, please
1024
+ specify only regional location KMS keys to cover each
1025
+ region in the instance config. Multi-regional location
1026
+ KMS keys are not supported for USER_MANAGED instance
1027
+ configs.
1028
+ """
1029
+
1030
+ class EncryptionType(proto.Enum):
1031
+ r"""Encryption types for the backup.
1032
+
1033
+ Values:
1034
+ ENCRYPTION_TYPE_UNSPECIFIED (0):
1035
+ Unspecified. Do not use.
1036
+ USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION (1):
1037
+ This is the default option for
1038
+ [CopyBackup][google.spanner.admin.database.v1.DatabaseAdmin.CopyBackup]
1039
+ when
1040
+ [encryption_config][google.spanner.admin.database.v1.CopyBackupEncryptionConfig]
1041
+ is not specified. For example, if the source backup is using
1042
+ ``Customer_Managed_Encryption``, the backup will be using
1043
+ the same Cloud KMS key as the source backup.
1044
+ GOOGLE_DEFAULT_ENCRYPTION (2):
1045
+ Use Google default encryption.
1046
+ CUSTOMER_MANAGED_ENCRYPTION (3):
1047
+ Use customer managed encryption. If specified, either
1048
+ ``kms_key_name`` or ``kms_key_names`` must contain valid
1049
+ Cloud KMS key(s).
1050
+ """
1051
+ ENCRYPTION_TYPE_UNSPECIFIED = 0
1052
+ USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION = 1
1053
+ GOOGLE_DEFAULT_ENCRYPTION = 2
1054
+ CUSTOMER_MANAGED_ENCRYPTION = 3
1055
+
1056
+ encryption_type: EncryptionType = proto.Field(
1057
+ proto.ENUM,
1058
+ number=1,
1059
+ enum=EncryptionType,
1060
+ )
1061
+ kms_key_name: str = proto.Field(
1062
+ proto.STRING,
1063
+ number=2,
1064
+ )
1065
+ kms_key_names: MutableSequence[str] = proto.RepeatedField(
1066
+ proto.STRING,
1067
+ number=3,
1068
+ )
1069
+
1070
+
1071
+ class FullBackupSpec(proto.Message):
1072
+ r"""The specification for full backups.
1073
+ A full backup stores the entire contents of the database at a
1074
+ given version time.
1075
+
1076
+ """
1077
+
1078
+
1079
+ class IncrementalBackupSpec(proto.Message):
1080
+ r"""The specification for incremental backup chains.
1081
+ An incremental backup stores the delta of changes between a
1082
+ previous backup and the database contents at a given version
1083
+ time. An incremental backup chain consists of a full backup and
1084
+ zero or more successive incremental backups. The first backup
1085
+ created for an incremental backup chain is always a full backup.
1086
+
1087
+ """
1088
+
1089
+
1090
+ class BackupInstancePartition(proto.Message):
1091
+ r"""Instance partition information for the backup.
1092
+
1093
+ Attributes:
1094
+ instance_partition (str):
1095
+ A unique identifier for the instance partition. Values are
1096
+ of the form
1097
+ ``projects/<project>/instances/<instance>/instancePartitions/<instance_partition_id>``
1098
+ """
1099
+
1100
+ instance_partition: str = proto.Field(
1101
+ proto.STRING,
1102
+ number=1,
1103
+ )
1104
+
1105
+
1106
+ __all__ = tuple(sorted(__protobuf__.manifest))