google-cloud-bigtable 2.30.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 (115) hide show
  1. google/cloud/bigtable/__init__.py +25 -0
  2. google/cloud/bigtable/app_profile.py +377 -0
  3. google/cloud/bigtable/backup.py +490 -0
  4. google/cloud/bigtable/batcher.py +414 -0
  5. google/cloud/bigtable/client.py +475 -0
  6. google/cloud/bigtable/cluster.py +541 -0
  7. google/cloud/bigtable/column_family.py +362 -0
  8. google/cloud/bigtable/data/__init__.py +103 -0
  9. google/cloud/bigtable/data/_async/__init__.py +25 -0
  10. google/cloud/bigtable/data/_async/_mutate_rows.py +226 -0
  11. google/cloud/bigtable/data/_async/_read_rows.py +363 -0
  12. google/cloud/bigtable/data/_async/client.py +1522 -0
  13. google/cloud/bigtable/data/_async/mutations_batcher.py +534 -0
  14. google/cloud/bigtable/data/_cross_sync/__init__.py +20 -0
  15. google/cloud/bigtable/data/_cross_sync/_decorators.py +441 -0
  16. google/cloud/bigtable/data/_cross_sync/_mapping_meta.py +64 -0
  17. google/cloud/bigtable/data/_cross_sync/cross_sync.py +334 -0
  18. google/cloud/bigtable/data/_helpers.py +249 -0
  19. google/cloud/bigtable/data/_sync_autogen/_mutate_rows.py +182 -0
  20. google/cloud/bigtable/data/_sync_autogen/_read_rows.py +304 -0
  21. google/cloud/bigtable/data/_sync_autogen/client.py +1293 -0
  22. google/cloud/bigtable/data/_sync_autogen/mutations_batcher.py +449 -0
  23. google/cloud/bigtable/data/exceptions.py +340 -0
  24. google/cloud/bigtable/data/execute_query/__init__.py +43 -0
  25. google/cloud/bigtable/data/execute_query/_async/__init__.py +13 -0
  26. google/cloud/bigtable/data/execute_query/_async/execute_query_iterator.py +291 -0
  27. google/cloud/bigtable/data/execute_query/_byte_cursor.py +123 -0
  28. google/cloud/bigtable/data/execute_query/_checksum.py +43 -0
  29. google/cloud/bigtable/data/execute_query/_parameters_formatting.py +155 -0
  30. google/cloud/bigtable/data/execute_query/_query_result_parsing_utils.py +134 -0
  31. google/cloud/bigtable/data/execute_query/_reader.py +122 -0
  32. google/cloud/bigtable/data/execute_query/_sync_autogen/execute_query_iterator.py +239 -0
  33. google/cloud/bigtable/data/execute_query/metadata.py +399 -0
  34. google/cloud/bigtable/data/execute_query/values.py +123 -0
  35. google/cloud/bigtable/data/mutations.py +380 -0
  36. google/cloud/bigtable/data/read_modify_write_rules.py +112 -0
  37. google/cloud/bigtable/data/read_rows_query.py +536 -0
  38. google/cloud/bigtable/data/row.py +535 -0
  39. google/cloud/bigtable/data/row_filters.py +968 -0
  40. google/cloud/bigtable/encryption_info.py +64 -0
  41. google/cloud/bigtable/enums.py +223 -0
  42. google/cloud/bigtable/error.py +64 -0
  43. google/cloud/bigtable/gapic_version.py +16 -0
  44. google/cloud/bigtable/helpers.py +31 -0
  45. google/cloud/bigtable/instance.py +789 -0
  46. google/cloud/bigtable/policy.py +255 -0
  47. google/cloud/bigtable/row.py +1267 -0
  48. google/cloud/bigtable/row_data.py +380 -0
  49. google/cloud/bigtable/row_filters.py +838 -0
  50. google/cloud/bigtable/row_merger.py +250 -0
  51. google/cloud/bigtable/row_set.py +213 -0
  52. google/cloud/bigtable/table.py +1409 -0
  53. google/cloud/bigtable_admin/__init__.py +410 -0
  54. google/cloud/bigtable_admin/gapic_version.py +16 -0
  55. google/cloud/bigtable_admin/py.typed +2 -0
  56. google/cloud/bigtable_admin_v2/__init__.py +250 -0
  57. google/cloud/bigtable_admin_v2/gapic_metadata.json +962 -0
  58. google/cloud/bigtable_admin_v2/gapic_version.py +16 -0
  59. google/cloud/bigtable_admin_v2/py.typed +2 -0
  60. google/cloud/bigtable_admin_v2/services/__init__.py +15 -0
  61. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/__init__.py +22 -0
  62. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/async_client.py +3465 -0
  63. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/client.py +3944 -0
  64. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/pagers.py +681 -0
  65. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/__init__.py +40 -0
  66. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/base.py +751 -0
  67. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc.py +1249 -0
  68. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc_asyncio.py +1579 -0
  69. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest.py +6820 -0
  70. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest_base.py +1746 -0
  71. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/__init__.py +22 -0
  72. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/async_client.py +3472 -0
  73. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/client.py +3949 -0
  74. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/pagers.py +669 -0
  75. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/__init__.py +40 -0
  76. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/base.py +708 -0
  77. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc.py +1257 -0
  78. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc_asyncio.py +1549 -0
  79. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest.py +6609 -0
  80. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest_base.py +1714 -0
  81. google/cloud/bigtable_admin_v2/types/__init__.py +248 -0
  82. google/cloud/bigtable_admin_v2/types/bigtable_instance_admin.py +1364 -0
  83. google/cloud/bigtable_admin_v2/types/bigtable_table_admin.py +1715 -0
  84. google/cloud/bigtable_admin_v2/types/common.py +81 -0
  85. google/cloud/bigtable_admin_v2/types/instance.py +819 -0
  86. google/cloud/bigtable_admin_v2/types/table.py +1028 -0
  87. google/cloud/bigtable_admin_v2/types/types.py +776 -0
  88. google/cloud/bigtable_v2/__init__.py +136 -0
  89. google/cloud/bigtable_v2/gapic_metadata.json +193 -0
  90. google/cloud/bigtable_v2/gapic_version.py +16 -0
  91. google/cloud/bigtable_v2/py.typed +2 -0
  92. google/cloud/bigtable_v2/services/__init__.py +15 -0
  93. google/cloud/bigtable_v2/services/bigtable/__init__.py +22 -0
  94. google/cloud/bigtable_v2/services/bigtable/async_client.py +1741 -0
  95. google/cloud/bigtable_v2/services/bigtable/client.py +2194 -0
  96. google/cloud/bigtable_v2/services/bigtable/transports/__init__.py +38 -0
  97. google/cloud/bigtable_v2/services/bigtable/transports/base.py +343 -0
  98. google/cloud/bigtable_v2/services/bigtable/transports/grpc.py +660 -0
  99. google/cloud/bigtable_v2/services/bigtable/transports/grpc_asyncio.py +762 -0
  100. google/cloud/bigtable_v2/services/bigtable/transports/rest.py +2489 -0
  101. google/cloud/bigtable_v2/services/bigtable/transports/rest_base.py +711 -0
  102. google/cloud/bigtable_v2/types/__init__.py +138 -0
  103. google/cloud/bigtable_v2/types/bigtable.py +1531 -0
  104. google/cloud/bigtable_v2/types/data.py +1612 -0
  105. google/cloud/bigtable_v2/types/feature_flags.py +119 -0
  106. google/cloud/bigtable_v2/types/request_stats.py +171 -0
  107. google/cloud/bigtable_v2/types/response_params.py +64 -0
  108. google/cloud/bigtable_v2/types/types.py +579 -0
  109. google_cloud_bigtable-2.30.0.data/scripts/fixup_bigtable_admin_v2_keywords.py +233 -0
  110. google_cloud_bigtable-2.30.0.data/scripts/fixup_bigtable_v2_keywords.py +186 -0
  111. google_cloud_bigtable-2.30.0.dist-info/LICENSE +202 -0
  112. google_cloud_bigtable-2.30.0.dist-info/METADATA +154 -0
  113. google_cloud_bigtable-2.30.0.dist-info/RECORD +115 -0
  114. google_cloud_bigtable-2.30.0.dist-info/WHEEL +5 -0
  115. google_cloud_bigtable-2.30.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1028 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 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.bigtable_admin_v2.types import types
