Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: refreshes Bigtable Admin API(s) protos #589

Merged
merged 2 commits into from May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -1262,17 +1262,7 @@ async def partial_update_cluster(
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.partial_update_cluster,
default_retry=retries.Retry(
initial=1.0,
maximum=60.0,
multiplier=2,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
),
default_timeout=60.0,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)

Expand Down
Expand Up @@ -257,17 +257,7 @@ def _prep_wrapped_messages(self, client_info):
),
self.partial_update_cluster: gapic_v1.method.wrap_method(
self.partial_update_cluster,
default_retry=retries.Retry(
initial=1.0,
maximum=60.0,
multiplier=2,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
),
default_timeout=60.0,
default_timeout=None,
client_info=client_info,
),
self.delete_cluster: gapic_v1.method.wrap_method(
Expand Down
52 changes: 52 additions & 0 deletions google/cloud/bigtable_admin_v2/types/bigtable_instance_admin.py
Expand Up @@ -415,8 +415,54 @@ class CreateClusterMetadata(proto.Message):
finish_time (google.protobuf.timestamp_pb2.Timestamp):
The time at which the operation failed or was
completed successfully.
tables (Mapping[str, google.cloud.bigtable_admin_v2.types.CreateClusterMetadata.TableProgress]):
Keys: the full ``name`` of each table that existed in the
instance when CreateCluster was first called, i.e.
``projects/<project>/instances/<instance>/tables/<table>``.
Any table added to the instance by a later API call will be
created in the new cluster by that API call, not this one.

Values: information on how much of a table's data has been
copied to the newly-created cluster so far.
"""

class TableProgress(proto.Message):
r"""Progress info for copying a table's data to the new cluster.

Attributes:
estimated_size_bytes (int):
Estimate of the size of the table to be
copied.
estimated_copied_bytes (int):
Estimate of the number of bytes copied so far for this
table. This will eventually reach 'estimated_size_bytes'
unless the table copy is CANCELLED.
state (google.cloud.bigtable_admin_v2.types.CreateClusterMetadata.TableProgress.State):

"""

class State(proto.Enum):
r""""""
STATE_UNSPECIFIED = 0
PENDING = 1
COPYING = 2
COMPLETED = 3
CANCELLED = 4

estimated_size_bytes = proto.Field(
proto.INT64,
number=2,
)
estimated_copied_bytes = proto.Field(
proto.INT64,
number=3,
)
state = proto.Field(
proto.ENUM,
number=4,
enum="CreateClusterMetadata.TableProgress.State",
)

original_request = proto.Field(
proto.MESSAGE,
number=1,
Expand All @@ -432,6 +478,12 @@ class CreateClusterMetadata(proto.Message):
number=3,
message=timestamp_pb2.Timestamp,
)
tables = proto.MapField(
proto.STRING,
proto.MESSAGE,
number=4,
message=TableProgress,
)


class UpdateClusterMetadata(proto.Message):
Expand Down
23 changes: 13 additions & 10 deletions google/cloud/bigtable_admin_v2/types/instance.py
Expand Up @@ -169,13 +169,14 @@ class Cluster(proto.Message):
The unique name of the cluster. Values are of the form
``projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*``.
location (str):
(``CreationOnly``) The location where this cluster's nodes
and storage reside. For best performance, clients should be
Immutable. The location where this cluster's nodes and
storage reside. For best performance, clients should be
located as close as possible to this cluster. Currently only
zones are supported, so values should be of the form
``projects/{project}/locations/{zone}``.
state (google.cloud.bigtable_admin_v2.types.Cluster.State):
The current state of the cluster.
Output only. The current state of the
cluster.
serve_nodes (int):
The number of nodes allocated to this
cluster. More nodes enable higher throughput and
Expand All @@ -185,9 +186,9 @@ class Cluster(proto.Message):

This field is a member of `oneof`_ ``config``.
default_storage_type (google.cloud.bigtable_admin_v2.types.StorageType):
(``CreationOnly``) The type of storage used by this cluster
to serve its parent instance's tables, unless explicitly
overridden.
Immutable. The type of storage used by this
cluster to serve its parent instance's tables,
unless explicitly overridden.
encryption_config (google.cloud.bigtable_admin_v2.types.Cluster.EncryptionConfig):
Immutable. The encryption configuration for
CMEK-protected clusters.
Expand Down Expand Up @@ -254,6 +255,9 @@ class EncryptionConfig(proto.Message):
key.
2) Only regional keys can be used and the region of the CMEK
key must match the region of the cluster.
3) All clusters within an instance must use the same CMEK
key. Values are of the form
``projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}``
"""

kms_key_name = proto.Field(
Expand Down Expand Up @@ -309,8 +313,7 @@ class AppProfile(proto.Message):

Attributes:
name (str):
(``OutputOnly``) The unique name of the app profile. Values
are of the form
The unique name of the app profile. Values are of the form
``projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*``.
etag (str):
Strongly validated etag for optimistic concurrency control.
Expand All @@ -324,8 +327,8 @@ class AppProfile(proto.Message):
7232 <https://tools.ietf.org/html/rfc7232#section-2.3>`__
for more details.
description (str):
Optional long form description of the use
case for this AppProfile.
Long form description of the use case for
this AppProfile.
multi_cluster_routing_use_any (google.cloud.bigtable_admin_v2.types.AppProfile.MultiClusterRoutingUseAny):
Use a multi-cluster routing policy.

Expand Down
17 changes: 8 additions & 9 deletions google/cloud/bigtable_admin_v2/types/table.py
Expand Up @@ -89,14 +89,13 @@ class Table(proto.Message):
with UNKNOWN ``replication_status``. Views:
``REPLICATION_VIEW``, ``ENCRYPTION_VIEW``, ``FULL``
column_families (Mapping[str, google.cloud.bigtable_admin_v2.types.ColumnFamily]):
(``CreationOnly``) The column families configured for this
table, mapped by column family ID. Views: ``SCHEMA_VIEW``,
``FULL``
The column families configured for this table, mapped by
column family ID. Views: ``SCHEMA_VIEW``, ``FULL``
granularity (google.cloud.bigtable_admin_v2.types.Table.TimestampGranularity):
(``CreationOnly``) The granularity (i.e. ``MILLIS``) at
which timestamps are stored in this table. Timestamps not
matching the granularity will be rejected. If unspecified at
creation time, the value will be set to ``MILLIS``. Views:
Immutable. The granularity (i.e. ``MILLIS``) at which
timestamps are stored in this table. Timestamps not matching
the granularity will be rejected. If unspecified at creation
time, the value will be set to ``MILLIS``. Views:
``SCHEMA_VIEW``, ``FULL``.
restore_info (google.cloud.bigtable_admin_v2.types.RestoreInfo):
Output only. If this table was restored from
Expand Down Expand Up @@ -427,8 +426,8 @@ class Backup(proto.Message):

Attributes:
name (str):
Output only. A globally unique identifier for the backup
which cannot be changed. Values are of the form
A globally unique identifier for the backup which cannot be
changed. Values are of the form
``projects/{project}/instances/{instance}/clusters/{cluster}/ backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*``
The final segment of the name must be between 1 and 50
characters in length.
Expand Down