From bdca7d18308d5cb1797f6fab5603e55fb3f726b2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 10 Jun 2022 11:48:02 -0400 Subject: [PATCH] fix: fixes for dynamic routing and streaming descriptors (#1088) Use gapic-generator-typescript v2.14.5. PiperOrigin-RevId: 450616838 Source-Link: https://github.com/googleapis/googleapis/commit/7a47b72791e0b84d78beca4c2b26bec42ce31572 Source-Link: https://github.com/googleapis/googleapis-gen/commit/42cc6331bae0b99f61b8e01ae15b05211716c4f9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDJjYzYzMzFiYWUwYjk5ZjYxYjhlMDFhZTE1YjA1MjExNzE2YzRmOSJ9 PiperOrigin-RevId: 450372109 Source-Link: https://github.com/googleapis/googleapis/commit/942691f8dcf3e521be35d909de9bba3239feb471 Source-Link: https://github.com/googleapis/googleapis-gen/commit/609a36966c40f726fd0dc71e953dc83f8e52fef1 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjA5YTM2OTY2YzQwZjcyNmZkMGRjNzFlOTUzZGM4M2Y4ZTUyZmVmMSJ9 feat: refreshes Bigtable Admin API(s) protos PiperOrigin-RevId: 448988001 Source-Link: https://github.com/googleapis/googleapis/commit/b6fa58e3e886c619018da132de53b47ea7006565 Source-Link: https://github.com/googleapis/googleapis-gen/commit/fc8b8dbc7da1a7845d57134f411302d106ea2ef2 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmM4YjhkYmM3ZGExYTc4NDVkNTcxMzRmNDExMzAyZDEwNmVhMmVmMiJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../admin/v2/bigtable_instance_admin.proto | 41 ++ protos/google/bigtable/admin/v2/common.proto | 3 +- .../google/bigtable/admin/v2/instance.proto | 98 ++-- protos/google/bigtable/admin/v2/table.proto | 88 ++-- protos/protos.d.ts | 153 +++++- protos/protos.js | 443 ++++++++++++++++-- protos/protos.json | 105 +++-- .../bigtable_instance_admin.update_cluster.js | 13 +- ...bigtable_instance_admin.update_instance.js | 3 +- ...pet_metadata.google.bigtable.admin.v2.json | 4 +- src/v2/bigtable_client.ts | 9 +- src/v2/bigtable_instance_admin_client.ts | 8 +- ...bigtable_instance_admin_client_config.json | 5 +- system-test/install.ts | 10 +- 14 files changed, 767 insertions(+), 216 deletions(-) diff --git a/protos/google/bigtable/admin/v2/bigtable_instance_admin.proto b/protos/google/bigtable/admin/v2/bigtable_instance_admin.proto index 6dfc0e2a9..d7b2ead1c 100644 --- a/protos/google/bigtable/admin/v2/bigtable_instance_admin.proto +++ b/protos/google/bigtable/admin/v2/bigtable_instance_admin.proto @@ -484,6 +484,37 @@ message UpdateInstanceMetadata { // The metadata for the Operation returned by CreateCluster. message CreateClusterMetadata { + // Progress info for copying a table's data to the new cluster. + message TableProgress { + enum State { + STATE_UNSPECIFIED = 0; + + // The table has not yet begun copying to the new cluster. + PENDING = 1; + + // The table is actively being copied to the new cluster. + COPYING = 2; + + // The table has been fully copied to the new cluster. + COMPLETED = 3; + + // The table was deleted before it finished copying to the new cluster. + // Note that tables deleted after completion will stay marked as + // COMPLETED, not CANCELLED. + CANCELLED = 4; + } + + // Estimate of the size of the table to be copied. + int64 estimated_size_bytes = 2; + + // 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. + int64 estimated_copied_bytes = 3; + + State state = 4; + } + // The request that prompted the initiation of this CreateCluster operation. CreateClusterRequest original_request = 1; @@ -492,6 +523,16 @@ message CreateClusterMetadata { // The time at which the operation failed or was completed successfully. google.protobuf.Timestamp finish_time = 3; + + // Keys: the full `name` of each table that existed in the instance when + // CreateCluster was first called, i.e. + // `projects//instances//tables/`. 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. + map tables = 4; } // The metadata for the Operation returned by UpdateCluster. diff --git a/protos/google/bigtable/admin/v2/common.proto b/protos/google/bigtable/admin/v2/common.proto index 1d7782e67..0d337e6b5 100644 --- a/protos/google/bigtable/admin/v2/common.proto +++ b/protos/google/bigtable/admin/v2/common.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ syntax = "proto3"; package google.bigtable.admin.v2; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin"; diff --git a/protos/google/bigtable/admin/v2/instance.proto b/protos/google/bigtable/admin/v2/instance.proto index 2301420b1..bbbc5bfaa 100644 --- a/protos/google/bigtable/admin/v2/instance.proto +++ b/protos/google/bigtable/admin/v2/instance.proto @@ -20,7 +20,6 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/bigtable/admin/v2/common.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin"; @@ -69,19 +68,14 @@ message Instance { // on the cluster. PRODUCTION = 1; - // The instance is meant for development and testing purposes only; it has - // no performance or uptime guarantees and is not covered by SLA. - // After a development instance is created, it can be upgraded by - // updating the instance to type `PRODUCTION`. An instance created - // as a production instance cannot be changed to a development instance. - // When creating a development instance, `serve_nodes` on the cluster must - // not be set. + // DEPRECATED: Prefer PRODUCTION for all use cases, as it no longer enforces + // a higher minimum node count than DEVELOPMENT. DEVELOPMENT = 2; } // The unique name of the instance. Values are of the form // `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + string name = 1; // Required. The descriptive name for this instance as it appears in UIs. // Can be changed at any time, but should be kept globally unique @@ -141,6 +135,31 @@ message Cluster { pattern: "projects/{project}/instances/{instance}/clusters/{cluster}" }; + // Possible states of a cluster. + enum State { + // The state of the cluster could not be determined. + STATE_NOT_KNOWN = 0; + + // The cluster has been successfully created and is ready to serve requests. + READY = 1; + + // The cluster is currently being created, and may be destroyed + // if the creation process encounters an error. + // A cluster may not be able to serve requests while being created. + CREATING = 2; + + // The cluster is currently being resized, and may revert to its previous + // node count if the process encounters an error. + // A cluster is still capable of serving requests while being resized, + // but may exhibit performance as if its number of allocated nodes is + // between the starting and requested states. + RESIZING = 3; + + // The cluster has no backing nodes. The data (tables) still + // exist, but no operations can be performed on the cluster. + DISABLED = 4; + } + // Autoscaling config for a cluster. message ClusterAutoscalingConfig { // Required. Autoscaling limits for this cluster. @@ -166,50 +185,30 @@ message Cluster { // `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK 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}` string kms_key_name = 1 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - } - - // Possible states of a cluster. - enum State { - // The state of the cluster could not be determined. - STATE_NOT_KNOWN = 0; - - // The cluster has been successfully created and is ready to serve requests. - READY = 1; - - // The cluster is currently being created, and may be destroyed - // if the creation process encounters an error. - // A cluster may not be able to serve requests while being created. - CREATING = 2; - - // The cluster is currently being resized, and may revert to its previous - // node count if the process encounters an error. - // A cluster is still capable of serving requests while being resized, - // but may exhibit performance as if its number of allocated nodes is - // between the starting and requested states. - RESIZING = 3; - - // The cluster has no backing nodes. The data (tables) still - // exist, but no operations can be performed on the cluster. - DISABLED = 4; + type: "cloudkms.googleapis.com/CryptoKey" + }]; } // The unique name of the cluster. Values are of the form // `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + string name = 1; - // (`CreationOnly`) - // The location where this cluster's nodes and storage reside. For best + // 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}`. - string location = 2 [(google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - }]; - - // The current state of the cluster. + string location = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Output only. The current state of the cluster. State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // The number of nodes allocated to this cluster. More nodes enable higher @@ -221,14 +220,12 @@ message Cluster { ClusterConfig cluster_config = 7; } - // (`CreationOnly`) - // The type of storage used by this cluster to serve its + // Immutable. The type of storage used by this cluster to serve its // parent instance's tables, unless explicitly overridden. - StorageType default_storage_type = 5; + StorageType default_storage_type = 5 [(google.api.field_behavior) = IMMUTABLE]; // Immutable. The encryption configuration for CMEK-protected clusters. - EncryptionConfig encryption_config = 6 - [(google.api.field_behavior) = IMMUTABLE]; + EncryptionConfig encryption_config = 6 [(google.api.field_behavior) = IMMUTABLE]; } // A configuration object describing how Cloud Bigtable should treat traffic @@ -263,7 +260,6 @@ message AppProfile { bool allow_transactional_writes = 2; } - // (`OutputOnly`) // 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]*`. string name = 1; @@ -278,7 +274,7 @@ message AppProfile { // details. string etag = 2; - // Optional long form description of the use case for this AppProfile. + // Long form description of the use case for this AppProfile. string description = 3; // The routing policy for all read/write requests that use this app profile. diff --git a/protos/google/bigtable/admin/v2/table.proto b/protos/google/bigtable/admin/v2/table.proto index 4e2d709ab..4e5d2a4a7 100644 --- a/protos/google/bigtable/admin/v2/table.proto +++ b/protos/google/bigtable/admin/v2/table.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,14 +34,6 @@ option (google.api.resource_definition) = { pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" }; -// Indicates the type of the restore source. -enum RestoreSourceType { - // No restore associated. - RESTORE_SOURCE_TYPE_UNSPECIFIED = 0; - - // A backup was used as the source of the restore. - BACKUP = 1; -} // Information about a table restore. message RestoreInfo { @@ -96,15 +88,14 @@ message Table { } // Output only. The state of replication for the table in this cluster. - ReplicationState replication_state = 1; + ReplicationState replication_state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The encryption information for the table in this cluster. // If the encryption key protecting this resource is customer managed, then // its version can be rotated in Cloud Key Management Service (Cloud KMS). // The primary version of the key and its status will be reflected here when // changes propagate from Cloud KMS. - repeated EncryptionInfo encryption_info = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; + repeated EncryptionInfo encryption_info = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Possible timestamp granularities to use when keeping multiple versions @@ -133,7 +124,7 @@ message Table { // state. REPLICATION_VIEW = 3; - // Only populates 'name' and fields related to the table's encryption state. + // Only populates `name` and fields related to the table's encryption state. ENCRYPTION_VIEW = 5; // Populates all fields. @@ -150,23 +141,21 @@ message Table { // particular cluster (for example, if its zone is unavailable), then // there will be an entry for the cluster with UNKNOWN `replication_status`. // Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` - map cluster_states = 2; + map cluster_states = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - // (`CreationOnly`) // The column families configured for this table, mapped by column family ID. // Views: `SCHEMA_VIEW`, `FULL` map column_families = 3; - // (`CreationOnly`) - // The granularity (i.e. `MILLIS`) at which timestamps are stored in - // this table. Timestamps not matching the granularity will be rejected. + // 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`. - TimestampGranularity granularity = 4; + TimestampGranularity granularity = 4 [(google.api.field_behavior) = IMMUTABLE]; - // Output only. If this table was restored from another data source (e.g. a - // backup), this field will be populated with information about the restore. - RestoreInfo restore_info = 6; + // Output only. If this table was restored from another data source (e.g. a backup), this + // field will be populated with information about the restore. + RestoreInfo restore_info = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; } // A set of columns within a table which share a common configuration. @@ -238,17 +227,14 @@ message EncryptionInfo { } // Output only. The type of encryption used to protect this resource. - EncryptionType encryption_type = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; + EncryptionType encryption_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The status of encrypt/decrypt calls on underlying data for - // this resource. Regardless of status, the existing data is always encrypted - // at rest. - google.rpc.Status encryption_status = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The status of encrypt/decrypt calls on underlying data for this resource. + // Regardless of status, the existing data is always encrypted at rest. + google.rpc.Status encryption_status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The version of the Cloud KMS key specified in the parent - // cluster that is in use for the data underlying this table. + // Output only. The version of the Cloud KMS key specified in the parent cluster that is + // in use for the data underlying this table. string kms_key_version = 2 [ (google.api.field_behavior) = OUTPUT_ONLY, (google.api.resource_reference) = { @@ -333,7 +319,7 @@ message Backup { READY = 2; } - // Output only. A globally unique identifier for the backup which cannot be + // 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]*` @@ -343,10 +329,10 @@ message Backup { // The backup is stored in the cluster identified by the prefix of the backup // name of the form // `projects/{project}/instances/{instance}/clusters/{cluster}`. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + string name = 1; - // Required. Immutable. Name of the table from which this backup was created. - // This needs to be in the same instance as the backup. Values are of the form + // Required. Immutable. Name of the table from which this backup was created. This needs + // to be in the same instance as the backup. Values are of the form // `projects/{project}/instances/{instance}/tables/{source_table}`. string source_table = 2 [ (google.api.field_behavior) = IMMUTABLE, @@ -358,21 +344,17 @@ message Backup { // from the time the request is received. Once the `expire_time` // has passed, Cloud Bigtable will delete the backup and free the // resources used by the backup. - google.protobuf.Timestamp expire_time = 3 - [(google.api.field_behavior) = REQUIRED]; + google.protobuf.Timestamp expire_time = 3 [(google.api.field_behavior) = REQUIRED]; // Output only. `start_time` is the time that the backup was started // (i.e. approximately the time the - // [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup] - // request is received). The row data in this backup will be no older than - // this timestamp. - google.protobuf.Timestamp start_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup] request is received). The + // row data in this backup will be no older than this timestamp. + google.protobuf.Timestamp start_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. `end_time` is the time that the backup was finished. The row // data in the backup will be no newer than this timestamp. - google.protobuf.Timestamp end_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Size of the backup in bytes. int64 size_bytes = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -381,8 +363,7 @@ message Backup { State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The encryption information for the backup. - EncryptionInfo encryption_info = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; + EncryptionInfo encryption_info = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Information about a backup. @@ -392,14 +373,21 @@ message BackupInfo { // Output only. The time that the backup was started. Row data in the backup // will be no older than this timestamp. - google.protobuf.Timestamp start_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp start_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. This time that the backup was finished. Row data in the // backup will be no newer than this timestamp. - google.protobuf.Timestamp end_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp end_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Name of the table the backup was created from. string source_table = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; } + +// Indicates the type of the restore source. +enum RestoreSourceType { + // No restore associated. + RESTORE_SOURCE_TYPE_UNSPECIFIED = 0; + + // A backup was used as the source of the restore. + BACKUP = 1; +} diff --git a/protos/protos.d.ts b/protos/protos.d.ts index cc06d0e3a..a7cf2682d 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -1768,6 +1768,9 @@ export namespace google { /** CreateClusterMetadata finishTime */ finishTime?: (google.protobuf.ITimestamp|null); + + /** CreateClusterMetadata tables */ + tables?: ({ [k: string]: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress }|null); } /** Represents a CreateClusterMetadata. */ @@ -1788,6 +1791,9 @@ export namespace google { /** CreateClusterMetadata finishTime. */ public finishTime?: (google.protobuf.ITimestamp|null); + /** CreateClusterMetadata tables. */ + public tables: { [k: string]: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress }; + /** * Creates a new CreateClusterMetadata instance using the specified properties. * @param [properties] Properties to set @@ -1859,6 +1865,123 @@ export namespace google { public toJSON(): { [k: string]: any }; } + namespace CreateClusterMetadata { + + /** Properties of a TableProgress. */ + interface ITableProgress { + + /** TableProgress estimatedSizeBytes */ + estimatedSizeBytes?: (number|Long|string|null); + + /** TableProgress estimatedCopiedBytes */ + estimatedCopiedBytes?: (number|Long|string|null); + + /** TableProgress state */ + state?: (google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State|keyof typeof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State|null); + } + + /** Represents a TableProgress. */ + class TableProgress implements ITableProgress { + + /** + * Constructs a new TableProgress. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress); + + /** TableProgress estimatedSizeBytes. */ + public estimatedSizeBytes: (number|Long|string); + + /** TableProgress estimatedCopiedBytes. */ + public estimatedCopiedBytes: (number|Long|string); + + /** TableProgress state. */ + public state: (google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State|keyof typeof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State); + + /** + * Creates a new TableProgress instance using the specified properties. + * @param [properties] Properties to set + * @returns TableProgress instance + */ + public static create(properties?: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress): google.bigtable.admin.v2.CreateClusterMetadata.TableProgress; + + /** + * Encodes the specified TableProgress message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.verify|verify} messages. + * @param message TableProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableProgress message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.verify|verify} messages. + * @param message TableProgress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableProgress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.CreateClusterMetadata.TableProgress; + + /** + * Decodes a TableProgress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.CreateClusterMetadata.TableProgress; + + /** + * Verifies a TableProgress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableProgress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableProgress + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.CreateClusterMetadata.TableProgress; + + /** + * Creates a plain object from a TableProgress message. Also converts values to other types if specified. + * @param message TableProgress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.CreateClusterMetadata.TableProgress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableProgress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TableProgress { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + COPYING = 2, + COMPLETED = 3, + CANCELLED = 4 + } + } + } + /** Properties of an UpdateClusterMetadata. */ interface IUpdateClusterMetadata { @@ -3507,6 +3630,15 @@ export namespace google { namespace Cluster { + /** State enum. */ + enum State { + STATE_NOT_KNOWN = 0, + READY = 1, + CREATING = 2, + RESIZING = 3, + DISABLED = 4 + } + /** Properties of a ClusterAutoscalingConfig. */ interface IClusterAutoscalingConfig { @@ -3782,15 +3914,6 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } - - /** State enum. */ - enum State { - STATE_NOT_KNOWN = 0, - READY = 1, - CREATING = 2, - RESIZING = 3, - DISABLED = 4 - } } /** Properties of an AppProfile. */ @@ -7904,12 +8027,6 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** RestoreSourceType enum. */ - enum RestoreSourceType { - RESTORE_SOURCE_TYPE_UNSPECIFIED = 0, - BACKUP = 1 - } - /** Properties of a RestoreInfo. */ interface IRestoreInfo { @@ -9132,6 +9249,12 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** RestoreSourceType enum. */ + enum RestoreSourceType { + RESTORE_SOURCE_TYPE_UNSPECIFIED = 0, + BACKUP = 1 + } } } diff --git a/protos/protos.js b/protos/protos.js index 2732c14b2..f41e06fd0 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -3764,6 +3764,7 @@ * @property {google.bigtable.admin.v2.ICreateClusterRequest|null} [originalRequest] CreateClusterMetadata originalRequest * @property {google.protobuf.ITimestamp|null} [requestTime] CreateClusterMetadata requestTime * @property {google.protobuf.ITimestamp|null} [finishTime] CreateClusterMetadata finishTime + * @property {Object.|null} [tables] CreateClusterMetadata tables */ /** @@ -3775,6 +3776,7 @@ * @param {google.bigtable.admin.v2.ICreateClusterMetadata=} [properties] Properties to set */ function CreateClusterMetadata(properties) { + this.tables = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3805,6 +3807,14 @@ */ CreateClusterMetadata.prototype.finishTime = null; + /** + * CreateClusterMetadata tables. + * @member {Object.} tables + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @instance + */ + CreateClusterMetadata.prototype.tables = $util.emptyObject; + /** * Creates a new CreateClusterMetadata instance using the specified properties. * @function create @@ -3835,6 +3845,11 @@ $root.google.protobuf.Timestamp.encode(message.requestTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.tables != null && Object.hasOwnProperty.call(message, "tables")) + for (var keys = Object.keys(message.tables), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.encode(message.tables[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; @@ -3865,7 +3880,7 @@ CreateClusterMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateClusterMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateClusterMetadata(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3878,6 +3893,28 @@ case 3: message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; + case 4: + if (message.tables === $util.emptyObject) + message.tables = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.tables[key] = value; + break; default: reader.skipType(tag & 7); break; @@ -3928,6 +3965,16 @@ if (error) return "finishTime." + error; } + if (message.tables != null && message.hasOwnProperty("tables")) { + if (!$util.isObject(message.tables)) + return "tables: object expected"; + var key = Object.keys(message.tables); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.verify(message.tables[key[i]]); + if (error) + return "tables." + error; + } + } return null; }; @@ -3958,6 +4005,16 @@ throw TypeError(".google.bigtable.admin.v2.CreateClusterMetadata.finishTime: object expected"); message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); } + if (object.tables) { + if (typeof object.tables !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateClusterMetadata.tables: object expected"); + message.tables = {}; + for (var keys = Object.keys(object.tables), i = 0; i < keys.length; ++i) { + if (typeof object.tables[keys[i]] !== "object") + throw TypeError(".google.bigtable.admin.v2.CreateClusterMetadata.tables: object expected"); + message.tables[keys[i]] = $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.fromObject(object.tables[keys[i]]); + } + } return message; }; @@ -3974,6 +4031,8 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.tables = {}; if (options.defaults) { object.originalRequest = null; object.requestTime = null; @@ -3985,6 +4044,12 @@ object.requestTime = $root.google.protobuf.Timestamp.toObject(message.requestTime, options); if (message.finishTime != null && message.hasOwnProperty("finishTime")) object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + var keys2; + if (message.tables && (keys2 = Object.keys(message.tables)).length) { + object.tables = {}; + for (var j = 0; j < keys2.length; ++j) + object.tables[keys2[j]] = $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.toObject(message.tables[keys2[j]], options); + } return object; }; @@ -3999,6 +4064,314 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + CreateClusterMetadata.TableProgress = (function() { + + /** + * Properties of a TableProgress. + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @interface ITableProgress + * @property {number|Long|null} [estimatedSizeBytes] TableProgress estimatedSizeBytes + * @property {number|Long|null} [estimatedCopiedBytes] TableProgress estimatedCopiedBytes + * @property {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State|null} [state] TableProgress state + */ + + /** + * Constructs a new TableProgress. + * @memberof google.bigtable.admin.v2.CreateClusterMetadata + * @classdesc Represents a TableProgress. + * @implements ITableProgress + * @constructor + * @param {google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress=} [properties] Properties to set + */ + function TableProgress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableProgress estimatedSizeBytes. + * @member {number|Long} estimatedSizeBytes + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @instance + */ + TableProgress.prototype.estimatedSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableProgress estimatedCopiedBytes. + * @member {number|Long} estimatedCopiedBytes + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @instance + */ + TableProgress.prototype.estimatedCopiedBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableProgress state. + * @member {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State} state + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @instance + */ + TableProgress.prototype.state = 0; + + /** + * Creates a new TableProgress instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} TableProgress instance + */ + TableProgress.create = function create(properties) { + return new TableProgress(properties); + }; + + /** + * Encodes the specified TableProgress message. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress} message TableProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableProgress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.estimatedSizeBytes != null && Object.hasOwnProperty.call(message, "estimatedSizeBytes")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.estimatedSizeBytes); + if (message.estimatedCopiedBytes != null && Object.hasOwnProperty.call(message, "estimatedCopiedBytes")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.estimatedCopiedBytes); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + return writer; + }; + + /** + * Encodes the specified TableProgress message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {google.bigtable.admin.v2.CreateClusterMetadata.ITableProgress} message TableProgress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableProgress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableProgress message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} TableProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableProgress.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.estimatedSizeBytes = reader.int64(); + break; + case 3: + message.estimatedCopiedBytes = reader.int64(); + break; + case 4: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableProgress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} TableProgress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableProgress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableProgress message. + * @function verify + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableProgress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.estimatedSizeBytes != null && message.hasOwnProperty("estimatedSizeBytes")) + if (!$util.isInteger(message.estimatedSizeBytes) && !(message.estimatedSizeBytes && $util.isInteger(message.estimatedSizeBytes.low) && $util.isInteger(message.estimatedSizeBytes.high))) + return "estimatedSizeBytes: integer|Long expected"; + if (message.estimatedCopiedBytes != null && message.hasOwnProperty("estimatedCopiedBytes")) + if (!$util.isInteger(message.estimatedCopiedBytes) && !(message.estimatedCopiedBytes && $util.isInteger(message.estimatedCopiedBytes.low) && $util.isInteger(message.estimatedCopiedBytes.high))) + return "estimatedCopiedBytes: integer|Long expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a TableProgress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} TableProgress + */ + TableProgress.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) + return object; + var message = new $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress(); + if (object.estimatedSizeBytes != null) + if ($util.Long) + (message.estimatedSizeBytes = $util.Long.fromValue(object.estimatedSizeBytes)).unsigned = false; + else if (typeof object.estimatedSizeBytes === "string") + message.estimatedSizeBytes = parseInt(object.estimatedSizeBytes, 10); + else if (typeof object.estimatedSizeBytes === "number") + message.estimatedSizeBytes = object.estimatedSizeBytes; + else if (typeof object.estimatedSizeBytes === "object") + message.estimatedSizeBytes = new $util.LongBits(object.estimatedSizeBytes.low >>> 0, object.estimatedSizeBytes.high >>> 0).toNumber(); + if (object.estimatedCopiedBytes != null) + if ($util.Long) + (message.estimatedCopiedBytes = $util.Long.fromValue(object.estimatedCopiedBytes)).unsigned = false; + else if (typeof object.estimatedCopiedBytes === "string") + message.estimatedCopiedBytes = parseInt(object.estimatedCopiedBytes, 10); + else if (typeof object.estimatedCopiedBytes === "number") + message.estimatedCopiedBytes = object.estimatedCopiedBytes; + else if (typeof object.estimatedCopiedBytes === "object") + message.estimatedCopiedBytes = new $util.LongBits(object.estimatedCopiedBytes.low >>> 0, object.estimatedCopiedBytes.high >>> 0).toNumber(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "COPYING": + case 2: + message.state = 2; + break; + case "COMPLETED": + case 3: + message.state = 3; + break; + case "CANCELLED": + case 4: + message.state = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a TableProgress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @static + * @param {google.bigtable.admin.v2.CreateClusterMetadata.TableProgress} message TableProgress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableProgress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.estimatedSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.estimatedSizeBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.estimatedCopiedBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.estimatedCopiedBytes = options.longs === String ? "0" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.estimatedSizeBytes != null && message.hasOwnProperty("estimatedSizeBytes")) + if (typeof message.estimatedSizeBytes === "number") + object.estimatedSizeBytes = options.longs === String ? String(message.estimatedSizeBytes) : message.estimatedSizeBytes; + else + object.estimatedSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedSizeBytes) : options.longs === Number ? new $util.LongBits(message.estimatedSizeBytes.low >>> 0, message.estimatedSizeBytes.high >>> 0).toNumber() : message.estimatedSizeBytes; + if (message.estimatedCopiedBytes != null && message.hasOwnProperty("estimatedCopiedBytes")) + if (typeof message.estimatedCopiedBytes === "number") + object.estimatedCopiedBytes = options.longs === String ? String(message.estimatedCopiedBytes) : message.estimatedCopiedBytes; + else + object.estimatedCopiedBytes = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedCopiedBytes) : options.longs === Number ? new $util.LongBits(message.estimatedCopiedBytes.low >>> 0, message.estimatedCopiedBytes.high >>> 0).toNumber() : message.estimatedCopiedBytes; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State[message.state] : message.state; + return object; + }; + + /** + * Converts this TableProgress to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + * @instance + * @returns {Object.} JSON object + */ + TableProgress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} COPYING=2 COPYING value + * @property {number} COMPLETED=3 COMPLETED value + * @property {number} CANCELLED=4 CANCELLED value + */ + TableProgress.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "COPYING"] = 2; + values[valuesById[3] = "COMPLETED"] = 3; + values[valuesById[4] = "CANCELLED"] = 4; + return values; + })(); + + return TableProgress; + })(); + return CreateClusterMetadata; })(); @@ -7990,6 +8363,26 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * State enum. + * @name google.bigtable.admin.v2.Cluster.State + * @enum {number} + * @property {number} STATE_NOT_KNOWN=0 STATE_NOT_KNOWN value + * @property {number} READY=1 READY value + * @property {number} CREATING=2 CREATING value + * @property {number} RESIZING=3 RESIZING value + * @property {number} DISABLED=4 DISABLED value + */ + Cluster.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_NOT_KNOWN"] = 0; + values[valuesById[1] = "READY"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "RESIZING"] = 3; + values[valuesById[4] = "DISABLED"] = 4; + return values; + })(); + Cluster.ClusterAutoscalingConfig = (function() { /** @@ -8589,26 +8982,6 @@ return EncryptionConfig; })(); - /** - * State enum. - * @name google.bigtable.admin.v2.Cluster.State - * @enum {number} - * @property {number} STATE_NOT_KNOWN=0 STATE_NOT_KNOWN value - * @property {number} READY=1 READY value - * @property {number} CREATING=2 CREATING value - * @property {number} RESIZING=3 RESIZING value - * @property {number} DISABLED=4 DISABLED value - */ - Cluster.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_NOT_KNOWN"] = 0; - values[valuesById[1] = "READY"] = 1; - values[valuesById[2] = "CREATING"] = 2; - values[valuesById[3] = "RESIZING"] = 3; - values[valuesById[4] = "DISABLED"] = 4; - return values; - })(); - return Cluster; })(); @@ -17900,20 +18273,6 @@ return ListBackupsResponse; })(); - /** - * RestoreSourceType enum. - * @name google.bigtable.admin.v2.RestoreSourceType - * @enum {number} - * @property {number} RESTORE_SOURCE_TYPE_UNSPECIFIED=0 RESTORE_SOURCE_TYPE_UNSPECIFIED value - * @property {number} BACKUP=1 BACKUP value - */ - v2.RestoreSourceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESTORE_SOURCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "BACKUP"] = 1; - return values; - })(); - v2.RestoreInfo = (function() { /** @@ -21105,6 +21464,20 @@ return BackupInfo; })(); + /** + * RestoreSourceType enum. + * @name google.bigtable.admin.v2.RestoreSourceType + * @enum {number} + * @property {number} RESTORE_SOURCE_TYPE_UNSPECIFIED=0 RESTORE_SOURCE_TYPE_UNSPECIFIED value + * @property {number} BACKUP=1 BACKUP value + */ + v2.RestoreSourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESTORE_SOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BACKUP"] = 1; + return values; + })(); + return v2; })(); diff --git a/protos/protos.json b/protos/protos.json index 64b6e60f2..2d250f758 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -706,6 +706,40 @@ "finishTime": { "type": "google.protobuf.Timestamp", "id": 3 + }, + "tables": { + "keyType": "string", + "type": "TableProgress", + "id": 4 + } + }, + "nested": { + "TableProgress": { + "fields": { + "estimatedSizeBytes": { + "type": "int64", + "id": 2 + }, + "estimatedCopiedBytes": { + "type": "int64", + "id": 3 + }, + "state": { + "type": "State", + "id": 4 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "COPYING": 2, + "COMPLETED": 3, + "CANCELLED": 4 + } + } + } } } }, @@ -932,10 +966,7 @@ "fields": { "name": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "id": 1 }, "displayName": { "type": "string", @@ -1023,15 +1054,13 @@ "fields": { "name": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "id": 1 }, "location": { "type": "string", "id": 2, "options": { + "(google.api.field_behavior)": "IMMUTABLE", "(google.api.resource_reference).type": "locations.googleapis.com/Location" } }, @@ -1052,7 +1081,10 @@ }, "defaultStorageType": { "type": "StorageType", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } }, "encryptionConfig": { "type": "EncryptionConfig", @@ -1063,6 +1095,15 @@ } }, "nested": { + "State": { + "values": { + "STATE_NOT_KNOWN": 0, + "READY": 1, + "CREATING": 2, + "RESIZING": 3, + "DISABLED": 4 + } + }, "ClusterAutoscalingConfig": { "fields": { "autoscalingLimits": { @@ -1099,15 +1140,6 @@ } } } - }, - "State": { - "values": { - "STATE_NOT_KNOWN": 0, - "READY": 1, - "CREATING": 2, - "RESIZING": 3, - "DISABLED": 4 - } } } }, @@ -2301,12 +2333,6 @@ } } }, - "RestoreSourceType": { - "values": { - "RESTORE_SOURCE_TYPE_UNSPECIFIED": 0, - "BACKUP": 1 - } - }, "RestoreInfo": { "oneofs": { "sourceInfo": { @@ -2339,7 +2365,10 @@ "clusterStates": { "keyType": "string", "type": "ClusterState", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "columnFamilies": { "keyType": "string", @@ -2348,11 +2377,17 @@ }, "granularity": { "type": "TimestampGranularity", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } }, "restoreInfo": { "type": "RestoreInfo", - "id": 6 + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -2360,7 +2395,10 @@ "fields": { "replicationState": { "type": "ReplicationState", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "encryptionInfo": { "rule": "repeated", @@ -2548,10 +2586,7 @@ "fields": { "name": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "id": 1 }, "sourceTable": { "type": "string", @@ -2644,6 +2679,12 @@ } } } + }, + "RestoreSourceType": { + "values": { + "RESTORE_SOURCE_TYPE_UNSPECIFIED": 0, + "BACKUP": 1 + } } } } diff --git a/samples/generated/v2/bigtable_instance_admin.update_cluster.js b/samples/generated/v2/bigtable_instance_admin.update_cluster.js index 9a8ced3c2..06a4a75ca 100644 --- a/samples/generated/v2/bigtable_instance_admin.update_cluster.js +++ b/samples/generated/v2/bigtable_instance_admin.update_cluster.js @@ -20,7 +20,7 @@ 'use strict'; -function main(name, state, encryptionConfig) { +function main(location, state, defaultStorageType, encryptionConfig) { // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_async] /** * TODO(developer): Uncomment these variables before running the sample. @@ -31,15 +31,14 @@ function main(name, state, encryptionConfig) { */ // const name = 'abc123' /** - * (`CreationOnly`) - * The location where this cluster's nodes and storage reside. For best + * 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}`. */ // const location = 'abc123' /** - * The current state of the cluster. + * Output only. The current state of the cluster. */ // const state = {} /** @@ -52,8 +51,7 @@ function main(name, state, encryptionConfig) { */ // const clusterConfig = {} /** - * (`CreationOnly`) - * The type of storage used by this cluster to serve its + * Immutable. The type of storage used by this cluster to serve its * parent instance's tables, unless explicitly overridden. */ // const defaultStorageType = {} @@ -71,8 +69,9 @@ function main(name, state, encryptionConfig) { async function callUpdateCluster() { // Construct request const request = { - name, + location, state, + defaultStorageType, encryptionConfig, }; diff --git a/samples/generated/v2/bigtable_instance_admin.update_instance.js b/samples/generated/v2/bigtable_instance_admin.update_instance.js index 83cc071a9..e1bb22337 100644 --- a/samples/generated/v2/bigtable_instance_admin.update_instance.js +++ b/samples/generated/v2/bigtable_instance_admin.update_instance.js @@ -20,7 +20,7 @@ 'use strict'; -function main(name, displayName, createTime) { +function main(displayName, createTime) { // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_async] /** * TODO(developer): Uncomment these variables before running the sample. @@ -74,7 +74,6 @@ function main(name, displayName, createTime) { async function callUpdateInstance() { // Construct request const request = { - name, displayName, createTime, }; diff --git a/samples/generated/v2/snippet_metadata.google.bigtable.admin.v2.json b/samples/generated/v2/snippet_metadata.google.bigtable.admin.v2.json index df941bf18..870eca870 100644 --- a/samples/generated/v2/snippet_metadata.google.bigtable.admin.v2.json +++ b/samples/generated/v2/snippet_metadata.google.bigtable.admin.v2.json @@ -158,7 +158,7 @@ "segments": [ { "start": 25, - "end": 87, + "end": 86, "type": "FULL" } ], @@ -434,7 +434,7 @@ "segments": [ { "start": 25, - "end": 85, + "end": 84, "type": "FULL" } ], diff --git a/src/v2/bigtable_client.ts b/src/v2/bigtable_client.ts index db28c40b5..1939a89b4 100644 --- a/src/v2/bigtable_client.ts +++ b/src/v2/bigtable_client.ts @@ -174,13 +174,16 @@ export class BigtableClient { // Provide descriptors for these. this.descriptors.stream = { readRows: new this._gaxModule.StreamDescriptor( - gax.StreamType.SERVER_STREAMING + gax.StreamType.SERVER_STREAMING, + opts.fallback === 'rest' ), sampleRowKeys: new this._gaxModule.StreamDescriptor( - gax.StreamType.SERVER_STREAMING + gax.StreamType.SERVER_STREAMING, + opts.fallback === 'rest' ), mutateRows: new this._gaxModule.StreamDescriptor( - gax.StreamType.SERVER_STREAMING + gax.StreamType.SERVER_STREAMING, + opts.fallback === 'rest' ), }; diff --git a/src/v2/bigtable_instance_admin_client.ts b/src/v2/bigtable_instance_admin_client.ts index 1ba512394..a044acc2f 100644 --- a/src/v2/bigtable_instance_admin_client.ts +++ b/src/v2/bigtable_instance_admin_client.ts @@ -2109,21 +2109,19 @@ export class BigtableInstanceAdminClient { * The unique name of the cluster. Values are of the form * `projects/{project}/instances/{instance}/clusters/{@link -a-z0-9|a-z}*`. * @param {string} request.location - * (`CreationOnly`) - * The location where this cluster's nodes and storage reside. For best + * 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}`. * @param {google.bigtable.admin.v2.Cluster.State} request.state - * The current state of the cluster. + * Output only. The current state of the cluster. * @param {number} request.serveNodes * The number of nodes allocated to this cluster. More nodes enable higher * throughput and more consistent performance. * @param {google.bigtable.admin.v2.Cluster.ClusterConfig} request.clusterConfig * Configuration for this cluster. * @param {google.bigtable.admin.v2.StorageType} request.defaultStorageType - * (`CreationOnly`) - * The type of storage used by this cluster to serve its + * Immutable. The type of storage used by this cluster to serve its * parent instance's tables, unless explicitly overridden. * @param {google.bigtable.admin.v2.Cluster.EncryptionConfig} request.encryptionConfig * Immutable. The encryption configuration for CMEK-protected clusters. diff --git a/src/v2/bigtable_instance_admin_client_config.json b/src/v2/bigtable_instance_admin_client_config.json index bb5e050c1..5080d33ee 100644 --- a/src/v2/bigtable_instance_admin_client_config.json +++ b/src/v2/bigtable_instance_admin_client_config.json @@ -80,9 +80,8 @@ "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" }, "PartialUpdateCluster": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" }, "DeleteCluster": { "timeout_millis": 60000, diff --git a/system-test/install.ts b/system-test/install.ts index 9beb2ba62..6dd1eaada 100644 --- a/system-test/install.ts +++ b/system-test/install.ts @@ -46,14 +46,6 @@ describe('📦 pack-n-play test', () => { ).toString(), }, }; - try { - await packNTest(options); - } catch (e) { - // all of the actionable information is on the output attribute - if ((e as any).output) { - (e as any).message += 'output: ' + (e as any).output; - } - throw e; - } + await packNTest(options); }); });