23
+ from google.protobuf import duration_pb2 # type: ignore
24
+ from google.protobuf import timestamp_pb2 # type: ignore
25
+ from google.rpc import status_pb2 # type: ignore
26
+
27
+
28
+ __protobuf__ = proto.module(
29
+ package="google.bigtable.admin.v2",
30
+ manifest={
31
+ "RestoreSourceType",
32
+ "RestoreInfo",
33
+ "ChangeStreamConfig",
34
+ "Table",
35
+ "AuthorizedView",
36
+ "ColumnFamily",
37
+ "GcRule",
38
+ "EncryptionInfo",
39
+ "Snapshot",
40
+ "Backup",
41
+ "BackupInfo",
42
+ },
43
+ )
44
+
45
+
46
+ class RestoreSourceType(proto.Enum):
47
+ r"""Indicates the type of the restore source.
48
+
49
+ Values:
50
+ RESTORE_SOURCE_TYPE_UNSPECIFIED (0):
51
+ No restore associated.
52
+ BACKUP (1):
53
+ A backup was used as the source of the
54
+ restore.
55
+ """
56
+ RESTORE_SOURCE_TYPE_UNSPECIFIED = 0
57
+ BACKUP = 1
58
+
59
+
60
+ class RestoreInfo(proto.Message):
61
+ r"""Information about a table restore.
62
+
63
+ .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
64
+
65
+ Attributes:
66
+ source_type (google.cloud.bigtable_admin_v2.types.RestoreSourceType):
67
+ The type of the restore source.
68
+ backup_info (google.cloud.bigtable_admin_v2.types.BackupInfo):
69
+ Information about the backup used to restore
70
+ the table. The backup may no longer exist.
71
+
72
+ This field is a member of `oneof`_ ``source_info``.
73
+ """
74
+
75
+ source_type: "RestoreSourceType" = proto.Field(
76
+ proto.ENUM,
77
+ number=1,
78
+ enum="RestoreSourceType",
79
+ )
80
+ backup_info: "BackupInfo" = proto.Field(
81
+ proto.MESSAGE,
82
+ number=2,
83
+ oneof="source_info",
84
+ message="BackupInfo",
85
+ )
86
+
87
+
88
+ class ChangeStreamConfig(proto.Message):
89
+ r"""Change stream configuration.
90
+
91
+ Attributes:
92
+ retention_period (google.protobuf.duration_pb2.Duration):
93
+ How long the change stream should be
94
+ retained. Change stream data older than the
95
+ retention period will not be returned when
96
+ reading the change stream from the table.
97
+ Values must be at least 1 day and at most 7
98
+ days, and will be truncated to microsecond
99
+ granularity.
100
+ """
101
+
102
+ retention_period: duration_pb2.Duration = proto.Field(
103
+ proto.MESSAGE,
104
+ number=1,
105
+ message=duration_pb2.Duration,
106
+ )
107
+
108
+
109
+ class Table(proto.Message):
110
+ r"""A collection of user data indexed by row, column, and
111
+ timestamp. Each table is served using the resources of its
112
+ parent cluster.
113
+
114
+
115
+ .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
116
+
117
+ Attributes:
118
+ name (str):
119
+ The unique name of the table. Values are of the form
120
+ ``projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*``.
121
+ Views: ``NAME_ONLY``, ``SCHEMA_VIEW``, ``REPLICATION_VIEW``,
122
+ ``FULL``
123
+ cluster_states (MutableMapping[str, google.cloud.bigtable_admin_v2.types.Table.ClusterState]):
124
+ Output only. Map from cluster ID to per-cluster table state.
125
+ If it could not be determined whether or not the table has
126
+ data in a particular cluster (for example, if its zone is
127
+ unavailable), then there will be an entry for the cluster
128
+ with UNKNOWN ``replication_status``. Views:
129
+ ``REPLICATION_VIEW``, ``ENCRYPTION_VIEW``, ``FULL``
130
+ column_families (MutableMapping[str, google.cloud.bigtable_admin_v2.types.ColumnFamily]):
131
+ The column families configured for this table, mapped by
132
+ column family ID. Views: ``SCHEMA_VIEW``, ``STATS_VIEW``,
133
+ ``FULL``
134
+ granularity (google.cloud.bigtable_admin_v2.types.Table.TimestampGranularity):
135
+ Immutable. The granularity (i.e. ``MILLIS``) at which
136
+ timestamps are stored in this table. Timestamps not matching
137
+ the granularity will be rejected. If unspecified at creation
138
+ time, the value will be set to ``MILLIS``. Views:
139
+ ``SCHEMA_VIEW``, ``FULL``.
140
+ restore_info (google.cloud.bigtable_admin_v2.types.RestoreInfo):
141
+ Output only. If this table was restored from
142
+ another data source (e.g. a backup), this field
143
+ will be populated with information about the
144
+ restore.
145
+ change_stream_config (google.cloud.bigtable_admin_v2.types.ChangeStreamConfig):
146
+ If specified, enable the change stream on
147
+ this table. Otherwise, the change stream is
148
+ disabled and the change stream is not retained.
149
+ deletion_protection (bool):
150
+ Set to true to make the table protected against data loss.
151
+ i.e. deleting the following resources through Admin APIs are
152
+ prohibited:
153
+
154
+ - The table.
155
+ - The column families in the table.
156
+ - The instance containing the table.
157
+
158
+ Note one can still delete the data stored in the table
159
+ through Data APIs.
160
+ automated_backup_policy (google.cloud.bigtable_admin_v2.types.Table.AutomatedBackupPolicy):
161
+ If specified, automated backups are enabled
162
+ for this table. Otherwise, automated backups are
163
+ disabled.
164
+
165
+ This field is a member of `oneof`_ ``automated_backup_config``.
166
+ row_key_schema (google.cloud.bigtable_admin_v2.types.Type.Struct):
167
+ The row key schema for this table. The schema is used to
168
+ decode the raw row key bytes into a structured format. The
169
+ order of field declarations in this schema is important, as
170
+ it reflects how the raw row key bytes are structured.
171
+ Currently, this only affects how the key is read via a
172
+ GoogleSQL query from the ExecuteQuery API.
173
+
174
+ For a SQL query, the \_key column is still read as raw
175
+ bytes. But queries can reference the key fields by name,
176
+ which will be decoded from \_key using provided type and
177
+ encoding. Queries that reference key fields will fail if
178
+ they encounter an invalid row key.
179
+
180
+ For example, if \_key =
181
+ "some_id#2024-04-30#\x00\x13\x00\xf3" with the following
182
+ schema: { fields { field_name: "id" type { string {
183
+ encoding: utf8_bytes {} } } } fields { field_name: "date"
184
+ type { string { encoding: utf8_bytes {} } } } fields {
185
+ field_name: "product_code" type { int64 { encoding:
186
+ big_endian_bytes {} } } } encoding { delimited_bytes {
187
+ delimiter: "#" } } }
188
+
189
+ | The decoded key parts would be: id = "some_id", date =
190
+ "2024-04-30", product_code = 1245427 The query "SELECT
191
+ \_key, product_code FROM table" will return two columns:
192
+ /------------------------------------------------------
193
+ | \| \_key \| product_code \| \|
194
+ --------------------------------------|--------------\| \|
195
+ "some_id#2024-04-30#\x00\x13\x00\xf3" \| 1245427 \|
196
+ ------------------------------------------------------/
197
+
198
+ The schema has the following invariants: (1) The decoded
199
+ field values are order-preserved. For read, the field values
200
+ will be decoded in sorted mode from the raw bytes. (2) Every
201
+ field in the schema must specify a non-empty name. (3) Every
202
+ field must specify a type with an associated encoding. The
203
+ type is limited to scalar types only: Array, Map, Aggregate,
204
+ and Struct are not allowed. (4) The field names must not
205
+ collide with existing column family names and reserved
206
+ keywords "_key" and "_timestamp".
207
+
208
+ The following update operations are allowed for
209
+ row_key_schema:
210
+
211
+ - Update from an empty schema to a new schema.
212
+ - Remove the existing schema. This operation requires
213
+ setting the ``ignore_warnings`` flag to ``true``, since
214
+ it might be a backward incompatible change. Without the
215
+ flag, the update request will fail with an
216
+ INVALID_ARGUMENT error. Any other row key schema update
217
+ operation (e.g. update existing schema columns names or
218
+ types) is currently unsupported.
219
+ """
220
+
221
+ class TimestampGranularity(proto.Enum):
222
+ r"""Possible timestamp granularities to use when keeping multiple
223
+ versions of data in a table.
224
+
225
+ Values:
226
+ TIMESTAMP_GRANULARITY_UNSPECIFIED (0):
227
+ The user did not specify a granularity.
228
+ Should not be returned. When specified during
229
+ table creation, MILLIS will be used.
230
+ MILLIS (1):
231
+ The table keeps data versioned at a
232
+ granularity of 1ms.
233
+ """
234
+ TIMESTAMP_GRANULARITY_UNSPECIFIED = 0
235
+ MILLIS = 1
236
+
237
+ class View(proto.Enum):
238
+ r"""Defines a view over a table's fields.
239
+
240
+ Values:
241
+ VIEW_UNSPECIFIED (0):
242
+ Uses the default view for each method as
243
+ documented in its request.
244
+ NAME_ONLY (1):
245
+ Only populates ``name``.
246
+ SCHEMA_VIEW (2):
247
+ Only populates ``name`` and fields related to the table's
248
+ schema.
249
+ REPLICATION_VIEW (3):
250
+ Only populates ``name`` and fields related to the table's
251
+ replication state.
252
+ ENCRYPTION_VIEW (5):
253
+ Only populates ``name`` and fields related to the table's
254
+ encryption state.
255
+ FULL (4):
256
+ Populates all fields.
257
+ """
258
+ VIEW_UNSPECIFIED = 0
259
+ NAME_ONLY = 1
260
+ SCHEMA_VIEW = 2
261
+ REPLICATION_VIEW = 3
262
+ ENCRYPTION_VIEW = 5
263
+ FULL = 4
264
+
265
+ class ClusterState(proto.Message):
266
+ r"""The state of a table's data in a particular cluster.
267
+
268
+ Attributes:
269
+ replication_state (google.cloud.bigtable_admin_v2.types.Table.ClusterState.ReplicationState):
270
+ Output only. The state of replication for the
271
+ table in this cluster.
272
+ encryption_info (MutableSequence[google.cloud.bigtable_admin_v2.types.EncryptionInfo]):
273
+ Output only. The encryption information for
274
+ the table in this cluster. If the encryption key
275
+ protecting this resource is customer managed,
276
+ then its version can be rotated in Cloud Key
277
+ Management Service (Cloud KMS). The primary
278
+ version of the key and its status will be
279
+ reflected here when changes propagate from Cloud
280
+ KMS.
281
+ """
282
+
283
+ class ReplicationState(proto.Enum):
284
+ r"""Table replication states.
285
+
286
+ Values:
287
+ STATE_NOT_KNOWN (0):
288
+ The replication state of the table is unknown
289
+ in this cluster.
290
+ INITIALIZING (1):
291
+ The cluster was recently created, and the
292
+ table must finish copying over pre-existing data
293
+ from other clusters before it can begin
294
+ receiving live replication updates and serving
295
+ Data API requests.
296
+ PLANNED_MAINTENANCE (2):
297
+ The table is temporarily unable to serve Data
298
+ API requests from this cluster due to planned
299
+ internal maintenance.
300
+ UNPLANNED_MAINTENANCE (3):
301
+ The table is temporarily unable to serve Data
302
+ API requests from this cluster due to unplanned
303
+ or emergency maintenance.
304
+ READY (4):
305
+ The table can serve Data API requests from
306
+ this cluster. Depending on replication delay,
307
+ reads may not immediately reflect the state of
308
+ the table in other clusters.
309
+ READY_OPTIMIZING (5):
310
+ The table is fully created and ready for use after a
311
+ restore, and is being optimized for performance. When
312
+ optimizations are complete, the table will transition to
313
+ ``READY`` state.
314
+ """
315
+ STATE_NOT_KNOWN = 0
316
+ INITIALIZING = 1
317
+ PLANNED_MAINTENANCE = 2
318
+ UNPLANNED_MAINTENANCE = 3
319
+ READY = 4
320
+ READY_OPTIMIZING = 5
321
+
322
+ replication_state: "Table.ClusterState.ReplicationState" = proto.Field(
323
+ proto.ENUM,
324
+ number=1,
325
+ enum="Table.ClusterState.ReplicationState",
326
+ )
327
+ encryption_info: MutableSequence["EncryptionInfo"] = proto.RepeatedField(
328
+ proto.MESSAGE,
329
+ number=2,
330
+ message="EncryptionInfo",
331
+ )
332
+
333
+ class AutomatedBackupPolicy(proto.Message):
334
+ r"""Defines an automated backup policy for a table
335
+
336
+ Attributes:
337
+ retention_period (google.protobuf.duration_pb2.Duration):
338
+ Required. How long the automated backups
339
+ should be retained. The only supported value at
340
+ this time is 3 days.
341
+ frequency (google.protobuf.duration_pb2.Duration):
342
+ Required. How frequently automated backups
343
+ should occur. The only supported value at this
344
+ time is 24 hours.
345
+ """
346
+
347
+ retention_period: duration_pb2.Duration = proto.Field(
348
+ proto.MESSAGE,
349
+ number=1,
350
+ message=duration_pb2.Duration,
351
+ )
352
+ frequency: duration_pb2.Duration = proto.Field(
353
+ proto.MESSAGE,
354
+ number=2,
355
+ message=duration_pb2.Duration,
356
+ )
357
+
358
+ name: str = proto.Field(
359
+ proto.STRING,
360
+ number=1,
361
+ )
362
+ cluster_states: MutableMapping[str, ClusterState] = proto.MapField(
363
+ proto.STRING,
364
+ proto.MESSAGE,
365
+ number=2,
366
+ message=ClusterState,
367
+ )
368
+ column_families: MutableMapping[str, "ColumnFamily"] = proto.MapField(
369
+ proto.STRING,
370
+ proto.MESSAGE,
371
+ number=3,
372
+ message="ColumnFamily",
373
+ )
374
+ granularity: TimestampGranularity = proto.Field(
375
+ proto.ENUM,
376
+ number=4,
377
+ enum=TimestampGranularity,
378
+ )
379
+ restore_info: "RestoreInfo" = proto.Field(
380
+ proto.MESSAGE,
381
+ number=6,
382
+ message="RestoreInfo",
383
+ )
384
+ change_stream_config: "ChangeStreamConfig" = proto.Field(
385
+ proto.MESSAGE,
386
+ number=8,
387
+ message="ChangeStreamConfig",
388
+ )
389
+ deletion_protection: bool = proto.Field(
390
+ proto.BOOL,
391
+ number=9,
392
+ )
393
+ automated_backup_policy: AutomatedBackupPolicy = proto.Field(
394
+ proto.MESSAGE,
395
+ number=13,
396
+ oneof="automated_backup_config",
397
+ message=AutomatedBackupPolicy,
398
+ )
399
+ row_key_schema: types.Type.Struct = proto.Field(
400
+ proto.MESSAGE,
401
+ number=15,
402
+ message=types.Type.Struct,
403
+ )
404
+
405
+
406
+ class AuthorizedView(proto.Message):
407
+ r"""AuthorizedViews represent subsets of a particular Cloud
408
+ Bigtable table. Users can configure access to each Authorized
409
+ View independently from the table and use the existing Data APIs
410
+ to access the subset of data.
411
+
412
+
413
+ .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
414
+
415
+ Attributes:
416
+ name (str):
417
+ Identifier. The name of this AuthorizedView. Values are of
418
+ the form
419
+ ``projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}``
420
+ subset_view (google.cloud.bigtable_admin_v2.types.AuthorizedView.SubsetView):
421
+ An AuthorizedView permitting access to an
422
+ explicit subset of a Table.
423
+
424
+ This field is a member of `oneof`_ ``authorized_view``.
425
+ etag (str):
426
+ The etag for this AuthorizedView.
427
+ If this is provided on update, it must match the
428
+ server's etag. The server returns ABORTED error
429
+ on a mismatched etag.
430
+ deletion_protection (bool):
431
+ Set to true to make the AuthorizedView
432
+ protected against deletion. The parent Table and
433
+ containing Instance cannot be deleted if an
434
+ AuthorizedView has this bit set.
435
+ """
436
+
437
+ class ResponseView(proto.Enum):
438
+ r"""Defines a subset of an AuthorizedView's fields.
439
+
440
+ Values:
441
+ RESPONSE_VIEW_UNSPECIFIED (0):
442
+ Uses the default view for each method as
443
+ documented in the request.
444
+ NAME_ONLY (1):
445
+ Only populates ``name``.
446
+ BASIC (2):
447
+ Only populates the AuthorizedView's basic metadata. This
448
+ includes: name, deletion_protection, etag.
449
+ FULL (3):
450
+ Populates every fields.
451
+ """
452
+ RESPONSE_VIEW_UNSPECIFIED = 0
453
+ NAME_ONLY = 1
454
+ BASIC = 2
455
+ FULL = 3
456
+
457
+ class FamilySubsets(proto.Message):
458
+ r"""Subsets of a column family that are included in this
459
+ AuthorizedView.
460
+
461
+ Attributes:
462
+ qualifiers (MutableSequence[bytes]):
463
+ Individual exact column qualifiers to be
464
+ included in the AuthorizedView.
465
+ qualifier_prefixes (MutableSequence[bytes]):
466
+ Prefixes for qualifiers to be included in the
467
+ AuthorizedView. Every qualifier starting with
468
+ one of these prefixes is included in the
469
+ AuthorizedView. To provide access to all
470
+ qualifiers, include the empty string as a prefix
471
+ ("").
472
+ """
473
+
474
+ qualifiers: MutableSequence[bytes] = proto.RepeatedField(
475
+ proto.BYTES,
476
+ number=1,
477
+ )
478
+ qualifier_prefixes: MutableSequence[bytes] = proto.RepeatedField(
479
+ proto.BYTES,
480
+ number=2,
481
+ )
482
+
483
+ class SubsetView(proto.Message):
484
+ r"""Defines a simple AuthorizedView that is a subset of the
485
+ underlying Table.
486
+
487
+ Attributes:
488
+ row_prefixes (MutableSequence[bytes]):
489
+ Row prefixes to be included in the
490
+ AuthorizedView. To provide access to all rows,
491
+ include the empty string as a prefix ("").
492
+ family_subsets (MutableMapping[str, google.cloud.bigtable_admin_v2.types.AuthorizedView.FamilySubsets]):
493
+ Map from column family name to the columns in
494
+ this family to be included in the
495
+ AuthorizedView.
496
+ """
497
+
498
+ row_prefixes: MutableSequence[bytes] = proto.RepeatedField(
499
+ proto.BYTES,
500
+ number=1,
501
+ )
502
+ family_subsets: MutableMapping[
503
+ str, "AuthorizedView.FamilySubsets"
504
+ ] = proto.MapField(
505
+ proto.STRING,
506
+ proto.MESSAGE,
507
+ number=2,
508
+ message="AuthorizedView.FamilySubsets",
509
+ )
510
+
511
+ name: str = proto.Field(
512
+ proto.STRING,
513
+ number=1,
514
+ )
515
+ subset_view: SubsetView = proto.Field(
516
+ proto.MESSAGE,
517
+ number=2,
518
+ oneof="authorized_view",
519
+ message=SubsetView,
520
+ )
521
+ etag: str = proto.Field(
522
+ proto.STRING,
523
+ number=3,
524
+ )
525
+ deletion_protection: bool = proto.Field(
526
+ proto.BOOL,
527
+ number=4,
528
+ )
529
+
530
+
531
+ class ColumnFamily(proto.Message):
532
+ r"""A set of columns within a table which share a common
533
+ configuration.
534
+
535
+ Attributes:
536
+ gc_rule (google.cloud.bigtable_admin_v2.types.GcRule):
537
+ Garbage collection rule specified as a
538
+ protobuf. Must serialize to at most 500 bytes.
539
+
540
+ NOTE: Garbage collection executes
541
+ opportunistically in the background, and so it's
542
+ possible for reads to return a cell even if it
543
+ matches the active GC expression for its family.
544
+ value_type (google.cloud.bigtable_admin_v2.types.Type):
545
+ The type of data stored in each of this family's cell
546
+ values, including its full encoding. If omitted, the family
547
+ only serves raw untyped bytes.
548
+
549
+ For now, only the ``Aggregate`` type is supported.
550
+
551
+ ``Aggregate`` can only be set at family creation and is
552
+ immutable afterwards.
553
+
554
+ If ``value_type`` is ``Aggregate``, written data must be
555
+ compatible with:
556
+
557
+ - ``value_type.input_type`` for ``AddInput`` mutations
558
+ """
559
+
560
+ gc_rule: "GcRule" = proto.Field(
561
+ proto.MESSAGE,
562
+ number=1,
563
+ message="GcRule",
564
+ )
565
+ value_type: types.Type = proto.Field(
566
+ proto.MESSAGE,
567
+ number=3,
568
+ message=types.Type,
569
+ )
570
+
571
+
572
+ class GcRule(proto.Message):
573
+ r"""Rule for determining which cells to delete during garbage
574
+ collection.
575
+
576
+ This message has `oneof`_ fields (mutually exclusive fields).
577
+ For each oneof, at most one member field can be set at the same time.
578
+ Setting any member of the oneof automatically clears all other
579
+ members.
580
+
581
+ .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
582
+
583
+ Attributes:
584
+ max_num_versions (int):
585
+ Delete all cells in a column except the most
586
+ recent N.
587
+
588
+ This field is a member of `oneof`_ ``rule``.
589
+ max_age (google.protobuf.duration_pb2.Duration):
590
+ Delete cells in a column older than the given
591
+ age. Values must be at least one millisecond,
592
+ and will be truncated to microsecond
593
+ granularity.
594
+
595
+ This field is a member of `oneof`_ ``rule``.
596
+ intersection (google.cloud.bigtable_admin_v2.types.GcRule.Intersection):
597
+ Delete cells that would be deleted by every
598
+ nested rule.
599
+
600
+ This field is a member of `oneof`_ ``rule``.
601
+ union (google.cloud.bigtable_admin_v2.types.GcRule.Union):
602
+ Delete cells that would be deleted by any
603
+ nested rule.
604
+
605
+ This field is a member of `oneof`_ ``rule``.
606
+ """
607
+
608
+ class Intersection(proto.Message):
609
+ r"""A GcRule which deletes cells matching all of the given rules.
610
+
611
+ Attributes:
612
+ rules (MutableSequence[google.cloud.bigtable_admin_v2.types.GcRule]):
613
+ Only delete cells which would be deleted by every element of
614
+ ``rules``.
615
+ """
616
+
617
+ rules: MutableSequence["GcRule"] = proto.RepeatedField(
618
+ proto.MESSAGE,
619
+ number=1,
620
+ message="GcRule",
621
+ )
622
+
623
+ class Union(proto.Message):
624
+ r"""A GcRule which deletes cells matching any of the given rules.
625
+
626
+ Attributes:
627
+ rules (MutableSequence[google.cloud.bigtable_admin_v2.types.GcRule]):
628
+ Delete cells which would be deleted by any element of
629
+ ``rules``.
630
+ """
631
+
632
+ rules: MutableSequence["GcRule"] = proto.RepeatedField(
633
+ proto.MESSAGE,
634
+ number=1,
635
+ message="GcRule",
636
+ )
637
+
638
+ max_num_versions: int = proto.Field(
639
+ proto.INT32,
640
+ number=1,
641
+ oneof="rule",
642
+ )
643
+ max_age: duration_pb2.Duration = proto.Field(
644
+ proto.MESSAGE,
645
+ number=2,
646
+ oneof="rule",
647
+ message=duration_pb2.Duration,
648
+ )
649
+ intersection: Intersection = proto.Field(
650
+ proto.MESSAGE,
651
+ number=3,
652
+ oneof="rule",
653
+ message=Intersection,
654
+ )
655
+ union: Union = proto.Field(
656
+ proto.MESSAGE,
657
+ number=4,
658
+ oneof="rule",
659
+ message=Union,
660
+ )
661
+
662
+
663
+ class EncryptionInfo(proto.Message):
664
+ r"""Encryption information for a given resource.
665
+ If this resource is protected with customer managed encryption,
666
+ the in-use Cloud Key Management Service (Cloud KMS) key version
667
+ is specified along with its status.
668
+
669
+ Attributes:
670
+ encryption_type (google.cloud.bigtable_admin_v2.types.EncryptionInfo.EncryptionType):
671
+ Output only. The type of encryption used to
672
+ protect this resource.
673
+ encryption_status (google.rpc.status_pb2.Status):
674
+ Output only. The status of encrypt/decrypt
675
+ calls on underlying data for this resource.
676
+ Regardless of status, the existing data is
677
+ always encrypted at rest.
678
+ kms_key_version (str):
679
+ Output only. The version of the Cloud KMS key
680
+ specified in the parent cluster that is in use
681
+ for the data underlying this table.
682
+ """
683
+
684
+ class EncryptionType(proto.Enum):
685
+ r"""Possible encryption types for a resource.
686
+
687
+ Values:
688
+ ENCRYPTION_TYPE_UNSPECIFIED (0):
689
+ Encryption type was not specified, though
690
+ data at rest remains encrypted.
691
+ GOOGLE_DEFAULT_ENCRYPTION (1):
692
+ The data backing this resource is encrypted
693
+ at rest with a key that is fully managed by
694
+ Google. No key version or status will be
695
+ populated. This is the default state.
696
+ CUSTOMER_MANAGED_ENCRYPTION (2):
697
+ The data backing this resource is encrypted at rest with a
698
+ key that is managed by the customer. The in-use version of
699
+ the key and its status are populated for CMEK-protected
700
+ tables. CMEK-protected backups are pinned to the key version
701
+ that was in use at the time the backup was taken. This key
702
+ version is populated but its status is not tracked and is
703
+ reported as ``UNKNOWN``.
704
+ """
705
+ ENCRYPTION_TYPE_UNSPECIFIED = 0
706
+ GOOGLE_DEFAULT_ENCRYPTION = 1
707
+ CUSTOMER_MANAGED_ENCRYPTION = 2
708
+
709
+ encryption_type: EncryptionType = proto.Field(
710
+ proto.ENUM,
711
+ number=3,
712
+ enum=EncryptionType,
713
+ )
714
+ encryption_status: status_pb2.Status = proto.Field(
715
+ proto.MESSAGE,
716
+ number=4,
717
+ message=status_pb2.Status,
718
+ )
719
+ kms_key_version: str = proto.Field(
720
+ proto.STRING,
721
+ number=2,
722
+ )
723
+
724
+
725
+ class Snapshot(proto.Message):
726
+ r"""A snapshot of a table at a particular time. A snapshot can be
727
+ used as a checkpoint for data restoration or a data source for a
728
+ new table.
729
+
730
+ Note: This is a private alpha release of Cloud Bigtable
731
+ snapshots. This feature is not currently available to most Cloud
732
+ Bigtable customers. This feature might be changed in
733
+ backward-incompatible ways and is not recommended for production
734
+ use. It is not subject to any SLA or deprecation policy.
735
+
736
+ Attributes:
737
+ name (str):
738
+ The unique name of the snapshot. Values are of the form
739
+ ``projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}``.
740
+ source_table (google.cloud.bigtable_admin_v2.types.Table):
741
+ Output only. The source table at the time the
742
+ snapshot was taken.
743
+ data_size_bytes (int):
744
+ Output only. The size of the data in the
745
+ source table at the time the snapshot was taken.
746
+ In some cases, this value may be computed
747
+ asynchronously via a background process and a
748
+ placeholder of 0 will be used in the meantime.
749
+ create_time (google.protobuf.timestamp_pb2.Timestamp):
750
+ Output only. The time when the snapshot is
751
+ created.
752
+ delete_time (google.protobuf.timestamp_pb2.Timestamp):
753
+ The time when the snapshot will be deleted.
754
+ The maximum amount of time a snapshot can stay
755
+ active is 365 days. If 'ttl' is not specified,
756
+ the default maximum of 365 days will be used.
757
+ state (google.cloud.bigtable_admin_v2.types.Snapshot.State):
758
+ Output only. The current state of the
759
+ snapshot.
760
+ description (str):
761
+ Description of the snapshot.
762
+ """
763
+
764
+ class State(proto.Enum):
765
+ r"""Possible states of a snapshot.
766
+
767
+ Values:
768
+ STATE_NOT_KNOWN (0):
769
+ The state of the snapshot could not be
770
+ determined.
771
+ READY (1):
772
+ The snapshot has been successfully created
773
+ and can serve all requests.
774
+ CREATING (2):
775
+ The snapshot is currently being created, and
776
+ may be destroyed if the creation process
777
+ encounters an error. A snapshot may not be
778
+ restored to a table while it is being created.
779
+ """
780
+ STATE_NOT_KNOWN = 0
781
+ READY = 1
782
+ CREATING = 2
783
+
784
+ name: str = proto.Field(
785
+ proto.STRING,
786
+ number=1,
787
+ )
788
+ source_table: "Table" = proto.Field(
789
+ proto.MESSAGE,
790
+ number=2,
791
+ message="Table",
792
+ )
793
+ data_size_bytes: int = proto.Field(
794
+ proto.INT64,
795
+ number=3,
796
+ )
797
+ create_time: timestamp_pb2.Timestamp = proto.Field(
798
+ proto.MESSAGE,
799
+ number=4,
800
+ message=timestamp_pb2.Timestamp,
801
+ )
802
+ delete_time: timestamp_pb2.Timestamp = proto.Field(
803
+ proto.MESSAGE,
804
+ number=5,
805
+ message=timestamp_pb2.Timestamp,
806
+ )
807
+ state: State = proto.Field(
808
+ proto.ENUM,
809
+ number=6,
810
+ enum=State,
811
+ )
812
+ description: str = proto.Field(
813
+ proto.STRING,
814
+ number=7,
815
+ )
816
+
817
+
818
+ class Backup(proto.Message):
819
+ r"""A backup of a Cloud Bigtable table.
820
+
821
+ Attributes:
822
+ name (str):
823
+ A globally unique identifier for the backup which cannot be
824
+ changed. Values are of the form
825
+ ``projects/{project}/instances/{instance}/clusters/{cluster}/ backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*``
826
+ The final segment of the name must be between 1 and 50
827
+ characters in length.
828
+
829
+ The backup is stored in the cluster identified by the prefix
830
+ of the backup name of the form
831
+ ``projects/{project}/instances/{instance}/clusters/{cluster}``.
832
+ source_table (str):
833
+ Required. Immutable. Name of the table from which this
834
+ backup was created. This needs to be in the same instance as
835
+ the backup. Values are of the form
836
+ ``projects/{project}/instances/{instance}/tables/{source_table}``.
837
+ source_backup (str):
838
+ Output only. Name of the backup from which
839
+ this backup was copied. If a backup is not
840
+ created by copying a backup, this field will be
841
+ empty. Values are of the form:
842
+
843
+ projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
844
+ expire_time (google.protobuf.timestamp_pb2.Timestamp):
845
+ Required. The expiration time of the backup. When creating a
846
+ backup or updating its ``expire_time``, the value must be
847
+ greater than the backup creation time by:
848
+
849
+ - At least 6 hours
850
+ - At most 90 days
851
+
852
+ Once the ``expire_time`` has passed, Cloud Bigtable will
853
+ delete the backup.
854
+ start_time (google.protobuf.timestamp_pb2.Timestamp):
855
+ Output only. ``start_time`` is the time that the backup was
856
+ started (i.e. approximately the time the
857
+ [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]
858
+ request is received). The row data in this backup will be no
859
+ older than this timestamp.
860
+ end_time (google.protobuf.timestamp_pb2.Timestamp):
861
+ Output only. ``end_time`` is the time that the backup was
862
+ finished. The row data in the backup will be no newer than
863
+ this timestamp.
864
+ size_bytes (int):
865
+ Output only. Size of the backup in bytes.
866
+ state (google.cloud.bigtable_admin_v2.types.Backup.State):
867
+ Output only. The current state of the backup.
868
+ encryption_info (google.cloud.bigtable_admin_v2.types.EncryptionInfo):
869
+ Output only. The encryption information for
870
+ the backup.
871
+ backup_type (google.cloud.bigtable_admin_v2.types.Backup.BackupType):
872
+ Indicates the backup type of the backup.
873
+ hot_to_standard_time (google.protobuf.timestamp_pb2.Timestamp):
874
+ The time at which the hot backup will be converted to a
875
+ standard backup. Once the ``hot_to_standard_time`` has
876
+ passed, Cloud Bigtable will convert the hot backup to a
877
+ standard backup. This value must be greater than the backup
878
+ creation time by:
879
+
880
+ - At least 24 hours
881
+
882
+ This field only applies for hot backups. When creating or
883
+ updating a standard backup, attempting to set this field
884
+ will fail the request.
885
+ """
886
+
887
+ class State(proto.Enum):
888
+ r"""Indicates the current state of the backup.
889
+
890
+ Values:
891
+ STATE_UNSPECIFIED (0):
892
+ Not specified.
893
+ CREATING (1):
894
+ The pending backup is still being created. Operations on the
895
+ backup may fail with ``FAILED_PRECONDITION`` in this state.
896
+ READY (2):
897
+ The backup is complete and ready for use.
898
+ """
899
+ STATE_UNSPECIFIED = 0
900
+ CREATING = 1
901
+ READY = 2
902
+
903
+ class BackupType(proto.Enum):
904
+ r"""The type of the backup.
905
+
906
+ Values:
907
+ BACKUP_TYPE_UNSPECIFIED (0):
908
+ Not specified.
909
+ STANDARD (1):
910
+ The default type for Cloud Bigtable managed
911
+ backups. Supported for backups created in both
912
+ HDD and SSD instances. Requires optimization
913
+ when restored to a table in an SSD instance.
914
+ HOT (2):
915
+ A backup type with faster restore to SSD
916
+ performance. Only supported for backups created
917
+ in SSD instances. A new SSD table restored from
918
+ a hot backup reaches production performance more
919
+ quickly than a standard backup.
920
+ """
921
+ BACKUP_TYPE_UNSPECIFIED = 0
922
+ STANDARD = 1
923
+ HOT = 2
924
+
925
+ name: str = proto.Field(
926
+ proto.STRING,
927
+ number=1,
928
+ )
929
+ source_table: str = proto.Field(
930
+ proto.STRING,
931
+ number=2,
932
+ )
933
+ source_backup: str = proto.Field(
934
+ proto.STRING,
935
+ number=10,
936
+ )
937
+ expire_time: timestamp_pb2.Timestamp = proto.Field(
938
+ proto.MESSAGE,
939
+ number=3,
940
+ message=timestamp_pb2.Timestamp,
941
+ )
942
+ start_time: timestamp_pb2.Timestamp = proto.Field(
943
+ proto.MESSAGE,
944
+ number=4,
945
+ message=timestamp_pb2.Timestamp,
946
+ )
947
+ end_time: timestamp_pb2.Timestamp = proto.Field(
948
+ proto.MESSAGE,
949
+ number=5,
950
+ message=timestamp_pb2.Timestamp,
951
+ )
952
+ size_bytes: int = proto.Field(
953
+ proto.INT64,
954
+ number=6,
955
+ )
956
+ state: State = proto.Field(
957
+ proto.ENUM,
958
+ number=7,
959
+ enum=State,
960
+ )
961
+ encryption_info: "EncryptionInfo" = proto.Field(
962
+ proto.MESSAGE,
963
+ number=9,
964
+ message="EncryptionInfo",
965
+ )
966
+ backup_type: BackupType = proto.Field(
967
+ proto.ENUM,
968
+ number=11,
969
+ enum=BackupType,
970
+ )
971
+ hot_to_standard_time: timestamp_pb2.Timestamp = proto.Field(
972
+ proto.MESSAGE,
973
+ number=12,
974
+ message=timestamp_pb2.Timestamp,
975
+ )
976
+
977
+
978
+ class BackupInfo(proto.Message):
979
+ r"""Information about a backup.
980
+
981
+ Attributes:
982
+ backup (str):
983
+ Output only. Name of the backup.
984
+ start_time (google.protobuf.timestamp_pb2.Timestamp):
985
+ Output only. The time that the backup was
986
+ started. Row data in the backup will be no older
987
+ than this timestamp.
988
+ end_time (google.protobuf.timestamp_pb2.Timestamp):
989
+ Output only. This time that the backup was
990
+ finished. Row data in the backup will be no
991
+ newer than this timestamp.
992
+ source_table (str):
993
+ Output only. Name of the table the backup was
994
+ created from.
995
+ source_backup (str):
996
+ Output only. Name of the backup from which
997
+ this backup was copied. If a backup is not
998
+ created by copying a backup, this field will be
999
+ empty. Values are of the form:
1000
+
1001
+ projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
1002
+ """
1003
+
1004
+ backup: str = proto.Field(
1005
+ proto.STRING,
1006
+ number=1,
1007
+ )
1008
+ start_time: timestamp_pb2.Timestamp = proto.Field(
1009
+ proto.MESSAGE,
1010
+ number=2,
1011
+ message=timestamp_pb2.Timestamp,
1012
+ )
1013
+ end_time: timestamp_pb2.Timestamp = proto.Field(
1014
+ proto.MESSAGE,
1015
+ number=3,
1016
+ message=timestamp_pb2.Timestamp,
1017
+ )
1018
+ source_table: str = proto.Field(
1019
+ proto.STRING,
1020
+ number=4,
1021
+ )
1022
+ source_backup: str = proto.Field(
1023
+ proto.STRING,
1024
+ number=10,
1025
+ )
1026
+
1027
+
1028
+ __all__ = tuple(sorted(__protobuf__.manifest))