diff --git a/package.json b/package.json index bd611571d..ad69ec4ab 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,6 @@ "google-gax": "^1.0.0", "is": "^3.0.1", "is-utf8": "^0.2.1", - "lodash.merge": "^4.6.0", "lodash.snakecase": "^4.1.1", "long": "^4.0.0", "protobufjs": "^6.8.0", diff --git a/protos/google/bigtable/admin/v2/bigtable_instance_admin.proto b/protos/google/bigtable/admin/v2/bigtable_instance_admin.proto index 6f883834a..80ce42470 100644 --- a/protos/google/bigtable/admin/v2/bigtable_instance_admin.proto +++ b/protos/google/bigtable/admin/v2/bigtable_instance_admin.proto @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. +// Copyright 2018 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// syntax = "proto3"; @@ -32,149 +33,162 @@ option java_outer_classname = "BigtableInstanceAdminProto"; option java_package = "com.google.bigtable.admin.v2"; option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; - // Service for creating, configuring, and deleting Cloud Bigtable Instances and // Clusters. Provides access to the Instance and Cluster schemas only, not the // tables' metadata or data stored in those tables. service BigtableInstanceAdmin { // Create an instance within a project. - rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { post: "/v2/{parent=projects/*}/instances" body: "*" }; + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/instances" + body: "*" + }; } // Gets information about an instance. rpc GetInstance(GetInstanceRequest) returns (Instance) { - option (google.api.http) = { get: "/v2/{name=projects/*/instances/*}" }; + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*}" + }; } // Lists information about instances in a project. rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { - option (google.api.http) = { get: "/v2/{parent=projects/*}/instances" }; + option (google.api.http) = { + get: "/v2/{parent=projects/*}/instances" + }; } // Updates an instance within a project. rpc UpdateInstance(Instance) returns (Instance) { - option (google.api.http) = { put: "/v2/{name=projects/*/instances/*}" body: "*" }; + option (google.api.http) = { + put: "/v2/{name=projects/*/instances/*}" + body: "*" + }; } // Partially updates an instance within a project. - rpc PartialUpdateInstance(PartialUpdateInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { patch: "/v2/{instance.name=projects/*/instances/*}" body: "instance" }; + rpc PartialUpdateInstance(PartialUpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{instance.name=projects/*/instances/*}" + body: "instance" + }; } // Delete an instance from a project. rpc DeleteInstance(DeleteInstanceRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { delete: "/v2/{name=projects/*/instances/*}" }; + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*}" + }; } // Creates a cluster within an instance. - rpc CreateCluster(CreateClusterRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { post: "/v2/{parent=projects/*/instances/*}/clusters" body: "cluster" }; + rpc CreateCluster(CreateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/clusters" + body: "cluster" + }; } // Gets information about a cluster. rpc GetCluster(GetClusterRequest) returns (Cluster) { - option (google.api.http) = { get: "/v2/{name=projects/*/instances/*/clusters/*}" }; + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/clusters/*}" + }; } // Lists information about clusters in an instance. rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { - option (google.api.http) = { get: "/v2/{parent=projects/*/instances/*}/clusters" }; + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*}/clusters" + }; } // Updates a cluster within an instance. rpc UpdateCluster(Cluster) returns (google.longrunning.Operation) { - option (google.api.http) = { put: "/v2/{name=projects/*/instances/*/clusters/*}" body: "*" }; + option (google.api.http) = { + put: "/v2/{name=projects/*/instances/*/clusters/*}" + body: "*" + }; } // Deletes a cluster from an instance. rpc DeleteCluster(DeleteClusterRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { delete: "/v2/{name=projects/*/instances/*/clusters/*}" }; + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/clusters/*}" + }; } - // This is a private alpha release of Cloud Bigtable replication. This feature - // is not currently available to most Cloud Bigtable customers. This feature - // might be changed in backward-incompatible ways and is not recommended for - // production use. It is not subject to any SLA or deprecation policy. - // // Creates an app profile within an instance. rpc CreateAppProfile(CreateAppProfileRequest) returns (AppProfile) { - option (google.api.http) = { post: "/v2/{parent=projects/*/instances/*}/appProfiles" body: "app_profile" }; + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/appProfiles" + body: "app_profile" + }; } - // This is a private alpha release of Cloud Bigtable replication. This feature - // is not currently available to most Cloud Bigtable customers. This feature - // might be changed in backward-incompatible ways and is not recommended for - // production use. It is not subject to any SLA or deprecation policy. - // // Gets information about an app profile. rpc GetAppProfile(GetAppProfileRequest) returns (AppProfile) { - option (google.api.http) = { get: "/v2/{name=projects/*/instances/*/appProfiles/*}" }; + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/appProfiles/*}" + }; } - // This is a private alpha release of Cloud Bigtable replication. This feature - // is not currently available to most Cloud Bigtable customers. This feature - // might be changed in backward-incompatible ways and is not recommended for - // production use. It is not subject to any SLA or deprecation policy. - // // Lists information about app profiles in an instance. - rpc ListAppProfiles(ListAppProfilesRequest) returns (ListAppProfilesResponse) { - option (google.api.http) = { get: "/v2/{parent=projects/*/instances/*}/appProfiles" }; + rpc ListAppProfiles(ListAppProfilesRequest) + returns (ListAppProfilesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*}/appProfiles" + }; } - // This is a private alpha release of Cloud Bigtable replication. This feature - // is not currently available to most Cloud Bigtable customers. This feature - // might be changed in backward-incompatible ways and is not recommended for - // production use. It is not subject to any SLA or deprecation policy. - // // Updates an app profile within an instance. - rpc UpdateAppProfile(UpdateAppProfileRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { patch: "/v2/{app_profile.name=projects/*/instances/*/appProfiles/*}" body: "app_profile" }; + rpc UpdateAppProfile(UpdateAppProfileRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{app_profile.name=projects/*/instances/*/appProfiles/*}" + body: "app_profile" + }; } - // This is a private alpha release of Cloud Bigtable replication. This feature - // is not currently available to most Cloud Bigtable customers. This feature - // might be changed in backward-incompatible ways and is not recommended for - // production use. It is not subject to any SLA or deprecation policy. - // // Deletes an app profile from an instance. - rpc DeleteAppProfile(DeleteAppProfileRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { delete: "/v2/{name=projects/*/instances/*/appProfiles/*}" }; + rpc DeleteAppProfile(DeleteAppProfileRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/appProfiles/*}" + }; } - // This is a private alpha release of Cloud Bigtable instance level - // permissions. This feature is not currently available to most Cloud Bigtable - // customers. This feature might be changed in backward-incompatible ways and - // is not recommended for production use. It is not subject to any SLA or - // deprecation policy. - // // Gets the access control policy for an instance resource. Returns an empty // policy if an instance exists but does not have a policy set. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.http) = { post: "/v2/{resource=projects/*/instances/*}:getIamPolicy" body: "*" }; + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/instances/*}:getIamPolicy" + body: "*" + }; } - // This is a private alpha release of Cloud Bigtable instance level - // permissions. This feature is not currently available to most Cloud Bigtable - // customers. This feature might be changed in backward-incompatible ways and - // is not recommended for production use. It is not subject to any SLA or - // deprecation policy. - // // Sets the access control policy on an instance resource. Replaces any // existing policy. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.http) = { post: "/v2/{resource=projects/*/instances/*}:setIamPolicy" body: "*" }; + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/instances/*}:setIamPolicy" + body: "*" + }; } - // This is a private alpha release of Cloud Bigtable instance level - // permissions. This feature is not currently available to most Cloud Bigtable - // customers. This feature might be changed in backward-incompatible ways and - // is not recommended for production use. It is not subject to any SLA or - // deprecation policy. - // // Returns permissions that the caller has on the specified instance resource. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { post: "/v2/{resource=projects/*/instances/*}:testIamPermissions" body: "*" }; + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v2/{resource=projects/*/instances/*}:testIamPermissions" + body: "*" + }; } } @@ -197,7 +211,7 @@ message CreateInstanceRequest { // cluster ID, e.g., just `mycluster` rather than // `projects/myproject/instances/myinstance/clusters/mycluster`. // Fields marked `OutputOnly` must be left blank. - // Currently exactly one cluster must be specified. + // Currently, at most two clusters can be specified. map clusters = 4; } @@ -214,7 +228,7 @@ message ListInstancesRequest { // Values are of the form `projects/`. string parent = 1; - // The value of `next_page_token` returned by a previous call. + // DEPRECATED: This field is unused and ignored. string page_token = 2; } @@ -228,11 +242,10 @@ message ListInstancesResponse { // Instances whose Clusters are all in one of the failed locations // may be missing from `instances`, and Instances with at least one // Cluster in a failed location may only have partial information returned. + // Values are of the form `projects//locations/` repeated string failed_locations = 2; - // Set if not all instances could be returned in a single response. - // Pass this value to `page_token` in another request to get the next - // page of results. + // DEPRECATED: This field is unused and ignored. string next_page_token = 3; } @@ -285,7 +298,7 @@ message ListClustersRequest { // e.g., `projects/myproject/instances/-`. string parent = 1; - // The value of `next_page_token` returned by a previous call. + // DEPRECATED: This field is unused and ignored. string page_token = 2; } @@ -298,11 +311,10 @@ message ListClustersResponse { // due to an outage or some other transient condition. // Clusters from these locations may be missing from `clusters`, // or may only have partial information returned. + // Values are of the form `projects//locations/` repeated string failed_locations = 2; - // Set if not all clusters could be returned in a single response. - // Pass this value to `page_token` in another request to get the next - // page of results. + // DEPRECATED: This field is unused and ignored. string next_page_token = 3; } @@ -361,11 +373,6 @@ message UpdateClusterMetadata { google.protobuf.Timestamp finish_time = 3; } -// This is a private alpha release of Cloud Bigtable replication. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // Request message for BigtableInstanceAdmin.CreateAppProfile. message CreateAppProfileRequest { // The unique name of the instance in which to create the new app profile. @@ -386,11 +393,6 @@ message CreateAppProfileRequest { bool ignore_warnings = 4; } -// This is a private alpha release of Cloud Bigtable replication. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // Request message for BigtableInstanceAdmin.GetAppProfile. message GetAppProfileRequest { // The unique name of the requested app profile. Values are of the form @@ -398,27 +400,23 @@ message GetAppProfileRequest { string name = 1; } -// This is a private alpha release of Cloud Bigtable replication. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // Request message for BigtableInstanceAdmin.ListAppProfiles. message ListAppProfilesRequest { // The unique name of the instance for which a list of app profiles is // requested. Values are of the form // `projects//instances/`. + // Use ` = '-'` to list AppProfiles for all Instances in a project, + // e.g., `projects/myproject/instances/-`. string parent = 1; + // Maximum number of results per page. + // CURRENTLY UNIMPLEMENTED AND IGNORED. + int32 page_size = 3; + // The value of `next_page_token` returned by a previous call. string page_token = 2; } -// This is a private alpha release of Cloud Bigtable replication. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // Response message for BigtableInstanceAdmin.ListAppProfiles. message ListAppProfilesResponse { // The list of requested app profiles. @@ -428,13 +426,14 @@ message ListAppProfilesResponse { // Pass this value to `page_token` in another request to get the next // page of results. string next_page_token = 2; + + // Locations from which AppProfile information could not be retrieved, + // due to an outage or some other transient condition. + // AppProfiles from these locations may be missing from `app_profiles`. + // Values are of the form `projects//locations/` + repeated string failed_locations = 3; } -// This is a private alpha release of Cloud Bigtable replication. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // Request message for BigtableInstanceAdmin.UpdateAppProfile. message UpdateAppProfileRequest { // The app profile which will (partially) replace the current value. @@ -448,11 +447,6 @@ message UpdateAppProfileRequest { bool ignore_warnings = 3; } -// This is a private alpha release of Cloud Bigtable replication. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // Request message for BigtableInstanceAdmin.DeleteAppProfile. message DeleteAppProfileRequest { // The unique name of the app profile to be deleted. Values are of the form @@ -463,12 +457,5 @@ message DeleteAppProfileRequest { bool ignore_warnings = 2; } -// This is a private alpha release of Cloud Bigtable replication. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // The metadata for the Operation returned by UpdateAppProfile. -message UpdateAppProfileMetadata { - -} +message UpdateAppProfileMetadata {} diff --git a/protos/google/bigtable/admin/v2/bigtable_table_admin.proto b/protos/google/bigtable/admin/v2/bigtable_table_admin.proto index 8abdb3ced..79c461e05 100644 --- a/protos/google/bigtable/admin/v2/bigtable_table_admin.proto +++ b/protos/google/bigtable/admin/v2/bigtable_table_admin.proto @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. +// Copyright 2018 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// syntax = "proto3"; @@ -30,7 +31,6 @@ option java_outer_classname = "BigtableTableAdminProto"; option java_package = "com.google.bigtable.admin.v2"; option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; - // Service for creating, configuring, and deleting Cloud Bigtable tables. // // @@ -41,33 +41,47 @@ service BigtableTableAdmin { // The table can be created with a full set of initial column families, // specified in the request. rpc CreateTable(CreateTableRequest) returns (Table) { - option (google.api.http) = { post: "/v2/{parent=projects/*/instances/*}/tables" body: "*" }; + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/tables" + body: "*" + }; } - // This is a private alpha release of Cloud Bigtable snapshots. This feature - // is not currently available to most Cloud Bigtable customers. This feature - // might be changed in backward-incompatible ways and is not recommended for - // production use. It is not subject to any SLA or deprecation policy. - // // Creates a new table from the specified snapshot. The target table must // not exist. The snapshot and the table must be in the same instance. - rpc CreateTableFromSnapshot(CreateTableFromSnapshotRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { post: "/v2/{parent=projects/*/instances/*}/tables:createFromSnapshot" body: "*" }; + // + // Note: This is a private alpha release of Cloud Bigtable snapshots. This + // feature is not currently available to most Cloud Bigtable customers. This + // feature might be changed in backward-incompatible ways and is not + // recommended for production use. It is not subject to any SLA or deprecation + // policy. + rpc CreateTableFromSnapshot(CreateTableFromSnapshotRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/instances/*}/tables:createFromSnapshot" + body: "*" + }; } // Lists all tables served from a specified instance. rpc ListTables(ListTablesRequest) returns (ListTablesResponse) { - option (google.api.http) = { get: "/v2/{parent=projects/*/instances/*}/tables" }; + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*}/tables" + }; } // Gets metadata information about the specified table. rpc GetTable(GetTableRequest) returns (Table) { - option (google.api.http) = { get: "/v2/{name=projects/*/instances/*/tables/*}" }; + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/tables/*}" + }; } // Permanently deletes a specified table and all of its data. rpc DeleteTable(DeleteTableRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { delete: "/v2/{name=projects/*/instances/*/tables/*}" }; + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/tables/*}" + }; } // Performs a series of column family modifications on the specified table. @@ -75,80 +89,98 @@ service BigtableTableAdmin { // returns, but data requests received prior to that point may see a table // where only some modifications have taken effect. rpc ModifyColumnFamilies(ModifyColumnFamiliesRequest) returns (Table) { - option (google.api.http) = { post: "/v2/{name=projects/*/instances/*/tables/*}:modifyColumnFamilies" body: "*" }; + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:modifyColumnFamilies" + body: "*" + }; } // Permanently drop/delete a row range from a specified table. The request can // specify whether to delete all rows in a table, or only those that match a // particular prefix. rpc DropRowRange(DropRowRangeRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { post: "/v2/{name=projects/*/instances/*/tables/*}:dropRowRange" body: "*" }; + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:dropRowRange" + body: "*" + }; } - // This is a private alpha release of Cloud Bigtable replication. This feature - // is not currently available to most Cloud Bigtable customers. This feature - // might be changed in backward-incompatible ways and is not recommended for - // production use. It is not subject to any SLA or deprecation policy. - // // Generates a consistency token for a Table, which can be used in // CheckConsistency to check whether mutations to the table that finished // before this call started have been replicated. The tokens will be available // for 90 days. - rpc GenerateConsistencyToken(GenerateConsistencyTokenRequest) returns (GenerateConsistencyTokenResponse) { - option (google.api.http) = { post: "/v2/{name=projects/*/instances/*/tables/*}:generateConsistencyToken" body: "*" }; + rpc GenerateConsistencyToken(GenerateConsistencyTokenRequest) + returns (GenerateConsistencyTokenResponse) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:generateConsistencyToken" + body: "*" + }; } - // This is a private alpha release of Cloud Bigtable replication. This feature - // is not currently available to most Cloud Bigtable customers. This feature - // might be changed in backward-incompatible ways and is not recommended for - // production use. It is not subject to any SLA or deprecation policy. - // // Checks replication consistency based on a consistency token, that is, if // replication has caught up based on the conditions specified in the token // and the check request. - rpc CheckConsistency(CheckConsistencyRequest) returns (CheckConsistencyResponse) { - option (google.api.http) = { post: "/v2/{name=projects/*/instances/*/tables/*}:checkConsistency" body: "*" }; + rpc CheckConsistency(CheckConsistencyRequest) + returns (CheckConsistencyResponse) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:checkConsistency" + body: "*" + }; } - // This is a private alpha release of Cloud Bigtable snapshots. This feature - // is not currently available to most Cloud Bigtable customers. This feature - // might be changed in backward-incompatible ways and is not recommended for - // production use. It is not subject to any SLA or deprecation policy. - // // Creates a new snapshot in the specified cluster from the specified // source table. The cluster and the table must be in the same instance. - rpc SnapshotTable(SnapshotTableRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { post: "/v2/{name=projects/*/instances/*/tables/*}:snapshot" body: "*" }; + // + // Note: This is a private alpha release of Cloud Bigtable snapshots. This + // feature is not currently available to most Cloud Bigtable customers. This + // feature might be changed in backward-incompatible ways and is not + // recommended for production use. It is not subject to any SLA or deprecation + // policy. + rpc SnapshotTable(SnapshotTableRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*/tables/*}:snapshot" + body: "*" + }; } - // This is a private alpha release of Cloud Bigtable snapshots. This feature - // is not currently available to most Cloud Bigtable customers. This feature - // might be changed in backward-incompatible ways and is not recommended for - // production use. It is not subject to any SLA or deprecation policy. - // // Gets metadata information about the specified snapshot. + // + // Note: This is a private alpha release of Cloud Bigtable snapshots. This + // feature is not currently available to most Cloud Bigtable customers. This + // feature might be changed in backward-incompatible ways and is not + // recommended for production use. It is not subject to any SLA or deprecation + // policy. rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) { - option (google.api.http) = { get: "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}" }; + option (google.api.http) = { + get: "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}" + }; } - // This is a private alpha release of Cloud Bigtable snapshots. This feature - // is not currently available to most Cloud Bigtable customers. This feature - // might be changed in backward-incompatible ways and is not recommended for - // production use. It is not subject to any SLA or deprecation policy. - // // Lists all snapshots associated with the specified cluster. + // + // Note: This is a private alpha release of Cloud Bigtable snapshots. This + // feature is not currently available to most Cloud Bigtable customers. This + // feature might be changed in backward-incompatible ways and is not + // recommended for production use. It is not subject to any SLA or deprecation + // policy. rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) { - option (google.api.http) = { get: "/v2/{parent=projects/*/instances/*/clusters/*}/snapshots" }; + option (google.api.http) = { + get: "/v2/{parent=projects/*/instances/*/clusters/*}/snapshots" + }; } - // This is a private alpha release of Cloud Bigtable snapshots. This feature - // is not currently available to most Cloud Bigtable customers. This feature - // might be changed in backward-incompatible ways and is not recommended for - // production use. It is not subject to any SLA or deprecation policy. - // // Permanently deletes the specified snapshot. + // + // Note: This is a private alpha release of Cloud Bigtable snapshots. This + // feature is not currently available to most Cloud Bigtable customers. This + // feature might be changed in backward-incompatible ways and is not + // recommended for production use. It is not subject to any SLA or deprecation + // policy. rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { delete: "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}" }; + option (google.api.http) = { + delete: "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}" + }; } } @@ -191,13 +223,13 @@ message CreateTableRequest { repeated Split initial_splits = 4; } -// This is a private alpha release of Cloud Bigtable snapshots. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // Request message for // [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. message CreateTableFromSnapshotRequest { // The unique name of the instance in which to create the table. // Values are of the form `projects//instances/`. @@ -244,6 +276,10 @@ message ListTablesRequest { // Defaults to `NAME_ONLY` if unspecified; no others are currently supported. Table.View view = 2; + // Maximum number of results per page. + // CURRENTLY UNIMPLEMENTED AND IGNORED. + int32 page_size = 4; + // The value of `next_page_token` returned by a previous call. string page_token = 3; } @@ -318,11 +354,6 @@ message ModifyColumnFamiliesRequest { repeated Modification modifications = 2; } -// This is a private alpha release of Cloud Bigtable replication. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // Request message for // [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] message GenerateConsistencyTokenRequest { @@ -332,11 +363,6 @@ message GenerateConsistencyTokenRequest { string name = 1; } -// This is a private alpha release of Cloud Bigtable replication. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // Response message for // [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] message GenerateConsistencyTokenResponse { @@ -344,11 +370,6 @@ message GenerateConsistencyTokenResponse { string consistency_token = 1; } -// This is a private alpha release of Cloud Bigtable replication. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // Request message for // [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] message CheckConsistencyRequest { @@ -361,11 +382,6 @@ message CheckConsistencyRequest { string consistency_token = 2; } -// This is a private alpha release of Cloud Bigtable replication. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // Response message for // [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] message CheckConsistencyResponse { @@ -374,13 +390,13 @@ message CheckConsistencyResponse { bool consistent = 1; } -// This is a private alpha release of Cloud Bigtable snapshots. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // Request message for // [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable][google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. message SnapshotTableRequest { // The unique name of the table to have the snapshot taken. // Values are of the form @@ -408,13 +424,13 @@ message SnapshotTableRequest { string description = 5; } -// This is a private alpha release of Cloud Bigtable snapshots. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // Request message for // [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. message GetSnapshotRequest { // The unique name of the requested snapshot. // Values are of the form @@ -422,13 +438,13 @@ message GetSnapshotRequest { string name = 1; } -// This is a private alpha release of Cloud Bigtable snapshots. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // Request message for // [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. message ListSnapshotsRequest { // The unique name of the cluster for which snapshots should be listed. // Values are of the form @@ -437,20 +453,21 @@ message ListSnapshotsRequest { // e.g., `projects//instances//clusters/-`. string parent = 1; - // The maximum number of snapshots to return. + // The maximum number of snapshots to return per page. + // CURRENTLY UNIMPLEMENTED AND IGNORED. int32 page_size = 2; // The value of `next_page_token` returned by a previous call. string page_token = 3; } -// This is a private alpha release of Cloud Bigtable snapshots. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // Response message for // [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. message ListSnapshotsResponse { // The snapshots present in the requested cluster. repeated Snapshot snapshots = 1; @@ -461,13 +478,13 @@ message ListSnapshotsResponse { string next_page_token = 2; } -// This is a private alpha release of Cloud Bigtable snapshots. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // Request message for // [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot] +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. message DeleteSnapshotRequest { // The unique name of the snapshot to be deleted. // Values are of the form @@ -475,12 +492,12 @@ message DeleteSnapshotRequest { string name = 1; } -// This is a private alpha release of Cloud Bigtable snapshots. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // The metadata for the Operation returned by SnapshotTable. +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. message SnapshotTableMetadata { // The request that prompted the initiation of this SnapshotTable operation. SnapshotTableRequest original_request = 1; @@ -492,12 +509,12 @@ message SnapshotTableMetadata { google.protobuf.Timestamp finish_time = 3; } -// This is a private alpha release of Cloud Bigtable snapshots. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // The metadata for the Operation returned by CreateTableFromSnapshot. +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. message CreateTableFromSnapshotMetadata { // The request that prompted the initiation of this CreateTableFromSnapshot // operation. diff --git a/protos/google/bigtable/admin/v2/common.proto b/protos/google/bigtable/admin/v2/common.proto index efeda12e5..ad4d73599 100644 --- a/protos/google/bigtable/admin/v2/common.proto +++ b/protos/google/bigtable/admin/v2/common.proto @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. +// Copyright 2018 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// syntax = "proto3"; @@ -26,7 +27,6 @@ option java_outer_classname = "CommonProto"; option java_package = "com.google.bigtable.admin.v2"; option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; - // Storage media types for persisting Bigtable data. enum StorageType { // The user did not specify a storage type. diff --git a/protos/google/bigtable/admin/v2/instance.proto b/protos/google/bigtable/admin/v2/instance.proto index 76f69d55c..ef8599bfe 100644 --- a/protos/google/bigtable/admin/v2/instance.proto +++ b/protos/google/bigtable/admin/v2/instance.proto @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. +// Copyright 2018 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// syntax = "proto3"; @@ -26,7 +27,6 @@ option java_outer_classname = "InstanceProto"; option java_package = "com.google.bigtable.admin.v2"; option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; - // A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and // the resources that serve them. // All tables in an instance are served from a single @@ -153,11 +153,6 @@ message Cluster { StorageType default_storage_type = 5; } -// This is a private alpha release of Cloud Bigtable replication. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // A configuration object describing how Cloud Bigtable should treat traffic // from a particular end user application. message AppProfile { @@ -165,9 +160,7 @@ message AppProfile { // fail over to another cluster in the event of transient errors or delays. // Choosing this option sacrifices read-your-writes consistency to improve // availability. - message MultiClusterRoutingUseAny { - - } + message MultiClusterRoutingUseAny {} // Unconditionally routes all read/write requests to a specific cluster. // This option preserves read-your-writes consistency, but does not improve diff --git a/protos/google/bigtable/admin/v2/table.proto b/protos/google/bigtable/admin/v2/table.proto index e7a6aa85c..5019d8b86 100644 --- a/protos/google/bigtable/admin/v2/table.proto +++ b/protos/google/bigtable/admin/v2/table.proto @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. +// Copyright 2018 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// syntax = "proto3"; @@ -27,15 +28,9 @@ option java_outer_classname = "TableProto"; option java_package = "com.google.bigtable.admin.v2"; option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; - // A collection of user data indexed by row, column, and timestamp. // Each table is served using the resources of its parent cluster. message Table { - // This is a private alpha release of Cloud Bigtable replication. This feature - // is not currently available to most Cloud Bigtable customers. This feature - // might be changed in backward-incompatible ways and is not recommended for - // production use. It is not subject to any SLA or deprecation policy. - // // The state of a table's data in a particular cluster. message ClusterState { // Table replication states. @@ -45,24 +40,20 @@ message Table { // The cluster was recently created, and the table must finish copying // over pre-existing data from other clusters before it can begin - // receiving live replication updates and serving - // [Data API][google.bigtable.v2.Bigtable] requests. + // receiving live replication updates and serving Data API requests. INITIALIZING = 1; - // The table is temporarily unable to serve - // [Data API][google.bigtable.v2.Bigtable] requests from this + // The table is temporarily unable to serve Data API requests from this // cluster due to planned internal maintenance. PLANNED_MAINTENANCE = 2; - // The table is temporarily unable to serve - // [Data API][google.bigtable.v2.Bigtable] requests from this + // The table is temporarily unable to serve Data API requests from this // cluster due to unplanned or emergency maintenance. UNPLANNED_MAINTENANCE = 3; - // The table can serve - // [Data API][google.bigtable.v2.Bigtable] requests from this - // cluster. Depending on replication delay, reads may not immediately - // reflect the state of the table in other clusters. + // The table can serve Data API requests from this cluster. Depending on + // replication delay, reads may not immediately reflect the state of the + // table in other clusters. READY = 4; } @@ -93,12 +84,6 @@ message Table { // Only populates `name` and fields related to the table's schema. SCHEMA_VIEW = 2; - // This is a private alpha release of Cloud Bigtable replication. This - // feature is not currently available to most Cloud Bigtable customers. This - // feature might be changed in backward-incompatible ways and is not - // recommended for production use. It is not subject to any SLA or - // deprecation policy. - // // Only populates `name` and fields related to the table's // replication state. REPLICATION_VIEW = 3; @@ -110,20 +95,15 @@ message Table { // (`OutputOnly`) // The unique name of the table. Values are of the form // `projects//instances//tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. - // Views: `NAME_ONLY`, `SCHEMA_VIEW`, `FULL` + // Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL` string name = 1; - // This is a private alpha release of Cloud Bigtable replication. This feature - // is not currently available to most Cloud Bigtable customers. This feature - // might be changed in backward-incompatible ways and is not recommended for - // production use. It is not subject to any SLA or deprecation policy. - // // (`OutputOnly`) // Map from cluster ID to per-cluster table state. // If it could not be determined whether or not the table has data in a // particular cluster (for example, if its zone is unavailable), then // there will be an entry for the cluster with UNKNOWN `replication_status`. - // Views: `FULL` + // Views: `REPLICATION_VIEW`, `FULL` map cluster_states = 2; // (`CreationOnly`) @@ -132,7 +112,7 @@ message Table { map column_families = 3; // (`CreationOnly`) - // The granularity (e.g. `MILLIS`, `MICROS`) at which timestamps are stored in + // 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` @@ -182,13 +162,13 @@ message GcRule { } } -// This is a private alpha release of Cloud Bigtable snapshots. This feature -// is not currently available to most Cloud Bigtable customers. This feature -// might be changed in backward-incompatible ways and is not recommended for -// production use. It is not subject to any SLA or deprecation policy. -// // A snapshot of a table at a particular time. A snapshot can be used as a // checkpoint for data restoration or a data source for a new table. +// +// Note: This is a private alpha release of Cloud Bigtable snapshots. This +// feature is not currently available to most Cloud Bigtable customers. This +// feature might be changed in backward-incompatible ways and is not recommended +// for production use. It is not subject to any SLA or deprecation policy. message Snapshot { // Possible states of a snapshot. enum State { diff --git a/src/index.ts b/src/index.ts index da8375d49..8fab55cf7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -35,6 +35,12 @@ /** * @namespace google.protobuf */ +/** + * @namespace google.type + */ +/** + * @namespace google.longrunning + */ import {Service} from '@google-cloud/common-grpc'; import {replaceProjectIdToken} from '@google-cloud/projectify'; diff --git a/src/v2/bigtable_instance_admin_client.js b/src/v2/bigtable_instance_admin_client.js index 055f8cbb8..4403ea276 100644 --- a/src/v2/bigtable_instance_admin_client.js +++ b/src/v2/bigtable_instance_admin_client.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,9 +14,8 @@ 'use strict'; -const gapicConfig = require('./bigtable_instance_admin_client_config'); +const gapicConfig = require('./bigtable_instance_admin_client_config.json'); const gax = require('google-gax'); -const merge = require('lodash.merge'); const path = require('path'); const protobuf = require('protobufjs'); @@ -59,14 +58,18 @@ class BigtableInstanceAdminClient { * API remote host. */ constructor(opts) { + opts = opts || {}; this._descriptors = {}; + const servicePath = + opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; + // Ensure that options include the service address and port. opts = Object.assign( { clientConfig: {}, port: this.constructor.port, - servicePath: this.constructor.servicePath, + servicePath, }, opts ); @@ -81,7 +84,7 @@ class BigtableInstanceAdminClient { // Determine the client header string. const clientHeader = [ - `gl-node/${process.version.node}`, + `gl-node/${process.version}`, `grpc/${gaxGrpc.grpcVersion}`, `gax/${gax.version}`, `gapic/${VERSION}`, @@ -91,31 +94,28 @@ class BigtableInstanceAdminClient { } // Load the applicable protos. - const protos = merge( - {}, - gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - 'google/bigtable/admin/v2/bigtable_instance_admin.proto' - ) + const protos = gaxGrpc.loadProto( + path.join(__dirname, '..', '..', 'protos'), + ['google/bigtable/admin/v2/bigtable_instance_admin.proto'] ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - projectPathTemplate: new gax.PathTemplate('projects/{project}'), - instancePathTemplate: new gax.PathTemplate( - 'projects/{project}/instances/{instance}' - ), appProfilePathTemplate: new gax.PathTemplate( 'projects/{project}/instances/{instance}/appProfiles/{app_profile}' ), clusterPathTemplate: new gax.PathTemplate( 'projects/{project}/instances/{instance}/clusters/{cluster}' ), + instancePathTemplate: new gax.PathTemplate( + 'projects/{project}/instances/{instance}' + ), locationPathTemplate: new gax.PathTemplate( 'projects/{project}/locations/{location}' ), + projectPathTemplate: new gax.PathTemplate('projects/{project}'), }; // Some of the methods on this service return "paged" results, @@ -259,6 +259,10 @@ class BigtableInstanceAdminClient { function() { const args = Array.prototype.slice.call(arguments, 0); return stub[methodName].apply(stub, args); + }, + err => + function() { + throw err; } ), defaults[methodName], @@ -275,6 +279,14 @@ class BigtableInstanceAdminClient { return 'bigtableadmin.googleapis.com'; } + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'bigtableadmin.googleapis.com'; + } + /** * The port for this API service. */ @@ -335,31 +347,31 @@ class BigtableInstanceAdminClient { * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * The promise has a method named "cancel" which cancels the ongoing API call. * * @example * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedParent = client.projectPath('[PROJECT]'); - * var instanceId = ''; - * var instance = {}; - * var clusters = {}; - * var request = { + * const formattedParent = client.projectPath('[PROJECT]'); + * const instanceId = ''; + * const instance = {}; + * const clusters = {}; + * const request = { * parent: formattedParent, * instanceId: instanceId, * instance: instance, @@ -369,31 +381,25 @@ class BigtableInstanceAdminClient { * // Handle the operation using the promise pattern. * client.createInstance(request) * .then(responses => { - * var operation = responses[0]; - * var initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Operation#promise starts polling for the completion of the LRO. * return operation.promise(); * }) * .then(responses => { - * // The final result of the operation. - * var result = responses[0]; - * - * // The metadata value of the completed operation. - * var metadata = responses[1]; - * - * // The response of the api call returning the complete operation. - * var finalApiResponse = responses[2]; + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; * }) * .catch(err => { * console.error(err); * }); * - * var formattedParent = client.projectPath('[PROJECT]'); - * var instanceId = ''; - * var instance = {}; - * var clusters = {}; - * var request = { + * const formattedParent = client.projectPath('[PROJECT]'); + * const instanceId = ''; + * const instance = {}; + * const clusters = {}; + * const request = { * parent: formattedParent, * instanceId: instanceId, * instance: instance, @@ -403,8 +409,7 @@ class BigtableInstanceAdminClient { * // Handle the operation using the event emitter pattern. * client.createInstance(request) * .then(responses => { - * var operation = responses[0]; - * var initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Adding a listener for the "complete" event starts polling for the * // completion of the operation. @@ -426,6 +431,22 @@ class BigtableInstanceAdminClient { * .catch(err => { * console.error(err); * }); + * + * const formattedParent = client.projectPath('[PROJECT]'); + * const instanceId = ''; + * const instance = {}; + * const clusters = {}; + * const request = { + * parent: formattedParent, + * instanceId: instanceId, + * instance: instance, + * clusters: clusters, + * }; + * + * // Handle the operation using the await pattern. + * const [operation] = await client.createInstance(request); + * + * const [response] = await operation.promise(); */ createInstance(request, options, callback) { if (options instanceof Function && callback === undefined) { @@ -454,7 +475,7 @@ class BigtableInstanceAdminClient { * `projects//instances/`. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -467,14 +488,14 @@ class BigtableInstanceAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); * client.getInstance({name: formattedName}) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { @@ -507,10 +528,10 @@ class BigtableInstanceAdminClient { * The unique name of the project for which a list of instances is requested. * Values are of the form `projects/`. * @param {string} [request.pageToken] - * The value of `next_page_token` returned by a previous call. + * DEPRECATED: This field is unused and ignored. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -523,14 +544,14 @@ class BigtableInstanceAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedParent = client.projectPath('[PROJECT]'); + * const formattedParent = client.projectPath('[PROJECT]'); * client.listInstances({parent: formattedParent}) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { @@ -590,7 +611,7 @@ class BigtableInstanceAdminClient { * The number should be among the values of [State]{@link google.bigtable.admin.v2.State} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -603,15 +624,15 @@ class BigtableInstanceAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); - * var displayName = ''; - * var type = 'TYPE_UNSPECIFIED'; - * var labels = {}; - * var request = { + * const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const displayName = ''; + * const type = 'TYPE_UNSPECIFIED'; + * const labels = {}; + * const request = { * name: formattedName, * displayName: displayName, * type: type, @@ -619,7 +640,7 @@ class BigtableInstanceAdminClient { * }; * client.updateInstance(request) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { @@ -659,26 +680,26 @@ class BigtableInstanceAdminClient { * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * The promise has a method named "cancel" which cancels the ongoing API call. * * @example * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var instance = {}; - * var updateMask = {}; - * var request = { + * const instance = {}; + * const updateMask = {}; + * const request = { * instance: instance, * updateMask: updateMask, * }; @@ -686,29 +707,23 @@ class BigtableInstanceAdminClient { * // Handle the operation using the promise pattern. * client.partialUpdateInstance(request) * .then(responses => { - * var operation = responses[0]; - * var initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Operation#promise starts polling for the completion of the LRO. * return operation.promise(); * }) * .then(responses => { - * // The final result of the operation. - * var result = responses[0]; - * - * // The metadata value of the completed operation. - * var metadata = responses[1]; - * - * // The response of the api call returning the complete operation. - * var finalApiResponse = responses[2]; + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; * }) * .catch(err => { * console.error(err); * }); * - * var instance = {}; - * var updateMask = {}; - * var request = { + * const instance = {}; + * const updateMask = {}; + * const request = { * instance: instance, * updateMask: updateMask, * }; @@ -716,8 +731,7 @@ class BigtableInstanceAdminClient { * // Handle the operation using the event emitter pattern. * client.partialUpdateInstance(request) * .then(responses => { - * var operation = responses[0]; - * var initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Adding a listener for the "complete" event starts polling for the * // completion of the operation. @@ -739,6 +753,18 @@ class BigtableInstanceAdminClient { * .catch(err => { * console.error(err); * }); + * + * const instance = {}; + * const updateMask = {}; + * const request = { + * instance: instance, + * updateMask: updateMask, + * }; + * + * // Handle the operation using the await pattern. + * const [operation] = await client.partialUpdateInstance(request); + * + * const [response] = await operation.promise(); */ partialUpdateInstance(request, options, callback) { if (options instanceof Function && callback === undefined) { @@ -771,7 +797,7 @@ class BigtableInstanceAdminClient { * Values are of the form `projects//instances/`. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error)} [callback] * The function which will be called with the result of the API call. * @returns {Promise} - The promise which resolves when API call finishes. @@ -781,11 +807,11 @@ class BigtableInstanceAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); * client.deleteInstance({name: formattedName}).catch(err => { * console.error(err); * }); @@ -827,27 +853,27 @@ class BigtableInstanceAdminClient { * This object should have the same structure as [Cluster]{@link google.bigtable.admin.v2.Cluster} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * The promise has a method named "cancel" which cancels the ongoing API call. * * @example * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * var clusterId = ''; - * var cluster = {}; - * var request = { + * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const clusterId = ''; + * const cluster = {}; + * const request = { * parent: formattedParent, * clusterId: clusterId, * cluster: cluster, @@ -856,30 +882,24 @@ class BigtableInstanceAdminClient { * // Handle the operation using the promise pattern. * client.createCluster(request) * .then(responses => { - * var operation = responses[0]; - * var initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Operation#promise starts polling for the completion of the LRO. * return operation.promise(); * }) * .then(responses => { - * // The final result of the operation. - * var result = responses[0]; - * - * // The metadata value of the completed operation. - * var metadata = responses[1]; - * - * // The response of the api call returning the complete operation. - * var finalApiResponse = responses[2]; + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; * }) * .catch(err => { * console.error(err); * }); * - * var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * var clusterId = ''; - * var cluster = {}; - * var request = { + * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const clusterId = ''; + * const cluster = {}; + * const request = { * parent: formattedParent, * clusterId: clusterId, * cluster: cluster, @@ -888,8 +908,7 @@ class BigtableInstanceAdminClient { * // Handle the operation using the event emitter pattern. * client.createCluster(request) * .then(responses => { - * var operation = responses[0]; - * var initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Adding a listener for the "complete" event starts polling for the * // completion of the operation. @@ -911,6 +930,20 @@ class BigtableInstanceAdminClient { * .catch(err => { * console.error(err); * }); + * + * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const clusterId = ''; + * const cluster = {}; + * const request = { + * parent: formattedParent, + * clusterId: clusterId, + * cluster: cluster, + * }; + * + * // Handle the operation using the await pattern. + * const [operation] = await client.createCluster(request); + * + * const [response] = await operation.promise(); */ createCluster(request, options, callback) { if (options instanceof Function && callback === undefined) { @@ -939,7 +972,7 @@ class BigtableInstanceAdminClient { * `projects//instances//clusters/`. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -952,14 +985,14 @@ class BigtableInstanceAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + * const formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); * client.getCluster({name: formattedName}) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { @@ -994,10 +1027,10 @@ class BigtableInstanceAdminClient { * Use ` = '-'` to list Clusters for all Instances in a project, * e.g., `projects/myproject/instances/-`. * @param {string} [request.pageToken] - * The value of `next_page_token` returned by a previous call. + * DEPRECATED: This field is unused and ignored. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1010,14 +1043,14 @@ class BigtableInstanceAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); * client.listClusters({parent: formattedParent}) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { @@ -1050,15 +1083,15 @@ class BigtableInstanceAdminClient { * (`OutputOnly`) * The unique name of the cluster. Values are of the form * `projects//instances//clusters/[a-z][-a-z0-9]*`. - * @param {string} request.location + * @param {number} request.serveNodes + * The number of nodes allocated to this cluster. More nodes enable higher + * throughput and more consistent performance. + * @param {string} [request.location] * (`CreationOnly`) * 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//locations/`. - * @param {number} request.serveNodes - * The number of nodes allocated to this cluster. More nodes enable higher - * throughput and more consistent performance. * @param {number} [request.state] * (`OutputOnly`) * The current state of the cluster. @@ -1072,69 +1105,58 @@ class BigtableInstanceAdminClient { * The number should be among the values of [StorageType]{@link google.bigtable.admin.v2.StorageType} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * The promise has a method named "cancel" which cancels the ongoing API call. * * @example * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * var location = ''; - * var serveNodes = 0; - * var request = { + * const formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + * const serveNodes = 0; + * const request = { * name: formattedName, - * location: location, * serveNodes: serveNodes, * }; * * // Handle the operation using the promise pattern. * client.updateCluster(request) * .then(responses => { - * var operation = responses[0]; - * var initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Operation#promise starts polling for the completion of the LRO. * return operation.promise(); * }) * .then(responses => { - * // The final result of the operation. - * var result = responses[0]; - * - * // The metadata value of the completed operation. - * var metadata = responses[1]; - * - * // The response of the api call returning the complete operation. - * var finalApiResponse = responses[2]; + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; * }) * .catch(err => { * console.error(err); * }); * - * var formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - * var location = ''; - * var serveNodes = 0; - * var request = { + * const formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + * const serveNodes = 0; + * const request = { * name: formattedName, - * location: location, * serveNodes: serveNodes, * }; * * // Handle the operation using the event emitter pattern. * client.updateCluster(request) * .then(responses => { - * var operation = responses[0]; - * var initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Adding a listener for the "complete" event starts polling for the * // completion of the operation. @@ -1156,6 +1178,18 @@ class BigtableInstanceAdminClient { * .catch(err => { * console.error(err); * }); + * + * const formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + * const serveNodes = 0; + * const request = { + * name: formattedName, + * serveNodes: serveNodes, + * }; + * + * // Handle the operation using the await pattern. + * const [operation] = await client.updateCluster(request); + * + * const [response] = await operation.promise(); */ updateCluster(request, options, callback) { if (options instanceof Function && callback === undefined) { @@ -1184,7 +1218,7 @@ class BigtableInstanceAdminClient { * `projects//instances//clusters/`. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error)} [callback] * The function which will be called with the result of the API call. * @returns {Promise} - The promise which resolves when API call finishes. @@ -1194,11 +1228,11 @@ class BigtableInstanceAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + * const formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); * client.deleteCluster({name: formattedName}).catch(err => { * console.error(err); * }); @@ -1221,11 +1255,6 @@ class BigtableInstanceAdminClient { } /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Creates an app profile within an instance. * * @param {Object} request @@ -1247,7 +1276,7 @@ class BigtableInstanceAdminClient { * If true, ignore safety checks when creating the app profile. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1260,21 +1289,21 @@ class BigtableInstanceAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * var appProfileId = ''; - * var appProfile = {}; - * var request = { + * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const appProfileId = ''; + * const appProfile = {}; + * const request = { * parent: formattedParent, * appProfileId: appProfileId, * appProfile: appProfile, * }; * client.createAppProfile(request) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { @@ -1299,11 +1328,6 @@ class BigtableInstanceAdminClient { } /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Gets information about an app profile. * * @param {Object} request @@ -1313,7 +1337,7 @@ class BigtableInstanceAdminClient { * `projects//instances//appProfiles/`. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1326,14 +1350,14 @@ class BigtableInstanceAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.appProfilePath('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); + * const formattedName = client.appProfilePath('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); * client.getAppProfile({name: formattedName}) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { @@ -1358,11 +1382,6 @@ class BigtableInstanceAdminClient { } /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Lists information about app profiles in an instance. * * @param {Object} request @@ -1371,9 +1390,14 @@ class BigtableInstanceAdminClient { * The unique name of the instance for which a list of app profiles is * requested. Values are of the form * `projects//instances/`. + * Use ` = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. + * @param {number} [request.pageSize] + * Maximum number of results per page. + * CURRENTLY UNIMPLEMENTED AND IGNORED. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1398,18 +1422,18 @@ class BigtableInstanceAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * * // Iterate over all elements. - * var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); * * client.listAppProfiles({parent: formattedParent}) * .then(responses => { - * var resources = responses[0]; - * for (let i = 0; i < resources.length; i += 1) { - * // doThingsWith(resources[i]) + * const resources = responses[0]; + * for (const resource of resources) { + * // doThingsWith(resource) * } * }) * .catch(err => { @@ -1417,19 +1441,19 @@ class BigtableInstanceAdminClient { * }); * * // Or obtain the paged response. - * var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); * * - * var options = {autoPaginate: false}; - * var callback = responses => { + * const options = {autoPaginate: false}; + * const callback = responses => { * // The actual resources in a response. - * var resources = responses[0]; + * const resources = responses[0]; * // The next request if the response shows that there are more responses. - * var nextRequest = responses[1]; + * const nextRequest = responses[1]; * // The actual response object, if necessary. - * // var rawResponse = responses[2]; - * for (let i = 0; i < resources.length; i += 1) { - * // doThingsWith(resources[i]); + * // const rawResponse = responses[2]; + * for (const resource of resources) { + * // doThingsWith(resource); * } * if (nextRequest) { * // Fetch the next page. @@ -1478,9 +1502,14 @@ class BigtableInstanceAdminClient { * The unique name of the instance for which a list of app profiles is * requested. Values are of the form * `projects//instances/`. + * Use ` = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. + * @param {number} [request.pageSize] + * Maximum number of results per page. + * CURRENTLY UNIMPLEMENTED AND IGNORED. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @returns {Stream} * An object stream which emits an object representing [AppProfile]{@link google.bigtable.admin.v2.AppProfile} on 'data' event. * @@ -1488,11 +1517,11 @@ class BigtableInstanceAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); * client.listAppProfilesStream({parent: formattedParent}) * .on('data', element => { * // doThingsWith(element) @@ -1511,11 +1540,6 @@ class BigtableInstanceAdminClient { } /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Updates an app profile within an instance. * * @param {Object} request @@ -1533,26 +1557,26 @@ class BigtableInstanceAdminClient { * If true, ignore safety checks when updating the app profile. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * The promise has a method named "cancel" which cancels the ongoing API call. * * @example * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var appProfile = {}; - * var updateMask = {}; - * var request = { + * const appProfile = {}; + * const updateMask = {}; + * const request = { * appProfile: appProfile, * updateMask: updateMask, * }; @@ -1560,29 +1584,23 @@ class BigtableInstanceAdminClient { * // Handle the operation using the promise pattern. * client.updateAppProfile(request) * .then(responses => { - * var operation = responses[0]; - * var initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Operation#promise starts polling for the completion of the LRO. * return operation.promise(); * }) * .then(responses => { - * // The final result of the operation. - * var result = responses[0]; - * - * // The metadata value of the completed operation. - * var metadata = responses[1]; - * - * // The response of the api call returning the complete operation. - * var finalApiResponse = responses[2]; + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; * }) * .catch(err => { * console.error(err); * }); * - * var appProfile = {}; - * var updateMask = {}; - * var request = { + * const appProfile = {}; + * const updateMask = {}; + * const request = { * appProfile: appProfile, * updateMask: updateMask, * }; @@ -1590,8 +1608,7 @@ class BigtableInstanceAdminClient { * // Handle the operation using the event emitter pattern. * client.updateAppProfile(request) * .then(responses => { - * var operation = responses[0]; - * var initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Adding a listener for the "complete" event starts polling for the * // completion of the operation. @@ -1613,6 +1630,18 @@ class BigtableInstanceAdminClient { * .catch(err => { * console.error(err); * }); + * + * const appProfile = {}; + * const updateMask = {}; + * const request = { + * appProfile: appProfile, + * updateMask: updateMask, + * }; + * + * // Handle the operation using the await pattern. + * const [operation] = await client.updateAppProfile(request); + * + * const [response] = await operation.promise(); */ updateAppProfile(request, options, callback) { if (options instanceof Function && callback === undefined) { @@ -1632,11 +1661,6 @@ class BigtableInstanceAdminClient { } /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Deletes an app profile from an instance. * * @param {Object} request @@ -1648,7 +1672,7 @@ class BigtableInstanceAdminClient { * If true, ignore safety checks when deleting the app profile. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error)} [callback] * The function which will be called with the result of the API call. * @returns {Promise} - The promise which resolves when API call finishes. @@ -1658,13 +1682,13 @@ class BigtableInstanceAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.appProfilePath('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); - * var ignoreWarnings = false; - * var request = { + * const formattedName = client.appProfilePath('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); + * const ignoreWarnings = false; + * const request = { * name: formattedName, * ignoreWarnings: ignoreWarnings, * }; @@ -1690,12 +1714,6 @@ class BigtableInstanceAdminClient { } /** - * This is a private alpha release of Cloud Bigtable instance level - * permissions. This feature is not currently available to most Cloud Bigtable - * customers. This feature might be changed in backward-incompatible ways and - * is not recommended for production use. It is not subject to any SLA or - * deprecation policy. - * * Gets the access control policy for an instance resource. Returns an empty * policy if an instance exists but does not have a policy set. * @@ -1703,11 +1721,10 @@ class BigtableInstanceAdminClient { * The request object that will be sent. * @param {string} request.resource * REQUIRED: The resource for which the policy is being requested. - * `resource` is usually specified as a path. For example, a Project - * resource is specified as `projects/{project}`. + * See the operation documentation for the appropriate value for this field. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1720,14 +1737,14 @@ class BigtableInstanceAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); * client.getIamPolicy({resource: formattedResource}) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { @@ -1752,12 +1769,6 @@ class BigtableInstanceAdminClient { } /** - * This is a private alpha release of Cloud Bigtable instance level - * permissions. This feature is not currently available to most Cloud Bigtable - * customers. This feature might be changed in backward-incompatible ways and - * is not recommended for production use. It is not subject to any SLA or - * deprecation policy. - * * Sets the access control policy on an instance resource. Replaces any * existing policy. * @@ -1765,8 +1776,7 @@ class BigtableInstanceAdminClient { * The request object that will be sent. * @param {string} request.resource * REQUIRED: The resource for which the policy is being specified. - * `resource` is usually specified as a path. For example, a Project - * resource is specified as `projects/{project}`. + * See the operation documentation for the appropriate value for this field. * @param {Object} request.policy * REQUIRED: The complete policy to be applied to the `resource`. The size of * the policy is limited to a few 10s of KB. An empty policy is a @@ -1776,7 +1786,7 @@ class BigtableInstanceAdminClient { * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1789,19 +1799,19 @@ class BigtableInstanceAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - * var policy = {}; - * var request = { + * const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const policy = {}; + * const request = { * resource: formattedResource, * policy: policy, * }; * client.setIamPolicy(request) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { @@ -1826,20 +1836,13 @@ class BigtableInstanceAdminClient { } /** - * This is a private alpha release of Cloud Bigtable instance level - * permissions. This feature is not currently available to most Cloud Bigtable - * customers. This feature might be changed in backward-incompatible ways and - * is not recommended for production use. It is not subject to any SLA or - * deprecation policy. - * * Returns permissions that the caller has on the specified instance resource. * * @param {Object} request * The request object that will be sent. * @param {string} request.resource * REQUIRED: The resource for which the policy detail is being requested. - * `resource` is usually specified as a path. For example, a Project - * resource is specified as `projects/{project}`. + * See the operation documentation for the appropriate value for this field. * @param {string[]} request.permissions * The set of permissions to check for the `resource`. Permissions with * wildcards (such as '*' or 'storage.*') are not allowed. For more @@ -1847,7 +1850,7 @@ class BigtableInstanceAdminClient { * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1860,19 +1863,19 @@ class BigtableInstanceAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableInstanceAdminClient({ + * const client = new admin.v2.BigtableInstanceAdminClient({ * // optional auth parameters. * }); * - * var formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); - * var permissions = []; - * var request = { + * const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const permissions = []; + * const request = { * resource: formattedResource, * permissions: permissions, * }; * client.testIamPermissions(request) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { @@ -1901,60 +1904,48 @@ class BigtableInstanceAdminClient { // -------------------- /** - * Return a fully-qualified project resource name string. - * - * @param {String} project - * @returns {String} - */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Return a fully-qualified instance resource name string. + * Return a fully-qualified app_profile resource name string. * * @param {String} project * @param {String} instance + * @param {String} appProfile * @returns {String} */ - instancePath(project, instance) { - return this._pathTemplates.instancePathTemplate.render({ + appProfilePath(project, instance, appProfile) { + return this._pathTemplates.appProfilePathTemplate.render({ project: project, instance: instance, + app_profile: appProfile, }); } /** - * Return a fully-qualified app_profile resource name string. + * Return a fully-qualified cluster resource name string. * * @param {String} project * @param {String} instance - * @param {String} appProfile + * @param {String} cluster * @returns {String} */ - appProfilePath(project, instance, appProfile) { - return this._pathTemplates.appProfilePathTemplate.render({ + clusterPath(project, instance, cluster) { + return this._pathTemplates.clusterPathTemplate.render({ project: project, instance: instance, - app_profile: appProfile, + cluster: cluster, }); } /** - * Return a fully-qualified cluster resource name string. + * Return a fully-qualified instance resource name string. * * @param {String} project * @param {String} instance - * @param {String} cluster * @returns {String} */ - clusterPath(project, instance, cluster) { - return this._pathTemplates.clusterPathTemplate.render({ + instancePath(project, instance) { + return this._pathTemplates.instancePathTemplate.render({ project: project, instance: instance, - cluster: cluster, }); } @@ -1973,37 +1964,15 @@ class BigtableInstanceAdminClient { } /** - * Parse the projectName from a project resource. - * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Parse the instanceName from a instance resource. - * - * @param {String} instanceName - * A fully-qualified path representing a instance resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromInstanceName(instanceName) { - return this._pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the instanceName from a instance resource. + * Return a fully-qualified project resource name string. * - * @param {String} instanceName - * A fully-qualified path representing a instance resources. - * @returns {String} - A string representing the instance. + * @param {String} project + * @returns {String} */ - matchInstanceFromInstanceName(instanceName) { - return this._pathTemplates.instancePathTemplate.match(instanceName) - .instance; + projectPath(project) { + return this._pathTemplates.projectPathTemplate.render({ + project: project, + }); } /** @@ -2075,6 +2044,29 @@ class BigtableInstanceAdminClient { return this._pathTemplates.clusterPathTemplate.match(clusterName).cluster; } + /** + * Parse the instanceName from a instance resource. + * + * @param {String} instanceName + * A fully-qualified path representing a instance resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromInstanceName(instanceName) { + return this._pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the instanceName from a instance resource. + * + * @param {String} instanceName + * A fully-qualified path representing a instance resources. + * @returns {String} - A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName) { + return this._pathTemplates.instancePathTemplate.match(instanceName) + .instance; + } + /** * Parse the locationName from a location resource. * @@ -2097,6 +2089,17 @@ class BigtableInstanceAdminClient { return this._pathTemplates.locationPathTemplate.match(locationName) .location; } + + /** + * Parse the projectName from a project resource. + * + * @param {String} projectName + * A fully-qualified path representing a project resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromProjectName(projectName) { + return this._pathTemplates.projectPathTemplate.match(projectName).project; + } } module.exports = BigtableInstanceAdminClient; diff --git a/src/v2/bigtable_instance_admin_client_config.json b/src/v2/bigtable_instance_admin_client_config.json index ce9bec119..0b7bb1a19 100644 --- a/src/v2/bigtable_instance_admin_client_config.json +++ b/src/v2/bigtable_instance_admin_client_config.json @@ -49,7 +49,7 @@ }, "DeleteInstance": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateCluster": { @@ -74,7 +74,7 @@ }, "DeleteCluster": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateAppProfile": { diff --git a/src/v2/bigtable_table_admin_client.js b/src/v2/bigtable_table_admin_client.js index 68161390f..321877519 100644 --- a/src/v2/bigtable_table_admin_client.js +++ b/src/v2/bigtable_table_admin_client.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,9 +14,8 @@ 'use strict'; -const gapicConfig = require('./bigtable_table_admin_client_config'); +const gapicConfig = require('./bigtable_table_admin_client_config.json'); const gax = require('google-gax'); -const merge = require('lodash.merge'); const path = require('path'); const protobuf = require('protobufjs'); @@ -61,14 +60,18 @@ class BigtableTableAdminClient { * API remote host. */ constructor(opts) { + opts = opts || {}; this._descriptors = {}; + const servicePath = + opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; + // Ensure that options include the service address and port. opts = Object.assign( { clientConfig: {}, port: this.constructor.port, - servicePath: this.constructor.servicePath, + servicePath, }, opts ); @@ -83,7 +86,7 @@ class BigtableTableAdminClient { // Determine the client header string. const clientHeader = [ - `gl-node/${process.version.node}`, + `gl-node/${process.version}`, `grpc/${gaxGrpc.grpcVersion}`, `gax/${gax.version}`, `gapic/${VERSION}`, @@ -93,24 +96,21 @@ class BigtableTableAdminClient { } // Load the applicable protos. - const protos = merge( - {}, - gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - 'google/bigtable/admin/v2/bigtable_table_admin.proto' - ) + const protos = gaxGrpc.loadProto( + path.join(__dirname, '..', '..', 'protos'), + ['google/bigtable/admin/v2/bigtable_table_admin.proto'] ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - instancePathTemplate: new gax.PathTemplate( - 'projects/{project}/instances/{instance}' - ), clusterPathTemplate: new gax.PathTemplate( 'projects/{project}/instances/{instance}/clusters/{cluster}' ), + instancePathTemplate: new gax.PathTemplate( + 'projects/{project}/instances/{instance}' + ), snapshotPathTemplate: new gax.PathTemplate( 'projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}' ), @@ -228,6 +228,10 @@ class BigtableTableAdminClient { function() { const args = Array.prototype.slice.call(arguments, 0); return stub[methodName].apply(stub, args); + }, + err => + function() { + throw err; } ), defaults[methodName], @@ -244,6 +248,14 @@ class BigtableTableAdminClient { return 'bigtableadmin.googleapis.com'; } + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'bigtableadmin.googleapis.com'; + } + /** * The port for this API service. */ @@ -320,7 +332,7 @@ class BigtableTableAdminClient { * This object should have the same structure as [Split]{@link google.bigtable.admin.v2.Split} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -333,21 +345,21 @@ class BigtableTableAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableTableAdminClient({ + * const client = new admin.v2.BigtableTableAdminClient({ * // optional auth parameters. * }); * - * var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * var tableId = ''; - * var table = {}; - * var request = { + * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const tableId = ''; + * const table = {}; + * const request = { * parent: formattedParent, * tableId: tableId, * table: table, * }; * client.createTable(request) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { @@ -372,14 +384,15 @@ class BigtableTableAdminClient { } /** - * This is a private alpha release of Cloud Bigtable snapshots. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Creates a new table from the specified snapshot. The target table must * not exist. The snapshot and the table must be in the same instance. * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not + * recommended for production use. It is not subject to any SLA or deprecation + * policy. + * * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -395,27 +408,27 @@ class BigtableTableAdminClient { * `projects//instances//clusters//snapshots/`. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * The promise has a method named "cancel" which cancels the ongoing API call. * * @example * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableTableAdminClient({ + * const client = new admin.v2.BigtableTableAdminClient({ * // optional auth parameters. * }); * - * var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * var tableId = ''; - * var sourceSnapshot = ''; - * var request = { + * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const tableId = ''; + * const sourceSnapshot = ''; + * const request = { * parent: formattedParent, * tableId: tableId, * sourceSnapshot: sourceSnapshot, @@ -424,30 +437,24 @@ class BigtableTableAdminClient { * // Handle the operation using the promise pattern. * client.createTableFromSnapshot(request) * .then(responses => { - * var operation = responses[0]; - * var initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Operation#promise starts polling for the completion of the LRO. * return operation.promise(); * }) * .then(responses => { - * // The final result of the operation. - * var result = responses[0]; - * - * // The metadata value of the completed operation. - * var metadata = responses[1]; - * - * // The response of the api call returning the complete operation. - * var finalApiResponse = responses[2]; + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; * }) * .catch(err => { * console.error(err); * }); * - * var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); - * var tableId = ''; - * var sourceSnapshot = ''; - * var request = { + * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const tableId = ''; + * const sourceSnapshot = ''; + * const request = { * parent: formattedParent, * tableId: tableId, * sourceSnapshot: sourceSnapshot, @@ -456,8 +463,7 @@ class BigtableTableAdminClient { * // Handle the operation using the event emitter pattern. * client.createTableFromSnapshot(request) * .then(responses => { - * var operation = responses[0]; - * var initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Adding a listener for the "complete" event starts polling for the * // completion of the operation. @@ -479,6 +485,20 @@ class BigtableTableAdminClient { * .catch(err => { * console.error(err); * }); + * + * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const tableId = ''; + * const sourceSnapshot = ''; + * const request = { + * parent: formattedParent, + * tableId: tableId, + * sourceSnapshot: sourceSnapshot, + * }; + * + * // Handle the operation using the await pattern. + * const [operation] = await client.createTableFromSnapshot(request); + * + * const [response] = await operation.promise(); */ createTableFromSnapshot(request, options, callback) { if (options instanceof Function && callback === undefined) { @@ -514,9 +534,12 @@ class BigtableTableAdminClient { * Defaults to `NAME_ONLY` if unspecified; no others are currently supported. * * The number should be among the values of [View]{@link google.bigtable.admin.v2.View} + * @param {number} [request.pageSize] + * Maximum number of results per page. + * CURRENTLY UNIMPLEMENTED AND IGNORED. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -541,18 +564,18 @@ class BigtableTableAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableTableAdminClient({ + * const client = new admin.v2.BigtableTableAdminClient({ * // optional auth parameters. * }); * * // Iterate over all elements. - * var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); * * client.listTables({parent: formattedParent}) * .then(responses => { - * var resources = responses[0]; - * for (let i = 0; i < resources.length; i += 1) { - * // doThingsWith(resources[i]) + * const resources = responses[0]; + * for (const resource of resources) { + * // doThingsWith(resource) * } * }) * .catch(err => { @@ -560,19 +583,19 @@ class BigtableTableAdminClient { * }); * * // Or obtain the paged response. - * var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); * * - * var options = {autoPaginate: false}; - * var callback = responses => { + * const options = {autoPaginate: false}; + * const callback = responses => { * // The actual resources in a response. - * var resources = responses[0]; + * const resources = responses[0]; * // The next request if the response shows that there are more responses. - * var nextRequest = responses[1]; + * const nextRequest = responses[1]; * // The actual response object, if necessary. - * // var rawResponse = responses[2]; - * for (let i = 0; i < resources.length; i += 1) { - * // doThingsWith(resources[i]); + * // const rawResponse = responses[2]; + * for (const resource of resources) { + * // doThingsWith(resource); * } * if (nextRequest) { * // Fetch the next page. @@ -625,9 +648,12 @@ class BigtableTableAdminClient { * Defaults to `NAME_ONLY` if unspecified; no others are currently supported. * * The number should be among the values of [View]{@link google.bigtable.admin.v2.View} + * @param {number} [request.pageSize] + * Maximum number of results per page. + * CURRENTLY UNIMPLEMENTED AND IGNORED. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @returns {Stream} * An object stream which emits an object representing [Table]{@link google.bigtable.admin.v2.Table} on 'data' event. * @@ -635,11 +661,11 @@ class BigtableTableAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableTableAdminClient({ + * const client = new admin.v2.BigtableTableAdminClient({ * // optional auth parameters. * }); * - * var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + * const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); * client.listTablesStream({parent: formattedParent}) * .on('data', element => { * // doThingsWith(element) @@ -673,7 +699,7 @@ class BigtableTableAdminClient { * The number should be among the values of [View]{@link google.bigtable.admin.v2.View} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -686,14 +712,14 @@ class BigtableTableAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableTableAdminClient({ + * const client = new admin.v2.BigtableTableAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); + * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); * client.getTable({name: formattedName}) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { @@ -728,7 +754,7 @@ class BigtableTableAdminClient { * `projects//instances//tables/`. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error)} [callback] * The function which will be called with the result of the API call. * @returns {Promise} - The promise which resolves when API call finishes. @@ -738,11 +764,11 @@ class BigtableTableAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableTableAdminClient({ + * const client = new admin.v2.BigtableTableAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); + * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); * client.deleteTable({name: formattedName}).catch(err => { * console.error(err); * }); @@ -785,7 +811,7 @@ class BigtableTableAdminClient { * This object should have the same structure as [Modification]{@link google.bigtable.admin.v2.Modification} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -798,19 +824,19 @@ class BigtableTableAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableTableAdminClient({ + * const client = new admin.v2.BigtableTableAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * var modifications = []; - * var request = { + * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); + * const modifications = []; + * const request = { * name: formattedName, * modifications: modifications, * }; * client.modifyColumnFamilies(request) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { @@ -845,14 +871,14 @@ class BigtableTableAdminClient { * The unique name of the table on which to drop a range of rows. * Values are of the form * `projects//instances//tables/
`. - * @param {string} [request.rowKeyPrefix] + * @param {Buffer} [request.rowKeyPrefix] * Delete all rows that start with this row key prefix. Prefix cannot be * zero length. * @param {boolean} [request.deleteAllDataFromTable] * Delete all rows in the table. Setting this to false is a no-op. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error)} [callback] * The function which will be called with the result of the API call. * @returns {Promise} - The promise which resolves when API call finishes. @@ -862,11 +888,11 @@ class BigtableTableAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableTableAdminClient({ + * const client = new admin.v2.BigtableTableAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); + * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); * client.dropRowRange({name: formattedName}).catch(err => { * console.error(err); * }); @@ -889,11 +915,6 @@ class BigtableTableAdminClient { } /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Generates a consistency token for a Table, which can be used in * CheckConsistency to check whether mutations to the table that finished * before this call started have been replicated. The tokens will be available @@ -907,7 +928,7 @@ class BigtableTableAdminClient { * `projects//instances//tables/
`. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -920,14 +941,14 @@ class BigtableTableAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableTableAdminClient({ + * const client = new admin.v2.BigtableTableAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); + * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); * client.generateConsistencyToken({name: formattedName}) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { @@ -956,11 +977,6 @@ class BigtableTableAdminClient { } /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Checks replication consistency based on a consistency token, that is, if * replication has caught up based on the conditions specified in the token * and the check request. @@ -975,7 +991,7 @@ class BigtableTableAdminClient { * The token created using GenerateConsistencyToken for the Table. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -988,19 +1004,19 @@ class BigtableTableAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableTableAdminClient({ + * const client = new admin.v2.BigtableTableAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * var consistencyToken = ''; - * var request = { + * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); + * const consistencyToken = ''; + * const request = { * name: formattedName, * consistencyToken: consistencyToken, * }; * client.checkConsistency(request) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { @@ -1025,14 +1041,15 @@ class BigtableTableAdminClient { } /** - * This is a private alpha release of Cloud Bigtable snapshots. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Creates a new snapshot in the specified cluster from the specified * source table. The cluster and the table must be in the same instance. * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not + * recommended for production use. It is not subject to any SLA or deprecation + * policy. + * * @param {Object} request * The request object that will be sent. * @param {string} request.name @@ -1059,28 +1076,28 @@ class BigtableTableAdminClient { * This object should have the same structure as [Duration]{@link google.protobuf.Duration} * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * - * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The second parameter to the callback is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/Operation} object. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. * The promise has a method named "cancel" which cancels the ongoing API call. * * @example * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableTableAdminClient({ + * const client = new admin.v2.BigtableTableAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * var cluster = ''; - * var snapshotId = ''; - * var description = ''; - * var request = { + * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); + * const cluster = ''; + * const snapshotId = ''; + * const description = ''; + * const request = { * name: formattedName, * cluster: cluster, * snapshotId: snapshotId, @@ -1090,31 +1107,25 @@ class BigtableTableAdminClient { * // Handle the operation using the promise pattern. * client.snapshotTable(request) * .then(responses => { - * var operation = responses[0]; - * var initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Operation#promise starts polling for the completion of the LRO. * return operation.promise(); * }) * .then(responses => { - * // The final result of the operation. - * var result = responses[0]; - * - * // The metadata value of the completed operation. - * var metadata = responses[1]; - * - * // The response of the api call returning the complete operation. - * var finalApiResponse = responses[2]; + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; * }) * .catch(err => { * console.error(err); * }); * - * var formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); - * var cluster = ''; - * var snapshotId = ''; - * var description = ''; - * var request = { + * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); + * const cluster = ''; + * const snapshotId = ''; + * const description = ''; + * const request = { * name: formattedName, * cluster: cluster, * snapshotId: snapshotId, @@ -1124,8 +1135,7 @@ class BigtableTableAdminClient { * // Handle the operation using the event emitter pattern. * client.snapshotTable(request) * .then(responses => { - * var operation = responses[0]; - * var initialApiResponse = responses[1]; + * const [operation, initialApiResponse] = responses; * * // Adding a listener for the "complete" event starts polling for the * // completion of the operation. @@ -1147,6 +1157,22 @@ class BigtableTableAdminClient { * .catch(err => { * console.error(err); * }); + * + * const formattedName = client.tablePath('[PROJECT]', '[INSTANCE]', '[TABLE]'); + * const cluster = ''; + * const snapshotId = ''; + * const description = ''; + * const request = { + * name: formattedName, + * cluster: cluster, + * snapshotId: snapshotId, + * description: description, + * }; + * + * // Handle the operation using the await pattern. + * const [operation] = await client.snapshotTable(request); + * + * const [response] = await operation.promise(); */ snapshotTable(request, options, callback) { if (options instanceof Function && callback === undefined) { @@ -1166,13 +1192,14 @@ class BigtableTableAdminClient { } /** - * This is a private alpha release of Cloud Bigtable snapshots. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Gets metadata information about the specified snapshot. * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not + * recommended for production use. It is not subject to any SLA or deprecation + * policy. + * * @param {Object} request * The request object that will be sent. * @param {string} request.name @@ -1181,7 +1208,7 @@ class BigtableTableAdminClient { * `projects//instances//clusters//snapshots/`. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1194,14 +1221,14 @@ class BigtableTableAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableTableAdminClient({ + * const client = new admin.v2.BigtableTableAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.snapshotPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); + * const formattedName = client.snapshotPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); * client.getSnapshot({name: formattedName}) * .then(responses => { - * var response = responses[0]; + * const response = responses[0]; * // doThingsWith(response) * }) * .catch(err => { @@ -1226,13 +1253,14 @@ class BigtableTableAdminClient { } /** - * This is a private alpha release of Cloud Bigtable snapshots. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Lists all snapshots associated with the specified cluster. * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not + * recommended for production use. It is not subject to any SLA or deprecation + * policy. + * * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1249,7 +1277,7 @@ class BigtableTableAdminClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] * The function which will be called with the result of the API call. * @@ -1274,18 +1302,18 @@ class BigtableTableAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableTableAdminClient({ + * const client = new admin.v2.BigtableTableAdminClient({ * // optional auth parameters. * }); * * // Iterate over all elements. - * var formattedParent = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + * const formattedParent = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); * * client.listSnapshots({parent: formattedParent}) * .then(responses => { - * var resources = responses[0]; - * for (let i = 0; i < resources.length; i += 1) { - * // doThingsWith(resources[i]) + * const resources = responses[0]; + * for (const resource of resources) { + * // doThingsWith(resource) * } * }) * .catch(err => { @@ -1293,19 +1321,19 @@ class BigtableTableAdminClient { * }); * * // Or obtain the paged response. - * var formattedParent = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + * const formattedParent = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); * * - * var options = {autoPaginate: false}; - * var callback = responses => { + * const options = {autoPaginate: false}; + * const callback = responses => { * // The actual resources in a response. - * var resources = responses[0]; + * const resources = responses[0]; * // The next request if the response shows that there are more responses. - * var nextRequest = responses[1]; + * const nextRequest = responses[1]; * // The actual response object, if necessary. - * // var rawResponse = responses[2]; - * for (let i = 0; i < resources.length; i += 1) { - * // doThingsWith(resources[i]); + * // const rawResponse = responses[2]; + * for (const resource of resources) { + * // doThingsWith(resource); * } * if (nextRequest) { * // Fetch the next page. @@ -1364,7 +1392,7 @@ class BigtableTableAdminClient { * resources in a page. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @returns {Stream} * An object stream which emits an object representing [Snapshot]{@link google.bigtable.admin.v2.Snapshot} on 'data' event. * @@ -1372,11 +1400,11 @@ class BigtableTableAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableTableAdminClient({ + * const client = new admin.v2.BigtableTableAdminClient({ * // optional auth parameters. * }); * - * var formattedParent = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); + * const formattedParent = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); * client.listSnapshotsStream({parent: formattedParent}) * .on('data', element => { * // doThingsWith(element) @@ -1395,13 +1423,14 @@ class BigtableTableAdminClient { } /** - * This is a private alpha release of Cloud Bigtable snapshots. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Permanently deletes the specified snapshot. * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not + * recommended for production use. It is not subject to any SLA or deprecation + * policy. + * * @param {Object} request * The request object that will be sent. * @param {string} request.name @@ -1410,7 +1439,7 @@ class BigtableTableAdminClient { * `projects//instances//clusters//snapshots/`. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. * @param {function(?Error)} [callback] * The function which will be called with the result of the API call. * @returns {Promise} - The promise which resolves when API call finishes. @@ -1420,11 +1449,11 @@ class BigtableTableAdminClient { * * const admin = require('admin.v2'); * - * var client = new admin.v2.BigtableTableAdminClient({ + * const client = new admin.v2.BigtableTableAdminClient({ * // optional auth parameters. * }); * - * var formattedName = client.snapshotPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); + * const formattedName = client.snapshotPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); * client.deleteSnapshot({name: formattedName}).catch(err => { * console.error(err); * }); @@ -1451,32 +1480,32 @@ class BigtableTableAdminClient { // -------------------- /** - * Return a fully-qualified instance resource name string. + * Return a fully-qualified cluster resource name string. * * @param {String} project * @param {String} instance + * @param {String} cluster * @returns {String} */ - instancePath(project, instance) { - return this._pathTemplates.instancePathTemplate.render({ + clusterPath(project, instance, cluster) { + return this._pathTemplates.clusterPathTemplate.render({ project: project, instance: instance, + cluster: cluster, }); } /** - * Return a fully-qualified cluster resource name string. + * Return a fully-qualified instance resource name string. * * @param {String} project * @param {String} instance - * @param {String} cluster * @returns {String} */ - clusterPath(project, instance, cluster) { - return this._pathTemplates.clusterPathTemplate.render({ + instancePath(project, instance) { + return this._pathTemplates.instancePathTemplate.render({ project: project, instance: instance, - cluster: cluster, }); } @@ -1514,29 +1543,6 @@ class BigtableTableAdminClient { }); } - /** - * Parse the instanceName from a instance resource. - * - * @param {String} instanceName - * A fully-qualified path representing a instance resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromInstanceName(instanceName) { - return this._pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the instanceName from a instance resource. - * - * @param {String} instanceName - * A fully-qualified path representing a instance resources. - * @returns {String} - A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName) { - return this._pathTemplates.instancePathTemplate.match(instanceName) - .instance; - } - /** * Parse the clusterName from a cluster resource. * @@ -1570,6 +1576,29 @@ class BigtableTableAdminClient { return this._pathTemplates.clusterPathTemplate.match(clusterName).cluster; } + /** + * Parse the instanceName from a instance resource. + * + * @param {String} instanceName + * A fully-qualified path representing a instance resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromInstanceName(instanceName) { + return this._pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the instanceName from a instance resource. + * + * @param {String} instanceName + * A fully-qualified path representing a instance resources. + * @returns {String} - A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName) { + return this._pathTemplates.instancePathTemplate.match(instanceName) + .instance; + } + /** * Parse the snapshotName from a snapshot resource. * diff --git a/src/v2/bigtable_table_admin_client_config.json b/src/v2/bigtable_table_admin_client_config.json index 755500f21..bfdf2d119 100644 --- a/src/v2/bigtable_table_admin_client_config.json +++ b/src/v2/bigtable_table_admin_client_config.json @@ -17,31 +17,13 @@ "rpc_timeout_multiplier": 1.0, "max_rpc_timeout_millis": 20000, "total_timeout_millis": 600000 - }, - "create_table": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 130000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 130000, - "total_timeout_millis": 3600000 - }, - "drop_row_range": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 900000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 900000, - "total_timeout_millis": 3600000 } }, "methods": { "CreateTable": { "timeout_millis": 130000, "retry_codes_name": "non_idempotent", - "retry_params_name": "create_table" + "retry_params_name": "default" }, "CreateTableFromSnapshot": { "timeout_millis": 60000, @@ -60,7 +42,7 @@ }, "DeleteTable": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "ModifyColumnFamilies": { @@ -71,7 +53,7 @@ "DropRowRange": { "timeout_millis": 900000, "retry_codes_name": "non_idempotent", - "retry_params_name": "drop_row_range" + "retry_params_name": "default" }, "GenerateConsistencyToken": { "timeout_millis": 60000, diff --git a/src/v2/doc/google/bigtable/admin/v2/doc_bigtable_instance_admin.js b/src/v2/doc/google/bigtable/admin/v2/doc_bigtable_instance_admin.js index 5508d5d7d..731a0fe7e 100644 --- a/src/v2/doc/google/bigtable/admin/v2/doc_bigtable_instance_admin.js +++ b/src/v2/doc/google/bigtable/admin/v2/doc_bigtable_instance_admin.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -38,13 +38,13 @@ * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * @typedef CreateInstanceRequest * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.CreateInstanceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var CreateInstanceRequest = { +const CreateInstanceRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -59,7 +59,7 @@ var CreateInstanceRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.GetInstanceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var GetInstanceRequest = { +const GetInstanceRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -71,13 +71,13 @@ var GetInstanceRequest = { * Values are of the form `projects/`. * * @property {string} pageToken - * The value of `next_page_token` returned by a previous call. + * DEPRECATED: This field is unused and ignored. * * @typedef ListInstancesRequest * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.ListInstancesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var ListInstancesRequest = { +const ListInstancesRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -95,17 +95,16 @@ var ListInstancesRequest = { * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects//locations/` * * @property {string} nextPageToken - * Set if not all instances could be returned in a single response. - * Pass this value to `page_token` in another request to get the next - * page of results. + * DEPRECATED: This field is unused and ignored. * * @typedef ListInstancesResponse * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.ListInstancesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var ListInstancesResponse = { +const ListInstancesResponse = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -127,7 +126,7 @@ var ListInstancesResponse = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.PartialUpdateInstanceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var PartialUpdateInstanceRequest = { +const PartialUpdateInstanceRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -142,7 +141,7 @@ var PartialUpdateInstanceRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.DeleteInstanceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var DeleteInstanceRequest = { +const DeleteInstanceRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -169,7 +168,7 @@ var DeleteInstanceRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.CreateClusterRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var CreateClusterRequest = { +const CreateClusterRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -184,7 +183,7 @@ var CreateClusterRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.GetClusterRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var GetClusterRequest = { +const GetClusterRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -198,13 +197,13 @@ var GetClusterRequest = { * e.g., `projects/myproject/instances/-`. * * @property {string} pageToken - * The value of `next_page_token` returned by a previous call. + * DEPRECATED: This field is unused and ignored. * * @typedef ListClustersRequest * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.ListClustersRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var ListClustersRequest = { +const ListClustersRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -221,17 +220,16 @@ var ListClustersRequest = { * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects//locations/` * * @property {string} nextPageToken - * Set if not all clusters could be returned in a single response. - * Pass this value to `page_token` in another request to get the next - * page of results. + * DEPRECATED: This field is unused and ignored. * * @typedef ListClustersResponse * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.ListClustersResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var ListClustersResponse = { +const ListClustersResponse = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -246,7 +244,7 @@ var ListClustersResponse = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.DeleteClusterRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var DeleteClusterRequest = { +const DeleteClusterRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -272,7 +270,7 @@ var DeleteClusterRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.CreateInstanceMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var CreateInstanceMetadata = { +const CreateInstanceMetadata = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -298,7 +296,7 @@ var CreateInstanceMetadata = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.UpdateInstanceMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var UpdateInstanceMetadata = { +const UpdateInstanceMetadata = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -324,7 +322,7 @@ var UpdateInstanceMetadata = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.CreateClusterMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var CreateClusterMetadata = { +const CreateClusterMetadata = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -350,16 +348,11 @@ var CreateClusterMetadata = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.UpdateClusterMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var UpdateClusterMetadata = { +const UpdateClusterMetadata = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Request message for BigtableInstanceAdmin.CreateAppProfile. * * @property {string} parent @@ -385,16 +378,11 @@ var UpdateClusterMetadata = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.CreateAppProfileRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var CreateAppProfileRequest = { +const CreateAppProfileRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Request message for BigtableInstanceAdmin.GetAppProfile. * * @property {string} name @@ -405,22 +393,23 @@ var CreateAppProfileRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.GetAppProfileRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var GetAppProfileRequest = { +const GetAppProfileRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Request message for BigtableInstanceAdmin.ListAppProfiles. * * @property {string} parent * The unique name of the instance for which a list of app profiles is * requested. Values are of the form * `projects//instances/`. + * Use ` = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. + * + * @property {number} pageSize + * Maximum number of results per page. + * CURRENTLY UNIMPLEMENTED AND IGNORED. * * @property {string} pageToken * The value of `next_page_token` returned by a previous call. @@ -429,16 +418,11 @@ var GetAppProfileRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.ListAppProfilesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var ListAppProfilesRequest = { +const ListAppProfilesRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Response message for BigtableInstanceAdmin.ListAppProfiles. * * @property {Object[]} appProfiles @@ -451,20 +435,21 @@ var ListAppProfilesRequest = { * Pass this value to `page_token` in another request to get the next * page of results. * + * @property {string[]} failedLocations + * Locations from which AppProfile information could not be retrieved, + * due to an outage or some other transient condition. + * AppProfiles from these locations may be missing from `app_profiles`. + * Values are of the form `projects//locations/` + * * @typedef ListAppProfilesResponse * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.ListAppProfilesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var ListAppProfilesResponse = { +const ListAppProfilesResponse = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Request message for BigtableInstanceAdmin.UpdateAppProfile. * * @property {Object} appProfile @@ -485,16 +470,11 @@ var ListAppProfilesResponse = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.UpdateAppProfileRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var UpdateAppProfileRequest = { +const UpdateAppProfileRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Request message for BigtableInstanceAdmin.DeleteAppProfile. * * @property {string} name @@ -508,21 +488,16 @@ var UpdateAppProfileRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.DeleteAppProfileRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var DeleteAppProfileRequest = { +const DeleteAppProfileRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * The metadata for the Operation returned by UpdateAppProfile. * @typedef UpdateAppProfileMetadata * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.UpdateAppProfileMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_instance_admin.proto} */ -var UpdateAppProfileMetadata = { +const UpdateAppProfileMetadata = { // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/src/v2/doc/google/bigtable/admin/v2/doc_bigtable_table_admin.js b/src/v2/doc/google/bigtable/admin/v2/doc_bigtable_table_admin.js index 74a5f534f..e44cabdbb 100644 --- a/src/v2/doc/google/bigtable/admin/v2/doc_bigtable_table_admin.js +++ b/src/v2/doc/google/bigtable/admin/v2/doc_bigtable_table_admin.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -56,13 +56,13 @@ * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.CreateTableRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var CreateTableRequest = { +const CreateTableRequest = { // This is for documentation. Actual contents will be loaded by gRPC. /** * An initial split point for a newly created table. * - * @property {string} key + * @property {Buffer} key * Row key to use as an initial tablet boundary. * * @typedef Split @@ -75,14 +75,14 @@ var CreateTableRequest = { }; /** - * This is a private alpha release of Cloud Bigtable snapshots. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Request message for * google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not recommended + * for production use. It is not subject to any SLA or deprecation policy. + * * @property {string} parent * The unique name of the instance in which to create the table. * Values are of the form `projects//instances/`. @@ -101,7 +101,7 @@ var CreateTableRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.CreateTableFromSnapshotRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var CreateTableFromSnapshotRequest = { +const CreateTableFromSnapshotRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -114,7 +114,7 @@ var CreateTableFromSnapshotRequest = { * Values are of the form * `projects//instances//tables/
`. * - * @property {string} rowKeyPrefix + * @property {Buffer} rowKeyPrefix * Delete all rows that start with this row key prefix. Prefix cannot be * zero length. * @@ -125,7 +125,7 @@ var CreateTableFromSnapshotRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.DropRowRangeRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var DropRowRangeRequest = { +const DropRowRangeRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -143,6 +143,10 @@ var DropRowRangeRequest = { * * The number should be among the values of [View]{@link google.bigtable.admin.v2.View} * + * @property {number} pageSize + * Maximum number of results per page. + * CURRENTLY UNIMPLEMENTED AND IGNORED. + * * @property {string} pageToken * The value of `next_page_token` returned by a previous call. * @@ -150,7 +154,7 @@ var DropRowRangeRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.ListTablesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var ListTablesRequest = { +const ListTablesRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -172,7 +176,7 @@ var ListTablesRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.ListTablesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var ListTablesResponse = { +const ListTablesResponse = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -195,7 +199,7 @@ var ListTablesResponse = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.GetTableRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var GetTableRequest = { +const GetTableRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -212,7 +216,7 @@ var GetTableRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.DeleteTableRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var DeleteTableRequest = { +const DeleteTableRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -237,7 +241,7 @@ var DeleteTableRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.ModifyColumnFamiliesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var ModifyColumnFamiliesRequest = { +const ModifyColumnFamiliesRequest = { // This is for documentation. Actual contents will be loaded by gRPC. /** @@ -272,11 +276,6 @@ var ModifyColumnFamiliesRequest = { }; /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Request message for * google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken * @@ -289,16 +288,11 @@ var ModifyColumnFamiliesRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.GenerateConsistencyTokenRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var GenerateConsistencyTokenRequest = { +const GenerateConsistencyTokenRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Response message for * google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken * @@ -309,16 +303,11 @@ var GenerateConsistencyTokenRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.GenerateConsistencyTokenResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var GenerateConsistencyTokenResponse = { +const GenerateConsistencyTokenResponse = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Request message for * google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency * @@ -334,16 +323,11 @@ var GenerateConsistencyTokenResponse = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.CheckConsistencyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var CheckConsistencyRequest = { +const CheckConsistencyRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Response message for * google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency * @@ -355,19 +339,19 @@ var CheckConsistencyRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.CheckConsistencyResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var CheckConsistencyResponse = { +const CheckConsistencyResponse = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable snapshots. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Request message for * google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not recommended + * for production use. It is not subject to any SLA or deprecation policy. + * * @property {string} name * The unique name of the table to have the snapshot taken. * Values are of the form @@ -399,19 +383,19 @@ var CheckConsistencyResponse = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.SnapshotTableRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var SnapshotTableRequest = { +const SnapshotTableRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable snapshots. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Request message for * google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not recommended + * for production use. It is not subject to any SLA or deprecation policy. + * * @property {string} name * The unique name of the requested snapshot. * Values are of the form @@ -421,19 +405,19 @@ var SnapshotTableRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.GetSnapshotRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var GetSnapshotRequest = { +const GetSnapshotRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable snapshots. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Request message for * google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not recommended + * for production use. It is not subject to any SLA or deprecation policy. + * * @property {string} parent * The unique name of the cluster for which snapshots should be listed. * Values are of the form @@ -442,7 +426,8 @@ var GetSnapshotRequest = { * e.g., `projects//instances//clusters/-`. * * @property {number} pageSize - * The maximum number of snapshots to return. + * The maximum number of snapshots to return per page. + * CURRENTLY UNIMPLEMENTED AND IGNORED. * * @property {string} pageToken * The value of `next_page_token` returned by a previous call. @@ -451,19 +436,19 @@ var GetSnapshotRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.ListSnapshotsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var ListSnapshotsRequest = { +const ListSnapshotsRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable snapshots. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Response message for * google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not recommended + * for production use. It is not subject to any SLA or deprecation policy. + * * @property {Object[]} snapshots * The snapshots present in the requested cluster. * @@ -478,19 +463,19 @@ var ListSnapshotsRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.ListSnapshotsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var ListSnapshotsResponse = { +const ListSnapshotsResponse = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable snapshots. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * Request message for * google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not recommended + * for production use. It is not subject to any SLA or deprecation policy. + * * @property {string} name * The unique name of the snapshot to be deleted. * Values are of the form @@ -500,18 +485,18 @@ var ListSnapshotsResponse = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.DeleteSnapshotRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var DeleteSnapshotRequest = { +const DeleteSnapshotRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable snapshots. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * The metadata for the Operation returned by SnapshotTable. * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not recommended + * for production use. It is not subject to any SLA or deprecation policy. + * * @property {Object} originalRequest * The request that prompted the initiation of this SnapshotTable operation. * @@ -531,18 +516,18 @@ var DeleteSnapshotRequest = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.SnapshotTableMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var SnapshotTableMetadata = { +const SnapshotTableMetadata = { // This is for documentation. Actual contents will be loaded by gRPC. }; /** - * This is a private alpha release of Cloud Bigtable snapshots. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * The metadata for the Operation returned by CreateTableFromSnapshot. * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not recommended + * for production use. It is not subject to any SLA or deprecation policy. + * * @property {Object} originalRequest * The request that prompted the initiation of this CreateTableFromSnapshot * operation. @@ -563,6 +548,6 @@ var SnapshotTableMetadata = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.CreateTableFromSnapshotMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto} */ -var CreateTableFromSnapshotMetadata = { +const CreateTableFromSnapshotMetadata = { // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/src/v2/doc/google/bigtable/admin/v2/doc_instance.js b/src/v2/doc/google/bigtable/admin/v2/doc_instance.js index 9eebeea76..d55045fd6 100644 --- a/src/v2/doc/google/bigtable/admin/v2/doc_instance.js +++ b/src/v2/doc/google/bigtable/admin/v2/doc_instance.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -59,7 +59,7 @@ * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.Instance definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/instance.proto} */ -var Instance = { +const Instance = { // This is for documentation. Actual contents will be loaded by gRPC. /** @@ -160,7 +160,7 @@ var Instance = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.Cluster definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/instance.proto} */ -var Cluster = { +const Cluster = { // This is for documentation. Actual contents will be loaded by gRPC. /** @@ -206,11 +206,6 @@ var Cluster = { }; /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * A configuration object describing how Cloud Bigtable should treat traffic * from a particular end user application. * @@ -246,7 +241,7 @@ var Cluster = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.AppProfile definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/instance.proto} */ -var AppProfile = { +const AppProfile = { // This is for documentation. Actual contents will be loaded by gRPC. /** diff --git a/src/v2/doc/google/bigtable/admin/v2/doc_table.js b/src/v2/doc/google/bigtable/admin/v2/doc_table.js index 6acef4edb..5f2817654 100644 --- a/src/v2/doc/google/bigtable/admin/v2/doc_table.js +++ b/src/v2/doc/google/bigtable/admin/v2/doc_table.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,20 +23,15 @@ * (`OutputOnly`) * The unique name of the table. Values are of the form * `projects//instances//tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. - * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `FULL` + * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL` * * @property {Object.} clusterStates - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * (`OutputOnly`) * Map from cluster ID to per-cluster table state. * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `FULL` + * Views: `REPLICATION_VIEW`, `FULL` * * @property {Object.} columnFamilies * (`CreationOnly`) @@ -45,7 +40,7 @@ * * @property {number} granularity * (`CreationOnly`) - * The granularity (e.g. `MILLIS`, `MICROS`) at which timestamps are stored in + * 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` @@ -56,15 +51,10 @@ * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.Table definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/table.proto} */ -var Table = { +const Table = { // This is for documentation. Actual contents will be loaded by gRPC. /** - * This is a private alpha release of Cloud Bigtable replication. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * The state of a table's data in a particular cluster. * * @property {number} replicationState @@ -96,30 +86,26 @@ var Table = { /** * The cluster was recently created, and the table must finish copying * over pre-existing data from other clusters before it can begin - * receiving live replication updates and serving - * Data API requests. + * receiving live replication updates and serving Data API requests. */ INITIALIZING: 1, /** - * The table is temporarily unable to serve - * Data API requests from this + * The table is temporarily unable to serve Data API requests from this * cluster due to planned internal maintenance. */ PLANNED_MAINTENANCE: 2, /** - * The table is temporarily unable to serve - * Data API requests from this + * The table is temporarily unable to serve Data API requests from this * cluster due to unplanned or emergency maintenance. */ UNPLANNED_MAINTENANCE: 3, /** - * The table can serve - * Data API requests from this - * cluster. Depending on replication delay, reads may not immediately - * reflect the state of the table in other clusters. + * The table can serve Data API requests from this cluster. Depending on + * replication delay, reads may not immediately reflect the state of the + * table in other clusters. */ READY: 4 } @@ -170,12 +156,6 @@ var Table = { SCHEMA_VIEW: 2, /** - * This is a private alpha release of Cloud Bigtable replication. This - * feature is not currently available to most Cloud Bigtable customers. This - * feature might be changed in backward-incompatible ways and is not - * recommended for production use. It is not subject to any SLA or - * deprecation policy. - * * Only populates `name` and fields related to the table's * replication state. */ @@ -205,7 +185,7 @@ var Table = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.ColumnFamily definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/table.proto} */ -var ColumnFamily = { +const ColumnFamily = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -236,7 +216,7 @@ var ColumnFamily = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.GcRule definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/table.proto} */ -var GcRule = { +const GcRule = { // This is for documentation. Actual contents will be loaded by gRPC. /** @@ -273,14 +253,14 @@ var GcRule = { }; /** - * This is a private alpha release of Cloud Bigtable snapshots. This feature - * is not currently available to most Cloud Bigtable customers. This feature - * might be changed in backward-incompatible ways and is not recommended for - * production use. It is not subject to any SLA or deprecation policy. - * * A snapshot of a table at a particular time. A snapshot can be used as a * checkpoint for data restoration or a data source for a new table. * + * Note: This is a private alpha release of Cloud Bigtable snapshots. This + * feature is not currently available to most Cloud Bigtable customers. This + * feature might be changed in backward-incompatible ways and is not recommended + * for production use. It is not subject to any SLA or deprecation policy. + * * @property {string} name * (`OutputOnly`) * The unique name of the snapshot. @@ -327,7 +307,7 @@ var GcRule = { * @memberof google.bigtable.admin.v2 * @see [google.bigtable.admin.v2.Snapshot definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/table.proto} */ -var Snapshot = { +const Snapshot = { // This is for documentation. Actual contents will be loaded by gRPC. /** diff --git a/src/v2/doc/google/iam/v1/doc_iam_policy.js b/src/v2/doc/google/iam/v1/doc_iam_policy.js new file mode 100644 index 000000000..d675b1b0d --- /dev/null +++ b/src/v2/doc/google/iam/v1/doc_iam_policy.js @@ -0,0 +1,90 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Request message for `SetIamPolicy` method. + * + * @property {string} resource + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + * + * @property {Object} policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * + * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} + * + * @typedef SetIamPolicyRequest + * @memberof google.iam.v1 + * @see [google.iam.v1.SetIamPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} + */ +const SetIamPolicyRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for `GetIamPolicy` method. + * + * @property {string} resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * + * @typedef GetIamPolicyRequest + * @memberof google.iam.v1 + * @see [google.iam.v1.GetIamPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} + */ +const GetIamPolicyRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for `TestIamPermissions` method. + * + * @property {string} resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * + * @property {string[]} permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * + * @typedef TestIamPermissionsRequest + * @memberof google.iam.v1 + * @see [google.iam.v1.TestIamPermissionsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} + */ +const TestIamPermissionsRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Response message for `TestIamPermissions` method. + * + * @property {string[]} permissions + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + * + * @typedef TestIamPermissionsResponse + * @memberof google.iam.v1 + * @see [google.iam.v1.TestIamPermissionsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto} + */ +const TestIamPermissionsResponse = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/src/v2/doc/google/iam/v1/doc_policy.js b/src/v2/doc/google/iam/v1/doc_policy.js index 0163cf59f..e58c21225 100644 --- a/src/v2/doc/google/iam/v1/doc_policy.js +++ b/src/v2/doc/google/iam/v1/doc_policy.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,12 +20,12 @@ * specify access control policies for Cloud Platform resources. * * - * A `Policy` consists of a list of `bindings`. A `Binding` binds a list of + * A `Policy` consists of a list of `bindings`. A `binding` binds a list of * `members` to a `role`, where the members can be user accounts, Google groups, * Google domains, and service accounts. A `role` is a named list of permissions * defined by IAM. * - * **Example** + * **JSON Example** * * { * "bindings": [ @@ -35,7 +35,7 @@ * "user:mike@example.com", * "group:admins@example.com", * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" * ] * }, * { @@ -45,20 +45,33 @@ * ] * } * + * **YAML Example** + * + * bindings: + * - members: + * - user:mike@example.com + * - group:admins@example.com + * - domain:google.com + * - serviceAccount:my-other-app@appspot.gserviceaccount.com + * role: roles/owner + * - members: + * - user:sean@example.com + * role: roles/viewer + * + * * For a description of IAM and its features, see the - * [IAM developer's guide](https://cloud.google.com/iam). + * [IAM developer's guide](https://cloud.google.com/iam/docs). * * @property {number} version - * Version of the `Policy`. The default version is 0. + * Deprecated. * * @property {Object[]} bindings * Associates a list of `members` to a `role`. - * Multiple `bindings` must not be specified for the same `role`. * `bindings` with no members will result in an error. * * This object should have the same structure as [Binding]{@link google.iam.v1.Binding} * - * @property {string} etag + * @property {Buffer} etag * `etag` is used for optimistic concurrency control as a way to help * prevent simultaneous updates of a policy from overwriting each other. * It is strongly suggested that systems make use of the `etag` in the @@ -74,7 +87,7 @@ * @memberof google.iam.v1 * @see [google.iam.v1.Policy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} */ -var Policy = { +const Policy = { // This is for documentation. Actual contents will be loaded by gRPC. }; @@ -84,7 +97,6 @@ var Policy = { * @property {string} role * Role that is assigned to `members`. * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * Required * * @property {string[]} members * Specifies the identities requesting access for a Cloud Platform resource. @@ -97,7 +109,7 @@ var Policy = { * who is authenticated with a Google account or a service account. * * * `user:{emailid}`: An email address that represents a specific Google - * account. For example, `alice@gmail.com` or `joe@example.com`. + * account. For example, `alice@gmail.com` . * * * * `serviceAccount:{emailid}`: An email address that represents a service @@ -106,57 +118,22 @@ var Policy = { * * `group:{emailid}`: An email address that represents a Google group. * For example, `admins@example.com`. * - * * `domain:{domain}`: A Google Apps domain name that represents all the - * users of that domain. For example, `google.com` or `example.com`. - * - * @typedef Binding - * @memberof google.iam.v1 - * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -var Binding = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The difference delta between two policies. - * - * @property {Object[]} bindingDeltas - * The delta for Bindings between two policies. - * - * This object should have the same structure as [BindingDelta]{@link google.iam.v1.BindingDelta} * - * @typedef PolicyDelta - * @memberof google.iam.v1 - * @see [google.iam.v1.PolicyDelta definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} - */ -var PolicyDelta = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * One delta entry for Binding. Each individual change (only one member in each - * entry) to a binding will be a separate entry. - * - * @property {number} action - * The action that was performed on a Binding. - * Required + * * `domain:{domain}`: The G Suite domain (primary) that represents all the + * users of that domain. For example, `google.com` or `example.com`. * - * The number should be among the values of [Action]{@link google.iam.v1.Action} + * @property {Object} condition + * The condition that is associated with this binding. + * NOTE: An unsatisfied condition will not allow user access via current + * binding. Different bindings, including their conditions, are examined + * independently. * - * @property {string} role - * Role that is assigned to `members`. - * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - * Required + * This object should have the same structure as [Expr]{@link google.type.Expr} * - * @property {string} member - * A single identity requesting access for a Cloud Platform resource. - * Follows the same format of Binding.members. - * Required - * - * @typedef BindingDelta + * @typedef Binding * @memberof google.iam.v1 - * @see [google.iam.v1.BindingDelta definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} + * @see [google.iam.v1.Binding definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/iam/v1/policy.proto} */ -var BindingDelta = { +const Binding = { // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/src/v2/doc/google/longrunning/doc_operations.js b/src/v2/doc/google/longrunning/doc_operations.js new file mode 100644 index 000000000..4719aebdc --- /dev/null +++ b/src/v2/doc/google/longrunning/doc_operations.js @@ -0,0 +1,63 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * This resource represents a long-running operation that is the result of a + * network API call. + * + * @property {string} name + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + * + * @property {Object} metadata + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @property {boolean} done + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + * + * @property {Object} error + * The error result of the operation in case of failure or cancellation. + * + * This object should have the same structure as [Status]{@link google.rpc.Status} + * + * @property {Object} response + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + * + * This object should have the same structure as [Any]{@link google.protobuf.Any} + * + * @typedef Operation + * @memberof google.longrunning + * @see [google.longrunning.Operation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto} + */ +const Operation = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/src/v2/doc/google/protobuf/doc_duration.js b/src/v2/doc/google/protobuf/doc_duration.js index 3ea5c376a..1275f8f4d 100644 --- a/src/v2/doc/google/protobuf/doc_duration.js +++ b/src/v2/doc/google/protobuf/doc_duration.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -92,6 +92,6 @@ * @memberof google.protobuf * @see [google.protobuf.Duration definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/duration.proto} */ -var Duration = { +const Duration = { // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/src/v2/doc/google/protobuf/doc_empty.js b/src/v2/doc/google/protobuf/doc_empty.js new file mode 100644 index 000000000..0b446dd9c --- /dev/null +++ b/src/v2/doc/google/protobuf/doc_empty.js @@ -0,0 +1,34 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * The JSON representation for `Empty` is empty JSON object `{}`. + * @typedef Empty + * @memberof google.protobuf + * @see [google.protobuf.Empty definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/empty.proto} + */ +const Empty = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/src/v2/doc/google/protobuf/doc_field_mask.js b/src/v2/doc/google/protobuf/doc_field_mask.js index c82c2b339..011207b86 100644 --- a/src/v2/doc/google/protobuf/doc_field_mask.js +++ b/src/v2/doc/google/protobuf/doc_field_mask.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -84,57 +84,49 @@ * describe the updated values, the API ignores the values of all * fields not covered by the mask. * - * If a repeated field is specified for an update operation, the existing - * repeated values in the target resource will be overwritten by the new values. - * Note that a repeated field is only allowed in the last position of a `paths` - * string. + * If a repeated field is specified for an update operation, new values will + * be appended to the existing repeated field in the target resource. Note that + * a repeated field is only allowed in the last position of a `paths` string. * * If a sub-message is specified in the last position of the field mask for an - * update operation, then the existing sub-message in the target resource is - * overwritten. Given the target message: + * update operation, then new value will be merged into the existing sub-message + * in the target resource. + * + * For example, given the target message: * * f { * b { - * d : 1 - * x : 2 + * d: 1 + * x: 2 * } - * c : 1 + * c: [1] * } * * And an update message: * * f { * b { - * d : 10 + * d: 10 * } + * c: [2] * } * * then if the field mask is: * - * paths: "f.b" + * paths: ["f.b", "f.c"] * * then the result will be: * * f { * b { - * d : 10 + * d: 10 + * x: 2 * } - * c : 1 + * c: [1, 2] * } * - * However, if the update mask was: - * - * paths: "f.b.d" - * - * then the result would be: - * - * f { - * b { - * d : 10 - * x : 2 - * } - * c : 1 - * } + * An implementation may provide options to override this default behavior for + * repeated and message fields. * * In order to reset a field's value to the default, the field must * be in the mask and set to the default value in the provided resource. @@ -218,6 +210,12 @@ * Note that oneof type names ("test_oneof" in this case) cannot be used in * paths. * + * ## Field Mask Verification + * + * The implementation of any API method which has a FieldMask type field in the + * request should verify the included field paths, and return an + * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. + * * @property {string[]} paths * The set of field mask paths. * @@ -225,6 +223,6 @@ * @memberof google.protobuf * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} */ -var FieldMask = { +const FieldMask = { // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/src/v2/doc/google/protobuf/doc_timestamp.js b/src/v2/doc/google/protobuf/doc_timestamp.js index 1326e35f1..b643b2d6c 100644 --- a/src/v2/doc/google/protobuf/doc_timestamp.js +++ b/src/v2/doc/google/protobuf/doc_timestamp.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,17 +16,19 @@ // to be loaded as the JS file. /** - * A Timestamp represents a point in time independent of any time zone - * or calendar, represented as seconds and fractions of seconds at - * nanosecond resolution in UTC Epoch time. It is encoded using the - * Proleptic Gregorian Calendar which extends the Gregorian calendar - * backwards to year one. It is encoded assuming all minutes are 60 - * seconds long, i.e. leap seconds are "smeared" so that no leap second - * table is needed for interpretation. Range is from - * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. - * By restricting to that range, we ensure that we can convert to - * and from RFC 3339 date strings. - * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. * * # Examples * @@ -79,7 +81,9 @@ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required, though only UTC (as indicated by "Z") is presently supported. + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). * * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past * 01:30 UTC on January 15, 2017. @@ -89,8 +93,9 @@ * method. In Python, a standard `datetime.datetime` object can be converted * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--()) - * to obtain a formatter capable of generating timestamps in this format. + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`](https://cloud.google.com + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) to obtain a formatter capable of generating timestamps in this format. * * @property {number} seconds * Represents seconds of UTC time since Unix epoch @@ -107,6 +112,6 @@ * @memberof google.protobuf * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} */ -var Timestamp = { +const Timestamp = { // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/src/v2/doc/google/type/doc_expr.js b/src/v2/doc/google/type/doc_expr.js new file mode 100644 index 000000000..421a7ee9e --- /dev/null +++ b/src/v2/doc/google/type/doc_expr.js @@ -0,0 +1,51 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Represents an expression text. Example: + * + * title: "User account presence" + * description: "Determines whether the request has a user account" + * expression: "size(request.user) > 0" + * + * @property {string} expression + * Textual representation of an expression in + * Common Expression Language syntax. + * + * The application context of the containing message determines which + * well-known feature set of CEL is supported. + * + * @property {string} title + * An optional title for the expression, i.e. a short string describing + * its purpose. This can be used e.g. in UIs which allow to enter the + * expression. + * + * @property {string} description + * An optional description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + * + * @property {string} location + * An optional string indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + * + * @typedef Expr + * @memberof google.type + * @see [google.type.Expr definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/type/expr.proto} + */ +const Expr = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/synth.metadata b/synth.metadata index 7f41c702d..300db5428 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-18T00:58:06.073409Z", + "updateTime": "2019-06-21T22:02:08.661827Z", "sources": [ { "generator": { "name": "artman", - "version": "0.26.0", - "dockerImage": "googleapis/artman@sha256:6db0735b0d3beec5b887153a2a7c7411fc7bb53f73f6f389a822096bd14a3a15" + "version": "0.29.0", + "dockerImage": "googleapis/artman@sha256:b79c8c20ee51e5302686c9d1294672d59290df1489be93749ef17d0172cc508d" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "384aa843867c4d17756d14a01f047b6368494d32", - "internalRef": "253675319" + "sha": "de1150ccad2a3daa4e265a0948bec54fdf9c8b54", + "internalRef": "254446031" } }, { @@ -34,6 +34,16 @@ "generator": "gapic", "config": "google/bigtable/artman_bigtable.yaml" } + }, + { + "client": { + "source": "googleapis", + "apiName": "bigtable_admin", + "apiVersion": "v2", + "language": "nodejs", + "generator": "gapic", + "config": "google/bigtable/admin/artman_bigtableadmin.yaml" + } } ] } \ No newline at end of file diff --git a/synth.py b/synth.py index 6e78c535a..63943f766 100644 --- a/synth.py +++ b/synth.py @@ -11,6 +11,19 @@ 'v2', config_path='/google/bigtable/artman_bigtable.yaml' ) + +s.copy( + v2_library, + excludes=['package.json', 'README.md', 'src/index.js', 'src/v2/index.js'] +) + +v2_library = gapic.node_library( + "bigtable_admin", + "v2", + config_path="/google/bigtable/admin/artman_bigtableadmin.yaml", + artman_output_name="bigtable-admin-v2" +) + s.copy( v2_library, excludes=['package.json', 'README.md', 'src/index.js', 'src/v2/index.js'] @@ -18,6 +31,9 @@ # Update path discovery due to build/ dir and TypeScript conversion. s.replace("src/v2/bigtable_client.js", "../../package.json", "../../../package.json") +s.replace("src/v2/bigtable_instance_admin_client.js", "../../package.json", "../../../package.json") +s.replace("src/v2/bigtable_table_admin_client.js", "../../package.json", "../../../package.json") + common_templates = gcp.CommonTemplates() templates = common_templates.node_library( diff --git a/test/gapic-v2.js b/test/gapic-v2.js index 113c5b13f..8daeaec74 100644 --- a/test/gapic-v2.js +++ b/test/gapic-v2.js @@ -15,259 +15,2007 @@ 'use strict'; const assert = require('assert'); -const through2 = require('through2'); -const bigtableModule = require('../src'); +const adminModule = require('../src'); const FAKE_STATUS_CODE = 1; const error = new Error(); error.code = FAKE_STATUS_CODE; -describe('BigtableClient', () => { +describe('BigtableInstanceAdminClient', () => { it('has servicePath', () => { - const servicePath = bigtableModule.v2.BigtableClient.servicePath; + const servicePath = adminModule.v2.BigtableInstanceAdminClient.servicePath; assert(servicePath); }); it('has apiEndpoint', () => { - const apiEndpoint = bigtableModule.v2.BigtableClient.apiEndpoint; + const apiEndpoint = adminModule.v2.BigtableInstanceAdminClient.apiEndpoint; assert(apiEndpoint); }); it('has port', () => { - const port = bigtableModule.v2.BigtableClient.port; + const port = adminModule.v2.BigtableInstanceAdminClient.port; assert(port); assert(typeof port === 'number'); }); it('should create a client with no options', () => { - const client = new bigtableModule.v2.BigtableClient(); + const client = new adminModule.v2.BigtableInstanceAdminClient(); assert(client); }); - describe('readRows', () => { - it('invokes readRows without error', done => { - const client = new bigtableModule.v2.BigtableClient({ + describe('createInstance', function() { + it('invokes createInstance without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const formattedTableName = client.tablePath( + const formattedParent = client.projectPath('[PROJECT]'); + const instanceId = 'instanceId-2101995259'; + const instance = {}; + const clusters = {}; + const request = { + parent: formattedParent, + instanceId: instanceId, + instance: instance, + clusters: clusters, + }; + + // Mock response + const name = 'name3373707'; + const displayName = 'displayName1615086568'; + const expectedResponse = { + name: name, + displayName: displayName, + }; + + // Mock Grpc layer + client._innerApiCalls.createInstance = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .createInstance(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes createInstance with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.projectPath('[PROJECT]'); + const instanceId = 'instanceId-2101995259'; + const instance = {}; + const clusters = {}; + const request = { + parent: formattedParent, + instanceId: instanceId, + instance: instance, + clusters: clusters, + }; + + // Mock Grpc layer + client._innerApiCalls.createInstance = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .createInstance(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.createInstance + .responseDecoder instanceof Function + ); + assert( + client._descriptors.longrunning.createInstance + .metadataDecoder instanceof Function + ); + }); + }); + + describe('getInstance', () => { + it('invokes getInstance without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); + const request = { + name: formattedName, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const displayName = 'displayName1615086568'; + const expectedResponse = { + name: name2, + displayName: displayName, + }; + + // Mock Grpc layer + client._innerApiCalls.getInstance = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getInstance(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getInstance with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.getInstance = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getInstance(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.projectPath('[PROJECT]'); + const request = { + parent: formattedParent, + }; + + // Mock response + const nextPageToken = 'nextPageToken-1530815211'; + const expectedResponse = { + nextPageToken: nextPageToken, + }; + + // Mock Grpc layer + client._innerApiCalls.listInstances = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.listInstances(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes listInstances with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.projectPath('[PROJECT]'); + const request = { + parent: formattedParent, + }; + + // Mock Grpc layer + client._innerApiCalls.listInstances = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.listInstances(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('updateInstance', () => { + it('invokes updateInstance without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); + const displayName = 'displayName1615086568'; + const type = 'TYPE_UNSPECIFIED'; + const labels = {}; + const request = { + name: formattedName, + displayName: displayName, + type: type, + labels: labels, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const displayName2 = 'displayName21615000987'; + const expectedResponse = { + name: name2, + displayName: displayName2, + }; + + // Mock Grpc layer + client._innerApiCalls.updateInstance = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.updateInstance(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateInstance with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); + const displayName = 'displayName1615086568'; + const type = 'TYPE_UNSPECIFIED'; + const labels = {}; + const request = { + name: formattedName, + displayName: displayName, + type: type, + labels: labels, + }; + + // Mock Grpc layer + client._innerApiCalls.updateInstance = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.updateInstance(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('partialUpdateInstance', function() { + it('invokes partialUpdateInstance without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const instance = {}; + const updateMask = {}; + const request = { + instance: instance, + updateMask: updateMask, + }; + + // Mock response + const name = 'name3373707'; + const displayName = 'displayName1615086568'; + const expectedResponse = { + name: name, + displayName: displayName, + }; + + // Mock Grpc layer + client._innerApiCalls.partialUpdateInstance = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .partialUpdateInstance(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes partialUpdateInstance with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const instance = {}; + const updateMask = {}; + const request = { + instance: instance, + updateMask: updateMask, + }; + + // Mock Grpc layer + client._innerApiCalls.partialUpdateInstance = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .partialUpdateInstance(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.partialUpdateInstance + .responseDecoder instanceof Function + ); + assert( + client._descriptors.longrunning.partialUpdateInstance + .metadataDecoder instanceof Function + ); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteInstance = mockSimpleGrpcMethod(request); + + client.deleteInstance(request, err => { + assert.ifError(err); + done(); + }); + }); + + it('invokes deleteInstance with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.instancePath('[PROJECT]', '[INSTANCE]'); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteInstance = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.deleteInstance(request, err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + + describe('createCluster', function() { + it('invokes createCluster without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + const clusterId = 'clusterId240280960'; + const cluster = {}; + const request = { + parent: formattedParent, + clusterId: clusterId, + cluster: cluster, + }; + + // Mock response + const name = 'name3373707'; + const location = 'location1901043637'; + const serveNodes = 1288838783; + const expectedResponse = { + name: name, + location: location, + serveNodes: serveNodes, + }; + + // Mock Grpc layer + client._innerApiCalls.createCluster = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .createCluster(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes createCluster with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + const clusterId = 'clusterId240280960'; + const cluster = {}; + const request = { + parent: formattedParent, + clusterId: clusterId, + cluster: cluster, + }; + + // Mock Grpc layer + client._innerApiCalls.createCluster = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .createCluster(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.createCluster.responseDecoder instanceof + Function + ); + assert( + client._descriptors.longrunning.createCluster.metadataDecoder instanceof + Function + ); + }); + }); + + describe('getCluster', () => { + it('invokes getCluster without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.clusterPath( + '[PROJECT]', + '[INSTANCE]', + '[CLUSTER]' + ); + const request = { + name: formattedName, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const location = 'location1901043637'; + const serveNodes = 1288838783; + const expectedResponse = { + name: name2, + location: location, + serveNodes: serveNodes, + }; + + // Mock Grpc layer + client._innerApiCalls.getCluster = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getCluster(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getCluster with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.clusterPath( + '[PROJECT]', + '[INSTANCE]', + '[CLUSTER]' + ); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.getCluster = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getCluster(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + const request = { + parent: formattedParent, + }; + + // Mock response + const nextPageToken = 'nextPageToken-1530815211'; + const expectedResponse = { + nextPageToken: nextPageToken, + }; + + // Mock Grpc layer + client._innerApiCalls.listClusters = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.listClusters(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes listClusters with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + const request = { + parent: formattedParent, + }; + + // Mock Grpc layer + client._innerApiCalls.listClusters = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.listClusters(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('updateCluster', function() { + it('invokes updateCluster without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.clusterPath( + '[PROJECT]', + '[INSTANCE]', + '[CLUSTER]' + ); + const serveNodes = 1288838783; + const request = { + name: formattedName, + serveNodes: serveNodes, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const location = 'location1901043637'; + const serveNodes2 = 1623486220; + const expectedResponse = { + name: name2, + location: location, + serveNodes: serveNodes2, + }; + + // Mock Grpc layer + client._innerApiCalls.updateCluster = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .updateCluster(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes updateCluster with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.clusterPath( + '[PROJECT]', + '[INSTANCE]', + '[CLUSTER]' + ); + const serveNodes = 1288838783; + const request = { + name: formattedName, + serveNodes: serveNodes, + }; + + // Mock Grpc layer + client._innerApiCalls.updateCluster = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .updateCluster(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.updateCluster.responseDecoder instanceof + Function + ); + assert( + client._descriptors.longrunning.updateCluster.metadataDecoder instanceof + Function + ); + }); + }); + + describe('deleteCluster', () => { + it('invokes deleteCluster without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.clusterPath( + '[PROJECT]', + '[INSTANCE]', + '[CLUSTER]' + ); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteCluster = mockSimpleGrpcMethod(request); + + client.deleteCluster(request, err => { + assert.ifError(err); + done(); + }); + }); + + it('invokes deleteCluster with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.clusterPath( + '[PROJECT]', + '[INSTANCE]', + '[CLUSTER]' + ); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteCluster = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.deleteCluster(request, err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + + describe('createAppProfile', () => { + it('invokes createAppProfile without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + const appProfileId = 'appProfileId1262094415'; + const appProfile = {}; + const request = { + parent: formattedParent, + appProfileId: appProfileId, + appProfile: appProfile, + }; + + // Mock response + const name = 'name3373707'; + const etag = 'etag3123477'; + const description = 'description-1724546052'; + const expectedResponse = { + name: name, + etag: etag, + description: description, + }; + + // Mock Grpc layer + client._innerApiCalls.createAppProfile = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.createAppProfile(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createAppProfile with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + const appProfileId = 'appProfileId1262094415'; + const appProfile = {}; + const request = { + parent: formattedParent, + appProfileId: appProfileId, + appProfile: appProfile, + }; + + // Mock Grpc layer + client._innerApiCalls.createAppProfile = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.createAppProfile(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('getAppProfile', () => { + it('invokes getAppProfile without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.appProfilePath( + '[PROJECT]', + '[INSTANCE]', + '[APP_PROFILE]' + ); + const request = { + name: formattedName, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const etag = 'etag3123477'; + const description = 'description-1724546052'; + const expectedResponse = { + name: name2, + etag: etag, + description: description, + }; + + // Mock Grpc layer + client._innerApiCalls.getAppProfile = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getAppProfile(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getAppProfile with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.appProfilePath( + '[PROJECT]', + '[INSTANCE]', + '[APP_PROFILE]' + ); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.getAppProfile = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getAppProfile(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('listAppProfiles', () => { + it('invokes listAppProfiles without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + const request = { + parent: formattedParent, + }; + + // Mock response + const nextPageToken = ''; + const appProfilesElement = {}; + const appProfiles = [appProfilesElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + appProfiles: appProfiles, + }; + + // Mock Grpc layer + client._innerApiCalls.listAppProfiles = ( + actualRequest, + options, + callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.appProfiles); + }; + + client.listAppProfiles(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse.appProfiles); + done(); + }); + }); + + it('invokes listAppProfiles with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + const request = { + parent: formattedParent, + }; + + // Mock Grpc layer + client._innerApiCalls.listAppProfiles = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.listAppProfiles(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('updateAppProfile', function() { + it('invokes updateAppProfile without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const appProfile = {}; + const updateMask = {}; + const request = { + appProfile: appProfile, + updateMask: updateMask, + }; + + // Mock response + const name = 'name3373707'; + const etag = 'etag3123477'; + const description = 'description-1724546052'; + const expectedResponse = { + name: name, + etag: etag, + description: description, + }; + + // Mock Grpc layer + client._innerApiCalls.updateAppProfile = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .updateAppProfile(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes updateAppProfile with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const appProfile = {}; + const updateMask = {}; + const request = { + appProfile: appProfile, + updateMask: updateMask, + }; + + // Mock Grpc layer + client._innerApiCalls.updateAppProfile = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .updateAppProfile(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.updateAppProfile + .responseDecoder instanceof Function + ); + assert( + client._descriptors.longrunning.updateAppProfile + .metadataDecoder instanceof Function + ); + }); + }); + + describe('deleteAppProfile', () => { + it('invokes deleteAppProfile without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.appProfilePath( + '[PROJECT]', + '[INSTANCE]', + '[APP_PROFILE]' + ); + const ignoreWarnings = true; + const request = { + name: formattedName, + ignoreWarnings: ignoreWarnings, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteAppProfile = mockSimpleGrpcMethod(request); + + client.deleteAppProfile(request, err => { + assert.ifError(err); + done(); + }); + }); + + it('invokes deleteAppProfile with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.appProfilePath( + '[PROJECT]', + '[INSTANCE]', + '[APP_PROFILE]' + ); + const ignoreWarnings = true; + const request = { + name: formattedName, + ignoreWarnings: ignoreWarnings, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteAppProfile = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.deleteAppProfile(request, err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); + const request = { + resource: formattedResource, + }; + + // Mock response + const version = 351608024; + const etag = 'etag3123477'; + const expectedResponse = { + version: version, + etag: etag, + }; + + // Mock Grpc layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getIamPolicy(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getIamPolicy with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); + const request = { + resource: formattedResource, + }; + + // Mock Grpc layer + client._innerApiCalls.getIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getIamPolicy(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); + const policy = {}; + const request = { + resource: formattedResource, + policy: policy, + }; + + // Mock response + const version = 351608024; + const etag = 'etag3123477'; + const expectedResponse = { + version: version, + etag: etag, + }; + + // Mock Grpc layer + client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.setIamPolicy(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes setIamPolicy with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); + const policy = {}; + const request = { + resource: formattedResource, + policy: policy, + }; + + // Mock Grpc layer + client._innerApiCalls.setIamPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.setIamPolicy(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); + const permissions = []; + const request = { + resource: formattedResource, + permissions: permissions, + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.testIamPermissions(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes testIamPermissions with error', done => { + const client = new adminModule.v2.BigtableInstanceAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]'); + const permissions = []; + const request = { + resource: formattedResource, + permissions: permissions, + }; + + // Mock Grpc layer + client._innerApiCalls.testIamPermissions = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.testIamPermissions(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); +}); +describe('BigtableTableAdminClient', () => { + it('has servicePath', () => { + const servicePath = adminModule.v2.BigtableTableAdminClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = adminModule.v2.BigtableTableAdminClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = adminModule.v2.BigtableTableAdminClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no options', () => { + const client = new adminModule.v2.BigtableTableAdminClient(); + assert(client); + }); + + describe('createTable', () => { + it('invokes createTable without error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + const tableId = 'tableId-895419604'; + const table = {}; + const request = { + parent: formattedParent, + tableId: tableId, + table: table, + }; + + // Mock response + const name = 'name3373707'; + const expectedResponse = { + name: name, + }; + + // Mock Grpc layer + client._innerApiCalls.createTable = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.createTable(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createTable with error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + const tableId = 'tableId-895419604'; + const table = {}; + const request = { + parent: formattedParent, + tableId: tableId, + table: table, + }; + + // Mock Grpc layer + client._innerApiCalls.createTable = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.createTable(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('createTableFromSnapshot', function() { + it('invokes createTableFromSnapshot without error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + const tableId = 'tableId-895419604'; + const sourceSnapshot = 'sourceSnapshot-947679896'; + const request = { + parent: formattedParent, + tableId: tableId, + sourceSnapshot: sourceSnapshot, + }; + + // Mock response + const name = 'name3373707'; + const expectedResponse = { + name: name, + }; + + // Mock Grpc layer + client._innerApiCalls.createTableFromSnapshot = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .createTableFromSnapshot(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes createTableFromSnapshot with error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + const tableId = 'tableId-895419604'; + const sourceSnapshot = 'sourceSnapshot-947679896'; + const request = { + parent: formattedParent, + tableId: tableId, + sourceSnapshot: sourceSnapshot, + }; + + // Mock Grpc layer + client._innerApiCalls.createTableFromSnapshot = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .createTableFromSnapshot(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.createTableFromSnapshot + .responseDecoder instanceof Function + ); + assert( + client._descriptors.longrunning.createTableFromSnapshot + .metadataDecoder instanceof Function + ); + }); + }); + + describe('listTables', () => { + it('invokes listTables without error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + const request = { + parent: formattedParent, + }; + + // Mock response + const nextPageToken = ''; + const tablesElement = {}; + const tables = [tablesElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + tables: tables, + }; + + // Mock Grpc layer + client._innerApiCalls.listTables = (actualRequest, options, callback) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.tables); + }; + + client.listTables(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse.tables); + done(); + }); + }); + + it('invokes listTables with error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]'); + const request = { + parent: formattedParent, + }; + + // Mock Grpc layer + client._innerApiCalls.listTables = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.listTables(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('getTable', () => { + it('invokes getTable without error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.tablePath( '[PROJECT]', '[INSTANCE]', '[TABLE]' ); const request = { - tableName: formattedTableName, + name: formattedName, }; // Mock response - const lastScannedRowKey = '-126'; + const name2 = 'name2-1052831874'; const expectedResponse = { - lastScannedRowKey: lastScannedRowKey, + name: name2, }; // Mock Grpc layer - client._innerApiCalls.readRows = mockServerStreamingGrpcMethod( + client._innerApiCalls.getTable = mockSimpleGrpcMethod( request, expectedResponse ); - const stream = client.readRows(request); - stream.on('data', response => { + client.getTable(request, (err, response) => { + assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); }); - stream.on('error', err => { - done(err); + }); + + it('invokes getTable with error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.tablePath( + '[PROJECT]', + '[INSTANCE]', + '[TABLE]' + ); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.getTable = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getTable(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('deleteTable', () => { + it('invokes deleteTable without error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - stream.write(); + // Mock request + const formattedName = client.tablePath( + '[PROJECT]', + '[INSTANCE]', + '[TABLE]' + ); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteTable = mockSimpleGrpcMethod(request); + + client.deleteTable(request, err => { + assert.ifError(err); + done(); + }); }); - it('invokes readRows with error', done => { - const client = new bigtableModule.v2.BigtableClient({ + it('invokes deleteTable with error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const formattedTableName = client.tablePath( + const formattedName = client.tablePath( '[PROJECT]', '[INSTANCE]', '[TABLE]' ); const request = { - tableName: formattedTableName, + name: formattedName, }; // Mock Grpc layer - client._innerApiCalls.readRows = mockServerStreamingGrpcMethod( + client._innerApiCalls.deleteTable = mockSimpleGrpcMethod( request, null, error ); - const stream = client.readRows(request); - stream.on('data', () => { - assert.fail(); - }); - stream.on('error', err => { + client.deleteTable(request, err => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); done(); }); - - stream.write(); }); }); - describe('sampleRowKeys', () => { - it('invokes sampleRowKeys without error', done => { - const client = new bigtableModule.v2.BigtableClient({ + describe('modifyColumnFamilies', () => { + it('invokes modifyColumnFamilies without error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const formattedTableName = client.tablePath( + const formattedName = client.tablePath( '[PROJECT]', '[INSTANCE]', '[TABLE]' ); + const modifications = []; const request = { - tableName: formattedTableName, + name: formattedName, + modifications: modifications, }; // Mock response - const rowKey = '122'; - const offsetBytes = 889884095; + const name2 = 'name2-1052831874'; const expectedResponse = { - rowKey: rowKey, - offsetBytes: offsetBytes, + name: name2, }; // Mock Grpc layer - client._innerApiCalls.sampleRowKeys = mockServerStreamingGrpcMethod( + client._innerApiCalls.modifyColumnFamilies = mockSimpleGrpcMethod( request, expectedResponse ); - const stream = client.sampleRowKeys(request); - stream.on('data', response => { + client.modifyColumnFamilies(request, (err, response) => { + assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); }); - stream.on('error', err => { - done(err); + }); + + it('invokes modifyColumnFamilies with error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.tablePath( + '[PROJECT]', + '[INSTANCE]', + '[TABLE]' + ); + const modifications = []; + const request = { + name: formattedName, + modifications: modifications, + }; + + // Mock Grpc layer + client._innerApiCalls.modifyColumnFamilies = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.modifyColumnFamilies(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('dropRowRange', () => { + it('invokes dropRowRange without error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - stream.write(); + // Mock request + const formattedName = client.tablePath( + '[PROJECT]', + '[INSTANCE]', + '[TABLE]' + ); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.dropRowRange = mockSimpleGrpcMethod(request); + + client.dropRowRange(request, err => { + assert.ifError(err); + done(); + }); }); - it('invokes sampleRowKeys with error', done => { - const client = new bigtableModule.v2.BigtableClient({ + it('invokes dropRowRange with error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const formattedTableName = client.tablePath( + const formattedName = client.tablePath( '[PROJECT]', '[INSTANCE]', '[TABLE]' ); const request = { - tableName: formattedTableName, + name: formattedName, }; // Mock Grpc layer - client._innerApiCalls.sampleRowKeys = mockServerStreamingGrpcMethod( + client._innerApiCalls.dropRowRange = mockSimpleGrpcMethod( request, null, error ); - const stream = client.sampleRowKeys(request); - stream.on('data', () => { - assert.fail(); - }); - stream.on('error', err => { + client.dropRowRange(request, err => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); done(); }); - - stream.write(); }); }); - describe('mutateRow', () => { - it('invokes mutateRow without error', done => { - const client = new bigtableModule.v2.BigtableClient({ + describe('generateConsistencyToken', () => { + it('invokes generateConsistencyToken without error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const formattedTableName = client.tablePath( + const formattedName = client.tablePath( '[PROJECT]', '[INSTANCE]', '[TABLE]' ); - const rowKey = '122'; - const mutations = []; const request = { - tableName: formattedTableName, - rowKey: rowKey, - mutations: mutations, + name: formattedName, }; // Mock response - const expectedResponse = {}; + const consistencyToken = 'consistencyToken-1090516718'; + const expectedResponse = { + consistencyToken: consistencyToken, + }; // Mock Grpc layer - client._innerApiCalls.mutateRow = mockSimpleGrpcMethod( + client._innerApiCalls.generateConsistencyToken = mockSimpleGrpcMethod( request, expectedResponse ); - client.mutateRow(request, (err, response) => { + client.generateConsistencyToken(request, (err, response) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes mutateRow with error', done => { - const client = new bigtableModule.v2.BigtableClient({ + it('invokes generateConsistencyToken with error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const formattedTableName = client.tablePath( + const formattedName = client.tablePath( '[PROJECT]', '[INSTANCE]', '[TABLE]' ); - const rowKey = '122'; - const mutations = []; const request = { - tableName: formattedTableName, - rowKey: rowKey, - mutations: mutations, + name: formattedName, }; // Mock Grpc layer - client._innerApiCalls.mutateRow = mockSimpleGrpcMethod( + client._innerApiCalls.generateConsistencyToken = mockSimpleGrpcMethod( request, null, error ); - client.mutateRow(request, (err, response) => { + client.generateConsistencyToken(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); @@ -276,149 +2024,259 @@ describe('BigtableClient', () => { }); }); - describe('mutateRows', () => { - it('invokes mutateRows without error', done => { - const client = new bigtableModule.v2.BigtableClient({ + describe('checkConsistency', () => { + it('invokes checkConsistency without error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const formattedTableName = client.tablePath( + const formattedName = client.tablePath( '[PROJECT]', '[INSTANCE]', '[TABLE]' ); - const entries = []; + const consistencyToken = 'consistencyToken-1090516718'; const request = { - tableName: formattedTableName, - entries: entries, + name: formattedName, + consistencyToken: consistencyToken, }; // Mock response - const expectedResponse = {}; + const consistent = true; + const expectedResponse = { + consistent: consistent, + }; // Mock Grpc layer - client._innerApiCalls.mutateRows = mockServerStreamingGrpcMethod( + client._innerApiCalls.checkConsistency = mockSimpleGrpcMethod( request, expectedResponse ); - const stream = client.mutateRows(request); - stream.on('data', response => { + client.checkConsistency(request, (err, response) => { + assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); }); - stream.on('error', err => { - done(err); - }); - - stream.write(); }); - it('invokes mutateRows with error', done => { - const client = new bigtableModule.v2.BigtableClient({ + it('invokes checkConsistency with error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const formattedTableName = client.tablePath( + const formattedName = client.tablePath( '[PROJECT]', '[INSTANCE]', '[TABLE]' ); - const entries = []; + const consistencyToken = 'consistencyToken-1090516718'; const request = { - tableName: formattedTableName, - entries: entries, + name: formattedName, + consistencyToken: consistencyToken, }; // Mock Grpc layer - client._innerApiCalls.mutateRows = mockServerStreamingGrpcMethod( + client._innerApiCalls.checkConsistency = mockSimpleGrpcMethod( request, null, error ); - const stream = client.mutateRows(request); - stream.on('data', () => { - assert.fail(); - }); - stream.on('error', err => { + client.checkConsistency(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); done(); }); - - stream.write(); }); }); - describe('checkAndMutateRow', () => { - it('invokes checkAndMutateRow without error', done => { - const client = new bigtableModule.v2.BigtableClient({ + describe('snapshotTable', function() { + it('invokes snapshotTable without error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.tablePath( + '[PROJECT]', + '[INSTANCE]', + '[TABLE]' + ); + const cluster = 'cluster872092154'; + const snapshotId = 'snapshotId-168585866'; + const description = 'description-1724546052'; + const request = { + name: formattedName, + cluster: cluster, + snapshotId: snapshotId, + description: description, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const dataSizeBytes = 2110122398; + const description2 = 'description2568623279'; + const expectedResponse = { + name: name2, + dataSizeBytes: dataSizeBytes, + description: description2, + }; + + // Mock Grpc layer + client._innerApiCalls.snapshotTable = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .snapshotTable(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes snapshotTable with error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const formattedTableName = client.tablePath( + const formattedName = client.tablePath( '[PROJECT]', '[INSTANCE]', '[TABLE]' ); - const rowKey = '122'; + const cluster = 'cluster872092154'; + const snapshotId = 'snapshotId-168585866'; + const description = 'description-1724546052'; + const request = { + name: formattedName, + cluster: cluster, + snapshotId: snapshotId, + description: description, + }; + + // Mock Grpc layer + client._innerApiCalls.snapshotTable = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .snapshotTable(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.snapshotTable.responseDecoder instanceof + Function + ); + assert( + client._descriptors.longrunning.snapshotTable.metadataDecoder instanceof + Function + ); + }); + }); + + describe('getSnapshot', () => { + it('invokes getSnapshot without error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.snapshotPath( + '[PROJECT]', + '[INSTANCE]', + '[CLUSTER]', + '[SNAPSHOT]' + ); const request = { - tableName: formattedTableName, - rowKey: rowKey, + name: formattedName, }; // Mock response - const predicateMatched = true; + const name2 = 'name2-1052831874'; + const dataSizeBytes = 2110122398; + const description = 'description-1724546052'; const expectedResponse = { - predicateMatched: predicateMatched, + name: name2, + dataSizeBytes: dataSizeBytes, + description: description, }; // Mock Grpc layer - client._innerApiCalls.checkAndMutateRow = mockSimpleGrpcMethod( + client._innerApiCalls.getSnapshot = mockSimpleGrpcMethod( request, expectedResponse ); - client.checkAndMutateRow(request, (err, response) => { + client.getSnapshot(request, (err, response) => { assert.ifError(err); assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes checkAndMutateRow with error', done => { - const client = new bigtableModule.v2.BigtableClient({ + it('invokes getSnapshot with error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const formattedTableName = client.tablePath( + const formattedName = client.snapshotPath( '[PROJECT]', '[INSTANCE]', - '[TABLE]' + '[CLUSTER]', + '[SNAPSHOT]' ); - const rowKey = '122'; const request = { - tableName: formattedTableName, - rowKey: rowKey, + name: formattedName, }; // Mock Grpc layer - client._innerApiCalls.checkAndMutateRow = mockSimpleGrpcMethod( + client._innerApiCalls.getSnapshot = mockSimpleGrpcMethod( request, null, error ); - client.checkAndMutateRow(request, (err, response) => { + client.getSnapshot(request, (err, response) => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); assert(typeof response === 'undefined'); @@ -427,74 +2285,135 @@ describe('BigtableClient', () => { }); }); - describe('readModifyWriteRow', () => { - it('invokes readModifyWriteRow without error', done => { - const client = new bigtableModule.v2.BigtableClient({ + describe('listSnapshots', () => { + it('invokes listSnapshots without error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const formattedTableName = client.tablePath( + const formattedParent = client.clusterPath( '[PROJECT]', '[INSTANCE]', - '[TABLE]' + '[CLUSTER]' ); - const rowKey = '122'; - const rules = []; const request = { - tableName: formattedTableName, - rowKey: rowKey, - rules: rules, + parent: formattedParent, }; // Mock response - const expectedResponse = {}; + const nextPageToken = ''; + const snapshotsElement = {}; + const snapshots = [snapshotsElement]; + const expectedResponse = { + nextPageToken: nextPageToken, + snapshots: snapshots, + }; + + // Mock Grpc layer + client._innerApiCalls.listSnapshots = ( + actualRequest, + options, + callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse.snapshots); + }; + + client.listSnapshots(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse.snapshots); + done(); + }); + }); + + it('invokes listSnapshots with error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedParent = client.clusterPath( + '[PROJECT]', + '[INSTANCE]', + '[CLUSTER]' + ); + const request = { + parent: formattedParent, + }; // Mock Grpc layer - client._innerApiCalls.readModifyWriteRow = mockSimpleGrpcMethod( + client._innerApiCalls.listSnapshots = mockSimpleGrpcMethod( request, - expectedResponse + null, + error + ); + + client.listSnapshots(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + + describe('deleteSnapshot', () => { + it('invokes deleteSnapshot without error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.snapshotPath( + '[PROJECT]', + '[INSTANCE]', + '[CLUSTER]', + '[SNAPSHOT]' ); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deleteSnapshot = mockSimpleGrpcMethod(request); - client.readModifyWriteRow(request, (err, response) => { + client.deleteSnapshot(request, err => { assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); done(); }); }); - it('invokes readModifyWriteRow with error', done => { - const client = new bigtableModule.v2.BigtableClient({ + it('invokes deleteSnapshot with error', done => { + const client = new adminModule.v2.BigtableTableAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); // Mock request - const formattedTableName = client.tablePath( + const formattedName = client.snapshotPath( '[PROJECT]', '[INSTANCE]', - '[TABLE]' + '[CLUSTER]', + '[SNAPSHOT]' ); - const rowKey = '122'; - const rules = []; const request = { - tableName: formattedTableName, - rowKey: rowKey, - rules: rules, + name: formattedName, }; // Mock Grpc layer - client._innerApiCalls.readModifyWriteRow = mockSimpleGrpcMethod( + client._innerApiCalls.deleteSnapshot = mockSimpleGrpcMethod( request, null, error ); - client.readModifyWriteRow(request, (err, response) => { + client.deleteSnapshot(request, err => { assert(err instanceof Error); assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); done(); }); }); @@ -514,16 +2433,20 @@ function mockSimpleGrpcMethod(expectedRequest, response, error) { }; } -function mockServerStreamingGrpcMethod(expectedRequest, response, error) { - return actualRequest => { - assert.deepStrictEqual(actualRequest, expectedRequest); - const mockStream = through2.obj((chunk, enc, callback) => { - if (error) { - callback(error); - } else { - callback(null, response); - } - }); - return mockStream; +function mockLongRunningGrpcMethod(expectedRequest, response, error) { + return request => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise: function() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); }; }