Skip to content

Commit 581092f

Browse files
feat: update gapic-generator and go microgen, backups generated api (#55)
* changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * chore: update gapic-generator and go microgen changes include: - build_gen: go lro gapic used as dep - go_gapic_library: fixes shading of go_library importpath PiperOrigin-RevId: 314363155 Source-Author: Google APIs <noreply@google.com> Source-Date: Tue Jun 2 10:56:09 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 3a4894c4f0da3e763aca2c67bd280ae915177450 Source-Link: googleapis/googleapis@3a4894c * fix failing test * lint Co-authored-by: Kristen O'Leary <kaoleary@google.com> Co-authored-by: kolea2 <45548808+kolea2@users.noreply.github.com>
1 parent fb6b702 commit 581092f

29 files changed

+6444
-2433
lines changed

packages/google-cloud-bigtable/google/cloud/bigtable/cluster.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,11 @@ def update(self):
291291
update operation.
292292
"""
293293
client = self._instance._client
294-
# We are passing `None` for second argument location.
294+
# We are passing `None` for third argument location.
295295
# Location is set only at the time of creation of a cluster
296296
# and can not be changed after cluster has been created.
297297
return client.instance_admin_client.update_cluster(
298-
self.name, self.serve_nodes, None
298+
name=self.name, serve_nodes=self.serve_nodes, location=None
299299
)
300300

301301
def delete(self):

packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
if sys.version_info[:2] == (2, 7):
2929
message = (
30-
"A future version of this library will drop support for Python 2.7."
31-
"More details about Python 2 support for Google Cloud Client Libraries"
30+
"A future version of this library will drop support for Python 2.7. "
31+
"More details about Python 2 support for Google Cloud Client Libraries "
3232
"can be found at https://cloud.google.com/python/docs/python2-sunset/"
3333
)
3434
warnings.warn(message, DeprecationWarning)

packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py

Lines changed: 94 additions & 93 deletions
Large diffs are not rendered by default.

packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py

Lines changed: 703 additions & 83 deletions
Large diffs are not rendered by default.

packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client_config.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,36 @@
124124
"retry_codes_name": "non_idempotent",
125125
"retry_params_name": "non_idempotent_params",
126126
},
127+
"CreateBackup": {
128+
"timeout_millis": 60000,
129+
"retry_codes_name": "non_idempotent",
130+
"retry_params_name": "non_idempotent_params",
131+
},
132+
"GetBackup": {
133+
"timeout_millis": 60000,
134+
"retry_codes_name": "idempotent",
135+
"retry_params_name": "idempotent_params",
136+
},
137+
"ListBackups": {
138+
"timeout_millis": 60000,
139+
"retry_codes_name": "idempotent",
140+
"retry_params_name": "idempotent_params",
141+
},
142+
"UpdateBackup": {
143+
"timeout_millis": 60000,
144+
"retry_codes_name": "non_idempotent",
145+
"retry_params_name": "non_idempotent_params",
146+
},
147+
"DeleteBackup": {
148+
"timeout_millis": 60000,
149+
"retry_codes_name": "non_idempotent",
150+
"retry_params_name": "non_idempotent_params",
151+
},
152+
"RestoreTable": {
153+
"timeout_millis": 60000,
154+
"retry_codes_name": "non_idempotent",
155+
"retry_params_name": "non_idempotent_params",
156+
},
127157
},
128158
}
129159
}

packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/gapic/enums.py

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@
1919
import enum
2020

2121

22+
class RestoreSourceType(enum.IntEnum):
23+
"""
24+
Indicates the type of the restore source.
25+
26+
Attributes:
27+
RESTORE_SOURCE_TYPE_UNSPECIFIED (int): No restore associated.
28+
BACKUP (int): A backup was used as the source of the restore.
29+
"""
30+
31+
RESTORE_SOURCE_TYPE_UNSPECIFIED = 0
32+
BACKUP = 1
33+
34+
2235
class StorageType(enum.IntEnum):
2336
"""
2437
Storage media types for persisting Bigtable data.
@@ -34,6 +47,23 @@ class StorageType(enum.IntEnum):
3447
HDD = 2
3548

3649

50+
class Backup(object):
51+
class State(enum.IntEnum):
52+
"""
53+
Indicates the current state of the backup.
54+
55+
Attributes:
56+
STATE_UNSPECIFIED (int): Not specified.
57+
CREATING (int): The pending backup is still being created. Operations on the backup
58+
may fail with ``FAILED_PRECONDITION`` in this state.
59+
READY (int): The backup is complete and ready for use.
60+
"""
61+
62+
STATE_UNSPECIFIED = 0
63+
CREATING = 1
64+
READY = 2
65+
66+
3767
class Cluster(object):
3868
class State(enum.IntEnum):
3969
"""
@@ -86,11 +116,11 @@ class Type(enum.IntEnum):
86116
TYPE_UNSPECIFIED (int): The type of the instance is unspecified. If set when creating an
87117
instance, a ``PRODUCTION`` instance will be created. If set when
88118
updating an instance, the type will be left unchanged.
89-
PRODUCTION (int): An instance meant for production use. ``serve_nodes`` must be set on the
90-
cluster.
91-
DEVELOPMENT (int): The instance is meant for development and testing purposes only; it has
92-
no performance or uptime guarantees and is not covered by SLA. After a
93-
development instance is created, it can be upgraded by updating the
119+
PRODUCTION (int): An instance meant for production use. ``serve_nodes`` must be set on
120+
the cluster.
121+
DEVELOPMENT (int): The instance is meant for development and testing purposes only; it
122+
has no performance or uptime guarantees and is not covered by SLA. After
123+
a development instance is created, it can be upgraded by updating the
94124
instance to type ``PRODUCTION``. An instance created as a production
95125
instance cannot be changed to a development instance. When creating a
96126
development instance, ``serve_nodes`` on the cluster must not be set.
@@ -142,8 +172,8 @@ class View(enum.IntEnum):
142172
VIEW_UNSPECIFIED (int): Uses the default view for each method as documented in its request.
143173
NAME_ONLY (int): Only populates ``name``.
144174
SCHEMA_VIEW (int): Only populates ``name`` and fields related to the table's schema.
145-
REPLICATION_VIEW (int): Only populates ``name`` and fields related to the table's replication
146-
state.
175+
REPLICATION_VIEW (int): Only populates ``name`` and fields related to the table's
176+
replication state.
147177
FULL (int): Populates all fields.
148178
"""
149179

@@ -170,10 +200,14 @@ class ReplicationState(enum.IntEnum):
170200
READY (int): The table can serve Data API requests from this cluster. Depending on
171201
replication delay, reads may not immediately reflect the state of the
172202
table in other clusters.
203+
READY_OPTIMIZING (int): The table is fully created and ready for use after a restore, and is
204+
being optimized for performance. When optimizations are complete, the
205+
table will transition to ``READY`` state.
173206
"""
174207

175208
STATE_NOT_KNOWN = 0
176209
INITIALIZING = 1
177210
PLANNED_MAINTENANCE = 2
178211
UNPLANNED_MAINTENANCE = 3
179212
READY = 4
213+
READY_OPTIMIZING = 5

packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/gapic/transports/bigtable_instance_admin_grpc_transport.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ def list_instances(self):
170170
def update_instance(self):
171171
"""Return the gRPC stub for :meth:`BigtableInstanceAdminClient.update_instance`.
172172
173-
Updates an instance within a project.
173+
Updates an instance within a project. This method updates only the display
174+
name and type for an Instance. To update other Instance properties, such as
175+
labels, use PartialUpdateInstance.
174176
175177
Returns:
176178
Callable: A callable which accepts the appropriate
@@ -183,7 +185,8 @@ def update_instance(self):
183185
def partial_update_instance(self):
184186
"""Return the gRPC stub for :meth:`BigtableInstanceAdminClient.partial_update_instance`.
185187
186-
Partially updates an instance within a project.
188+
Partially updates an instance within a project. This method can modify all
189+
fields of an Instance and is the preferred way to update an Instance.
187190
188191
Returns:
189192
Callable: A callable which accepts the appropriate

packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/gapic/transports/bigtable_table_admin_grpc_transport.py

Lines changed: 93 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,9 @@ def check_consistency(self):
267267
def get_iam_policy(self):
268268
"""Return the gRPC stub for :meth:`BigtableTableAdminClient.get_iam_policy`.
269269
270-
Gets the access control policy for a table resource. Returns an empty
271-
policy if an table exists but does not have a policy set.
270+
Gets the access control policy for a resource.
271+
Returns an empty policy if the resource exists but does not have a policy
272+
set.
272273
273274
Returns:
274275
Callable: A callable which accepts the appropriate
@@ -281,8 +282,8 @@ def get_iam_policy(self):
281282
def set_iam_policy(self):
282283
"""Return the gRPC stub for :meth:`BigtableTableAdminClient.set_iam_policy`.
283284
284-
Sets the access control policy on a table resource. Replaces any existing
285-
policy.
285+
Sets the access control policy on a Table or Backup resource.
286+
Replaces any existing policy.
286287
287288
Returns:
288289
Callable: A callable which accepts the appropriate
@@ -380,3 +381,91 @@ def delete_snapshot(self):
380381
deserialized response object.
381382
"""
382383
return self._stubs["bigtable_table_admin_stub"].DeleteSnapshot
384+
385+
@property
386+
def create_backup(self):
387+
"""Return the gRPC stub for :meth:`BigtableTableAdminClient.create_backup`.
388+
389+
Starts creating a new Cloud Bigtable Backup. The returned backup
390+
``long-running operation`` can be used to track creation of the backup.
391+
The ``metadata`` field type is ``CreateBackupMetadata``. The
392+
``response`` field type is ``Backup``, if successful. Cancelling the
393+
returned operation will stop the creation and delete the backup.
394+
395+
Returns:
396+
Callable: A callable which accepts the appropriate
397+
deserialized request object and returns a
398+
deserialized response object.
399+
"""
400+
return self._stubs["bigtable_table_admin_stub"].CreateBackup
401+
402+
@property
403+
def get_backup(self):
404+
"""Return the gRPC stub for :meth:`BigtableTableAdminClient.get_backup`.
405+
406+
Gets metadata on a pending or completed Cloud Bigtable Backup.
407+
408+
Returns:
409+
Callable: A callable which accepts the appropriate
410+
deserialized request object and returns a
411+
deserialized response object.
412+
"""
413+
return self._stubs["bigtable_table_admin_stub"].GetBackup
414+
415+
@property
416+
def list_backups(self):
417+
"""Return the gRPC stub for :meth:`BigtableTableAdminClient.list_backups`.
418+
419+
Lists Cloud Bigtable backups. Returns both completed and pending
420+
backups.
421+
422+
Returns:
423+
Callable: A callable which accepts the appropriate
424+
deserialized request object and returns a
425+
deserialized response object.
426+
"""
427+
return self._stubs["bigtable_table_admin_stub"].ListBackups
428+
429+
@property
430+
def update_backup(self):
431+
"""Return the gRPC stub for :meth:`BigtableTableAdminClient.update_backup`.
432+
433+
Updates a pending or completed Cloud Bigtable Backup.
434+
435+
Returns:
436+
Callable: A callable which accepts the appropriate
437+
deserialized request object and returns a
438+
deserialized response object.
439+
"""
440+
return self._stubs["bigtable_table_admin_stub"].UpdateBackup
441+
442+
@property
443+
def delete_backup(self):
444+
"""Return the gRPC stub for :meth:`BigtableTableAdminClient.delete_backup`.
445+
446+
Deletes a pending or completed Cloud Bigtable backup.
447+
448+
Returns:
449+
Callable: A callable which accepts the appropriate
450+
deserialized request object and returns a
451+
deserialized response object.
452+
"""
453+
return self._stubs["bigtable_table_admin_stub"].DeleteBackup
454+
455+
@property
456+
def restore_table(self):
457+
"""Return the gRPC stub for :meth:`BigtableTableAdminClient.restore_table`.
458+
459+
Create a new table by restoring from a completed backup. The new
460+
table must be in the same instance as the instance containing the
461+
backup. The returned table ``long-running operation`` can be used to
462+
track the progress of the operation, and to cancel it. The ``metadata``
463+
field type is ``RestoreTableMetadata``. The ``response`` type is
464+
``Table``, if successful.
465+
466+
Returns:
467+
Callable: A callable which accepts the appropriate
468+
deserialized request object and returns a
469+
deserialized response object.
470+
"""
471+
return self._stubs["bigtable_table_admin_stub"].RestoreTable

0 commit comments

Comments
 (0)