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.
- google/cloud/spanner.py +47 -0
- google/cloud/spanner_admin_database_v1/__init__.py +146 -0
- google/cloud/spanner_admin_database_v1/gapic_metadata.json +418 -0
- google/cloud/spanner_admin_database_v1/gapic_version.py +16 -0
- google/cloud/spanner_admin_database_v1/py.typed +2 -0
- google/cloud/spanner_admin_database_v1/services/__init__.py +15 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/__init__.py +22 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py +4097 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/client.py +4602 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/pagers.py +989 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/transports/__init__.py +38 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/transports/base.py +820 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc.py +1303 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc_asyncio.py +1688 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest.py +6512 -0
- google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest_base.py +1650 -0
- google/cloud/spanner_admin_database_v1/types/__init__.py +144 -0
- google/cloud/spanner_admin_database_v1/types/backup.py +1106 -0
- google/cloud/spanner_admin_database_v1/types/backup_schedule.py +369 -0
- google/cloud/spanner_admin_database_v1/types/common.py +180 -0
- google/cloud/spanner_admin_database_v1/types/spanner_database_admin.py +1303 -0
- google/cloud/spanner_admin_instance_v1/__init__.py +110 -0
- google/cloud/spanner_admin_instance_v1/gapic_metadata.json +343 -0
- google/cloud/spanner_admin_instance_v1/gapic_version.py +16 -0
- google/cloud/spanner_admin_instance_v1/py.typed +2 -0
- google/cloud/spanner_admin_instance_v1/services/__init__.py +15 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/__init__.py +22 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py +3466 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/client.py +3881 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/pagers.py +856 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/__init__.py +38 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/base.py +545 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc.py +1347 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc_asyncio.py +1539 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/rest.py +4834 -0
- google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/rest_base.py +1198 -0
- google/cloud/spanner_admin_instance_v1/types/__init__.py +104 -0
- google/cloud/spanner_admin_instance_v1/types/common.py +99 -0
- google/cloud/spanner_admin_instance_v1/types/spanner_instance_admin.py +2375 -0
- google/cloud/spanner_dbapi/__init__.py +93 -0
- google/cloud/spanner_dbapi/_helpers.py +113 -0
- google/cloud/spanner_dbapi/batch_dml_executor.py +135 -0
- google/cloud/spanner_dbapi/checksum.py +80 -0
- google/cloud/spanner_dbapi/client_side_statement_executor.py +140 -0
- google/cloud/spanner_dbapi/client_side_statement_parser.py +106 -0
- google/cloud/spanner_dbapi/connection.py +818 -0
- google/cloud/spanner_dbapi/cursor.py +609 -0
- google/cloud/spanner_dbapi/exceptions.py +172 -0
- google/cloud/spanner_dbapi/parse_utils.py +392 -0
- google/cloud/spanner_dbapi/parsed_statement.py +63 -0
- google/cloud/spanner_dbapi/parser.py +258 -0
- google/cloud/spanner_dbapi/partition_helper.py +41 -0
- google/cloud/spanner_dbapi/transaction_helper.py +294 -0
- google/cloud/spanner_dbapi/types.py +106 -0
- google/cloud/spanner_dbapi/utils.py +147 -0
- google/cloud/spanner_dbapi/version.py +20 -0
- google/cloud/spanner_v1/__init__.py +154 -0
- google/cloud/spanner_v1/_helpers.py +751 -0
- google/cloud/spanner_v1/_opentelemetry_tracing.py +165 -0
- google/cloud/spanner_v1/backup.py +397 -0
- google/cloud/spanner_v1/batch.py +433 -0
- google/cloud/spanner_v1/client.py +538 -0
- google/cloud/spanner_v1/data_types.py +350 -0
- google/cloud/spanner_v1/database.py +1968 -0
- google/cloud/spanner_v1/database_sessions_manager.py +249 -0
- google/cloud/spanner_v1/gapic_metadata.json +268 -0
- google/cloud/spanner_v1/gapic_version.py +16 -0
- google/cloud/spanner_v1/instance.py +735 -0
- google/cloud/spanner_v1/keyset.py +193 -0
- google/cloud/spanner_v1/merged_result_set.py +146 -0
- google/cloud/spanner_v1/metrics/constants.py +71 -0
- google/cloud/spanner_v1/metrics/metrics_capture.py +75 -0
- google/cloud/spanner_v1/metrics/metrics_exporter.py +384 -0
- google/cloud/spanner_v1/metrics/metrics_interceptor.py +156 -0
- google/cloud/spanner_v1/metrics/metrics_tracer.py +588 -0
- google/cloud/spanner_v1/metrics/metrics_tracer_factory.py +328 -0
- google/cloud/spanner_v1/metrics/spanner_metrics_tracer_factory.py +172 -0
- google/cloud/spanner_v1/param_types.py +110 -0
- google/cloud/spanner_v1/pool.py +813 -0
- google/cloud/spanner_v1/py.typed +2 -0
- google/cloud/spanner_v1/request_id_header.py +64 -0
- google/cloud/spanner_v1/services/__init__.py +15 -0
- google/cloud/spanner_v1/services/spanner/__init__.py +22 -0
- google/cloud/spanner_v1/services/spanner/async_client.py +2205 -0
- google/cloud/spanner_v1/services/spanner/client.py +2624 -0
- google/cloud/spanner_v1/services/spanner/pagers.py +196 -0
- google/cloud/spanner_v1/services/spanner/transports/__init__.py +38 -0
- google/cloud/spanner_v1/services/spanner/transports/base.py +520 -0
- google/cloud/spanner_v1/services/spanner/transports/grpc.py +911 -0
- google/cloud/spanner_v1/services/spanner/transports/grpc_asyncio.py +1144 -0
- google/cloud/spanner_v1/services/spanner/transports/rest.py +3468 -0
- google/cloud/spanner_v1/services/spanner/transports/rest_base.py +981 -0
- google/cloud/spanner_v1/session.py +631 -0
- google/cloud/spanner_v1/session_options.py +133 -0
- google/cloud/spanner_v1/snapshot.py +1057 -0
- google/cloud/spanner_v1/streamed.py +402 -0
- google/cloud/spanner_v1/table.py +181 -0
- google/cloud/spanner_v1/testing/__init__.py +0 -0
- google/cloud/spanner_v1/testing/database_test.py +121 -0
- google/cloud/spanner_v1/testing/interceptors.py +118 -0
- google/cloud/spanner_v1/testing/mock_database_admin.py +38 -0
- google/cloud/spanner_v1/testing/mock_spanner.py +261 -0
- google/cloud/spanner_v1/testing/spanner_database_admin_pb2_grpc.py +1267 -0
- google/cloud/spanner_v1/testing/spanner_pb2_grpc.py +882 -0
- google/cloud/spanner_v1/transaction.py +747 -0
- google/cloud/spanner_v1/types/__init__.py +118 -0
- google/cloud/spanner_v1/types/commit_response.py +94 -0
- google/cloud/spanner_v1/types/keys.py +248 -0
- google/cloud/spanner_v1/types/mutation.py +201 -0
- google/cloud/spanner_v1/types/query_plan.py +220 -0
- google/cloud/spanner_v1/types/result_set.py +379 -0
- google/cloud/spanner_v1/types/spanner.py +1815 -0
- google/cloud/spanner_v1/types/transaction.py +818 -0
- google/cloud/spanner_v1/types/type.py +288 -0
- google_cloud_spanner-3.55.0.dist-info/LICENSE +202 -0
- google_cloud_spanner-3.55.0.dist-info/METADATA +318 -0
- google_cloud_spanner-3.55.0.dist-info/RECORD +119 -0
- google_cloud_spanner-3.55.0.dist-info/WHEEL +5 -0
- google_cloud_spanner-3.55.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,369 @@
|
|
|
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 backup
|
|
23
|
+
from google.protobuf import duration_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
|
+
"BackupScheduleSpec",
|
|
32
|
+
"BackupSchedule",
|
|
33
|
+
"CrontabSpec",
|
|
34
|
+
"CreateBackupScheduleRequest",
|
|
35
|
+
"GetBackupScheduleRequest",
|
|
36
|
+
"DeleteBackupScheduleRequest",
|
|
37
|
+
"ListBackupSchedulesRequest",
|
|
38
|
+
"ListBackupSchedulesResponse",
|
|
39
|
+
"UpdateBackupScheduleRequest",
|
|
40
|
+
},
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class BackupScheduleSpec(proto.Message):
|
|
45
|
+
r"""Defines specifications of the backup schedule.
|
|
46
|
+
|
|
47
|
+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
|
|
48
|
+
|
|
49
|
+
Attributes:
|
|
50
|
+
cron_spec (google.cloud.spanner_admin_database_v1.types.CrontabSpec):
|
|
51
|
+
Cron style schedule specification.
|
|
52
|
+
|
|
53
|
+
This field is a member of `oneof`_ ``schedule_spec``.
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
cron_spec: "CrontabSpec" = proto.Field(
|
|
57
|
+
proto.MESSAGE,
|
|
58
|
+
number=1,
|
|
59
|
+
oneof="schedule_spec",
|
|
60
|
+
message="CrontabSpec",
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class BackupSchedule(proto.Message):
|
|
65
|
+
r"""BackupSchedule expresses the automated backup creation
|
|
66
|
+
specification for a Spanner database.
|
|
67
|
+
Next ID: 10
|
|
68
|
+
|
|
69
|
+
This message has `oneof`_ fields (mutually exclusive fields).
|
|
70
|
+
For each oneof, at most one member field can be set at the same time.
|
|
71
|
+
Setting any member of the oneof automatically clears all other
|
|
72
|
+
members.
|
|
73
|
+
|
|
74
|
+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
|
|
75
|
+
|
|
76
|
+
Attributes:
|
|
77
|
+
name (str):
|
|
78
|
+
Identifier. Output only for the
|
|
79
|
+
[CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule]
|
|
80
|
+
operation. Required for the
|
|
81
|
+
[UpdateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule]
|
|
82
|
+
operation. A globally unique identifier for the backup
|
|
83
|
+
schedule which cannot be changed. Values are of the form
|
|
84
|
+
``projects/<project>/instances/<instance>/databases/<database>/backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]``
|
|
85
|
+
The final segment of the name must be between 2 and 60
|
|
86
|
+
characters in length.
|
|
87
|
+
spec (google.cloud.spanner_admin_database_v1.types.BackupScheduleSpec):
|
|
88
|
+
Optional. The schedule specification based on
|
|
89
|
+
which the backup creations are triggered.
|
|
90
|
+
retention_duration (google.protobuf.duration_pb2.Duration):
|
|
91
|
+
Optional. The retention duration of a backup
|
|
92
|
+
that must be at least 6 hours and at most 366
|
|
93
|
+
days. The backup is eligible to be automatically
|
|
94
|
+
deleted once the retention period has elapsed.
|
|
95
|
+
encryption_config (google.cloud.spanner_admin_database_v1.types.CreateBackupEncryptionConfig):
|
|
96
|
+
Optional. The encryption configuration that
|
|
97
|
+
will be used to encrypt the backup. If this
|
|
98
|
+
field is not specified, the backup will use the
|
|
99
|
+
same encryption configuration as the database.
|
|
100
|
+
full_backup_spec (google.cloud.spanner_admin_database_v1.types.FullBackupSpec):
|
|
101
|
+
The schedule creates only full backups.
|
|
102
|
+
|
|
103
|
+
This field is a member of `oneof`_ ``backup_type_spec``.
|
|
104
|
+
incremental_backup_spec (google.cloud.spanner_admin_database_v1.types.IncrementalBackupSpec):
|
|
105
|
+
The schedule creates incremental backup
|
|
106
|
+
chains.
|
|
107
|
+
|
|
108
|
+
This field is a member of `oneof`_ ``backup_type_spec``.
|
|
109
|
+
update_time (google.protobuf.timestamp_pb2.Timestamp):
|
|
110
|
+
Output only. The timestamp at which the
|
|
111
|
+
schedule was last updated. If the schedule has
|
|
112
|
+
never been updated, this field contains the
|
|
113
|
+
timestamp when the schedule was first created.
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
name: str = proto.Field(
|
|
117
|
+
proto.STRING,
|
|
118
|
+
number=1,
|
|
119
|
+
)
|
|
120
|
+
spec: "BackupScheduleSpec" = proto.Field(
|
|
121
|
+
proto.MESSAGE,
|
|
122
|
+
number=6,
|
|
123
|
+
message="BackupScheduleSpec",
|
|
124
|
+
)
|
|
125
|
+
retention_duration: duration_pb2.Duration = proto.Field(
|
|
126
|
+
proto.MESSAGE,
|
|
127
|
+
number=3,
|
|
128
|
+
message=duration_pb2.Duration,
|
|
129
|
+
)
|
|
130
|
+
encryption_config: backup.CreateBackupEncryptionConfig = proto.Field(
|
|
131
|
+
proto.MESSAGE,
|
|
132
|
+
number=4,
|
|
133
|
+
message=backup.CreateBackupEncryptionConfig,
|
|
134
|
+
)
|
|
135
|
+
full_backup_spec: backup.FullBackupSpec = proto.Field(
|
|
136
|
+
proto.MESSAGE,
|
|
137
|
+
number=7,
|
|
138
|
+
oneof="backup_type_spec",
|
|
139
|
+
message=backup.FullBackupSpec,
|
|
140
|
+
)
|
|
141
|
+
incremental_backup_spec: backup.IncrementalBackupSpec = proto.Field(
|
|
142
|
+
proto.MESSAGE,
|
|
143
|
+
number=8,
|
|
144
|
+
oneof="backup_type_spec",
|
|
145
|
+
message=backup.IncrementalBackupSpec,
|
|
146
|
+
)
|
|
147
|
+
update_time: timestamp_pb2.Timestamp = proto.Field(
|
|
148
|
+
proto.MESSAGE,
|
|
149
|
+
number=9,
|
|
150
|
+
message=timestamp_pb2.Timestamp,
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
class CrontabSpec(proto.Message):
|
|
155
|
+
r"""CrontabSpec can be used to specify the version time and
|
|
156
|
+
frequency at which the backup should be created.
|
|
157
|
+
|
|
158
|
+
Attributes:
|
|
159
|
+
text (str):
|
|
160
|
+
Required. Textual representation of the crontab. User can
|
|
161
|
+
customize the backup frequency and the backup version time
|
|
162
|
+
using the cron expression. The version time must be in UTC
|
|
163
|
+
timezone.
|
|
164
|
+
|
|
165
|
+
The backup will contain an externally consistent copy of the
|
|
166
|
+
database at the version time. Allowed frequencies are 12
|
|
167
|
+
hour, 1 day, 1 week and 1 month. Examples of valid cron
|
|
168
|
+
specifications:
|
|
169
|
+
|
|
170
|
+
- ``0 2/12 * * *`` : every 12 hours at (2, 14) hours past
|
|
171
|
+
midnight in UTC.
|
|
172
|
+
- ``0 2,14 * * *`` : every 12 hours at (2,14) hours past
|
|
173
|
+
midnight in UTC.
|
|
174
|
+
- ``0 2 * * *`` : once a day at 2 past midnight in UTC.
|
|
175
|
+
- ``0 2 * * 0`` : once a week every Sunday at 2 past
|
|
176
|
+
midnight in UTC.
|
|
177
|
+
- ``0 2 8 * *`` : once a month on 8th day at 2 past
|
|
178
|
+
midnight in UTC.
|
|
179
|
+
time_zone (str):
|
|
180
|
+
Output only. The time zone of the times in
|
|
181
|
+
``CrontabSpec.text``. Currently only UTC is supported.
|
|
182
|
+
creation_window (google.protobuf.duration_pb2.Duration):
|
|
183
|
+
Output only. Schedule backups will contain an externally
|
|
184
|
+
consistent copy of the database at the version time
|
|
185
|
+
specified in ``schedule_spec.cron_spec``. However, Spanner
|
|
186
|
+
may not initiate the creation of the scheduled backups at
|
|
187
|
+
that version time. Spanner will initiate the creation of
|
|
188
|
+
scheduled backups within the time window bounded by the
|
|
189
|
+
version_time specified in ``schedule_spec.cron_spec`` and
|
|
190
|
+
version_time + ``creation_window``.
|
|
191
|
+
"""
|
|
192
|
+
|
|
193
|
+
text: str = proto.Field(
|
|
194
|
+
proto.STRING,
|
|
195
|
+
number=1,
|
|
196
|
+
)
|
|
197
|
+
time_zone: str = proto.Field(
|
|
198
|
+
proto.STRING,
|
|
199
|
+
number=2,
|
|
200
|
+
)
|
|
201
|
+
creation_window: duration_pb2.Duration = proto.Field(
|
|
202
|
+
proto.MESSAGE,
|
|
203
|
+
number=3,
|
|
204
|
+
message=duration_pb2.Duration,
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
class CreateBackupScheduleRequest(proto.Message):
|
|
209
|
+
r"""The request for
|
|
210
|
+
[CreateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupSchedule].
|
|
211
|
+
|
|
212
|
+
Attributes:
|
|
213
|
+
parent (str):
|
|
214
|
+
Required. The name of the database that this
|
|
215
|
+
backup schedule applies to.
|
|
216
|
+
backup_schedule_id (str):
|
|
217
|
+
Required. The Id to use for the backup schedule. The
|
|
218
|
+
``backup_schedule_id`` appended to ``parent`` forms the full
|
|
219
|
+
backup schedule name of the form
|
|
220
|
+
``projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>``.
|
|
221
|
+
backup_schedule (google.cloud.spanner_admin_database_v1.types.BackupSchedule):
|
|
222
|
+
Required. The backup schedule to create.
|
|
223
|
+
"""
|
|
224
|
+
|
|
225
|
+
parent: str = proto.Field(
|
|
226
|
+
proto.STRING,
|
|
227
|
+
number=1,
|
|
228
|
+
)
|
|
229
|
+
backup_schedule_id: str = proto.Field(
|
|
230
|
+
proto.STRING,
|
|
231
|
+
number=2,
|
|
232
|
+
)
|
|
233
|
+
backup_schedule: "BackupSchedule" = proto.Field(
|
|
234
|
+
proto.MESSAGE,
|
|
235
|
+
number=3,
|
|
236
|
+
message="BackupSchedule",
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
class GetBackupScheduleRequest(proto.Message):
|
|
241
|
+
r"""The request for
|
|
242
|
+
[GetBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.GetBackupSchedule].
|
|
243
|
+
|
|
244
|
+
Attributes:
|
|
245
|
+
name (str):
|
|
246
|
+
Required. The name of the schedule to retrieve. Values are
|
|
247
|
+
of the form
|
|
248
|
+
``projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>``.
|
|
249
|
+
"""
|
|
250
|
+
|
|
251
|
+
name: str = proto.Field(
|
|
252
|
+
proto.STRING,
|
|
253
|
+
number=1,
|
|
254
|
+
)
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
class DeleteBackupScheduleRequest(proto.Message):
|
|
258
|
+
r"""The request for
|
|
259
|
+
[DeleteBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupSchedule].
|
|
260
|
+
|
|
261
|
+
Attributes:
|
|
262
|
+
name (str):
|
|
263
|
+
Required. The name of the schedule to delete. Values are of
|
|
264
|
+
the form
|
|
265
|
+
``projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>``.
|
|
266
|
+
"""
|
|
267
|
+
|
|
268
|
+
name: str = proto.Field(
|
|
269
|
+
proto.STRING,
|
|
270
|
+
number=1,
|
|
271
|
+
)
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
class ListBackupSchedulesRequest(proto.Message):
|
|
275
|
+
r"""The request for
|
|
276
|
+
[ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules].
|
|
277
|
+
|
|
278
|
+
Attributes:
|
|
279
|
+
parent (str):
|
|
280
|
+
Required. Database is the parent resource
|
|
281
|
+
whose backup schedules should be listed. Values
|
|
282
|
+
are of the form
|
|
283
|
+
projects/<project>/instances/<instance>/databases/<database>
|
|
284
|
+
page_size (int):
|
|
285
|
+
Optional. Number of backup schedules to be
|
|
286
|
+
returned in the response. If 0 or less, defaults
|
|
287
|
+
to the server's maximum allowed page size.
|
|
288
|
+
page_token (str):
|
|
289
|
+
Optional. If non-empty, ``page_token`` should contain a
|
|
290
|
+
[next_page_token][google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token]
|
|
291
|
+
from a previous
|
|
292
|
+
[ListBackupSchedulesResponse][google.spanner.admin.database.v1.ListBackupSchedulesResponse]
|
|
293
|
+
to the same ``parent``.
|
|
294
|
+
"""
|
|
295
|
+
|
|
296
|
+
parent: str = proto.Field(
|
|
297
|
+
proto.STRING,
|
|
298
|
+
number=1,
|
|
299
|
+
)
|
|
300
|
+
page_size: int = proto.Field(
|
|
301
|
+
proto.INT32,
|
|
302
|
+
number=2,
|
|
303
|
+
)
|
|
304
|
+
page_token: str = proto.Field(
|
|
305
|
+
proto.STRING,
|
|
306
|
+
number=4,
|
|
307
|
+
)
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
class ListBackupSchedulesResponse(proto.Message):
|
|
311
|
+
r"""The response for
|
|
312
|
+
[ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules].
|
|
313
|
+
|
|
314
|
+
Attributes:
|
|
315
|
+
backup_schedules (MutableSequence[google.cloud.spanner_admin_database_v1.types.BackupSchedule]):
|
|
316
|
+
The list of backup schedules for a database.
|
|
317
|
+
next_page_token (str):
|
|
318
|
+
``next_page_token`` can be sent in a subsequent
|
|
319
|
+
[ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]
|
|
320
|
+
call to fetch more of the schedules.
|
|
321
|
+
"""
|
|
322
|
+
|
|
323
|
+
@property
|
|
324
|
+
def raw_page(self):
|
|
325
|
+
return self
|
|
326
|
+
|
|
327
|
+
backup_schedules: MutableSequence["BackupSchedule"] = proto.RepeatedField(
|
|
328
|
+
proto.MESSAGE,
|
|
329
|
+
number=1,
|
|
330
|
+
message="BackupSchedule",
|
|
331
|
+
)
|
|
332
|
+
next_page_token: str = proto.Field(
|
|
333
|
+
proto.STRING,
|
|
334
|
+
number=2,
|
|
335
|
+
)
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
class UpdateBackupScheduleRequest(proto.Message):
|
|
339
|
+
r"""The request for
|
|
340
|
+
[UpdateBackupScheduleRequest][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule].
|
|
341
|
+
|
|
342
|
+
Attributes:
|
|
343
|
+
backup_schedule (google.cloud.spanner_admin_database_v1.types.BackupSchedule):
|
|
344
|
+
Required. The backup schedule to update.
|
|
345
|
+
``backup_schedule.name``, and the fields to be updated as
|
|
346
|
+
specified by ``update_mask`` are required. Other fields are
|
|
347
|
+
ignored.
|
|
348
|
+
update_mask (google.protobuf.field_mask_pb2.FieldMask):
|
|
349
|
+
Required. A mask specifying which fields in
|
|
350
|
+
the BackupSchedule resource should be updated.
|
|
351
|
+
This mask is relative to the BackupSchedule
|
|
352
|
+
resource, not to the request message. The field
|
|
353
|
+
mask must always be specified; this prevents any
|
|
354
|
+
future fields from being erased accidentally.
|
|
355
|
+
"""
|
|
356
|
+
|
|
357
|
+
backup_schedule: "BackupSchedule" = proto.Field(
|
|
358
|
+
proto.MESSAGE,
|
|
359
|
+
number=1,
|
|
360
|
+
message="BackupSchedule",
|
|
361
|
+
)
|
|
362
|
+
update_mask: field_mask_pb2.FieldMask = proto.Field(
|
|
363
|
+
proto.MESSAGE,
|
|
364
|
+
number=2,
|
|
365
|
+
message=field_mask_pb2.FieldMask,
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
__all__ = tuple(sorted(__protobuf__.manifest))
|
|
@@ -0,0 +1,180 @@
|
|
|
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.protobuf import timestamp_pb2 # type: ignore
|
|
23
|
+
from google.rpc import status_pb2 # type: ignore
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
__protobuf__ = proto.module(
|
|
27
|
+
package="google.spanner.admin.database.v1",
|
|
28
|
+
manifest={
|
|
29
|
+
"DatabaseDialect",
|
|
30
|
+
"OperationProgress",
|
|
31
|
+
"EncryptionConfig",
|
|
32
|
+
"EncryptionInfo",
|
|
33
|
+
},
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class DatabaseDialect(proto.Enum):
|
|
38
|
+
r"""Indicates the dialect type of a database.
|
|
39
|
+
|
|
40
|
+
Values:
|
|
41
|
+
DATABASE_DIALECT_UNSPECIFIED (0):
|
|
42
|
+
Default value. This value will create a database with the
|
|
43
|
+
GOOGLE_STANDARD_SQL dialect.
|
|
44
|
+
GOOGLE_STANDARD_SQL (1):
|
|
45
|
+
GoogleSQL supported SQL.
|
|
46
|
+
POSTGRESQL (2):
|
|
47
|
+
PostgreSQL supported SQL.
|
|
48
|
+
"""
|
|
49
|
+
DATABASE_DIALECT_UNSPECIFIED = 0
|
|
50
|
+
GOOGLE_STANDARD_SQL = 1
|
|
51
|
+
POSTGRESQL = 2
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class OperationProgress(proto.Message):
|
|
55
|
+
r"""Encapsulates progress related information for a Cloud Spanner
|
|
56
|
+
long running operation.
|
|
57
|
+
|
|
58
|
+
Attributes:
|
|
59
|
+
progress_percent (int):
|
|
60
|
+
Percent completion of the operation.
|
|
61
|
+
Values are between 0 and 100 inclusive.
|
|
62
|
+
start_time (google.protobuf.timestamp_pb2.Timestamp):
|
|
63
|
+
Time the request was received.
|
|
64
|
+
end_time (google.protobuf.timestamp_pb2.Timestamp):
|
|
65
|
+
If set, the time at which this operation
|
|
66
|
+
failed or was completed successfully.
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
progress_percent: int = proto.Field(
|
|
70
|
+
proto.INT32,
|
|
71
|
+
number=1,
|
|
72
|
+
)
|
|
73
|
+
start_time: timestamp_pb2.Timestamp = proto.Field(
|
|
74
|
+
proto.MESSAGE,
|
|
75
|
+
number=2,
|
|
76
|
+
message=timestamp_pb2.Timestamp,
|
|
77
|
+
)
|
|
78
|
+
end_time: timestamp_pb2.Timestamp = proto.Field(
|
|
79
|
+
proto.MESSAGE,
|
|
80
|
+
number=3,
|
|
81
|
+
message=timestamp_pb2.Timestamp,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class EncryptionConfig(proto.Message):
|
|
86
|
+
r"""Encryption configuration for a Cloud Spanner database.
|
|
87
|
+
|
|
88
|
+
Attributes:
|
|
89
|
+
kms_key_name (str):
|
|
90
|
+
The Cloud KMS key to be used for encrypting and decrypting
|
|
91
|
+
the database. Values are of the form
|
|
92
|
+
``projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>``.
|
|
93
|
+
kms_key_names (MutableSequence[str]):
|
|
94
|
+
Specifies the KMS configuration for the one or more keys
|
|
95
|
+
used to encrypt the database. Values are of the form
|
|
96
|
+
``projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>``.
|
|
97
|
+
|
|
98
|
+
The keys referenced by kms_key_names must fully cover all
|
|
99
|
+
regions of the database instance configuration. Some
|
|
100
|
+
examples:
|
|
101
|
+
|
|
102
|
+
- For single region database instance configs, specify a
|
|
103
|
+
single regional location KMS key.
|
|
104
|
+
- For multi-regional database instance configs of type
|
|
105
|
+
GOOGLE_MANAGED, either specify a multi-regional location
|
|
106
|
+
KMS key or multiple regional location KMS keys that cover
|
|
107
|
+
all regions in the instance config.
|
|
108
|
+
- For a database instance config of type USER_MANAGED,
|
|
109
|
+
please specify only regional location KMS keys to cover
|
|
110
|
+
each region in the instance config. Multi-regional
|
|
111
|
+
location KMS keys are not supported for USER_MANAGED
|
|
112
|
+
instance configs.
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
kms_key_name: str = proto.Field(
|
|
116
|
+
proto.STRING,
|
|
117
|
+
number=2,
|
|
118
|
+
)
|
|
119
|
+
kms_key_names: MutableSequence[str] = proto.RepeatedField(
|
|
120
|
+
proto.STRING,
|
|
121
|
+
number=3,
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
class EncryptionInfo(proto.Message):
|
|
126
|
+
r"""Encryption information for a Cloud Spanner database or
|
|
127
|
+
backup.
|
|
128
|
+
|
|
129
|
+
Attributes:
|
|
130
|
+
encryption_type (google.cloud.spanner_admin_database_v1.types.EncryptionInfo.Type):
|
|
131
|
+
Output only. The type of encryption.
|
|
132
|
+
encryption_status (google.rpc.status_pb2.Status):
|
|
133
|
+
Output only. If present, the status of a
|
|
134
|
+
recent encrypt/decrypt call on underlying data
|
|
135
|
+
for this database or backup. Regardless of
|
|
136
|
+
status, data is always encrypted at rest.
|
|
137
|
+
kms_key_version (str):
|
|
138
|
+
Output only. A Cloud KMS key version that is
|
|
139
|
+
being used to protect the database or backup.
|
|
140
|
+
"""
|
|
141
|
+
|
|
142
|
+
class Type(proto.Enum):
|
|
143
|
+
r"""Possible encryption types.
|
|
144
|
+
|
|
145
|
+
Values:
|
|
146
|
+
TYPE_UNSPECIFIED (0):
|
|
147
|
+
Encryption type was not specified, though
|
|
148
|
+
data at rest remains encrypted.
|
|
149
|
+
GOOGLE_DEFAULT_ENCRYPTION (1):
|
|
150
|
+
The data is encrypted at rest with a key that
|
|
151
|
+
is fully managed by Google. No key version or
|
|
152
|
+
status will be populated. This is the default
|
|
153
|
+
state.
|
|
154
|
+
CUSTOMER_MANAGED_ENCRYPTION (2):
|
|
155
|
+
The data is encrypted at rest with a key that is managed by
|
|
156
|
+
the customer. The active version of the key.
|
|
157
|
+
``kms_key_version`` will be populated, and
|
|
158
|
+
``encryption_status`` may be populated.
|
|
159
|
+
"""
|
|
160
|
+
TYPE_UNSPECIFIED = 0
|
|
161
|
+
GOOGLE_DEFAULT_ENCRYPTION = 1
|
|
162
|
+
CUSTOMER_MANAGED_ENCRYPTION = 2
|
|
163
|
+
|
|
164
|
+
encryption_type: Type = proto.Field(
|
|
165
|
+
proto.ENUM,
|
|
166
|
+
number=3,
|
|
167
|
+
enum=Type,
|
|
168
|
+
)
|
|
169
|
+
encryption_status: status_pb2.Status = proto.Field(
|
|
170
|
+
proto.MESSAGE,
|
|
171
|
+
number=4,
|
|
172
|
+
message=status_pb2.Status,
|
|
173
|
+
)
|
|
174
|
+
kms_key_version: str = proto.Field(
|
|
175
|
+
proto.STRING,
|
|
176
|
+
number=2,
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
__all__ = tuple(sorted(__protobuf__.manifest))
|