1- // Copyright 2020 Google LLC
1+ // Copyright 2021 Google LLC
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -51,6 +51,12 @@ service BigtableInstanceAdmin {
5151 "https://www.googleapis.com/auth/cloud-platform.read-only" ;
5252
5353 // Create an instance within a project.
54+ //
55+ // Note that exactly one of Cluster.serve_nodes and
56+ // Cluster.cluster_config.cluster_autoscaling_config can be set. If
57+ // serve_nodes is set to non-zero, then the cluster is manually scaled. If
58+ // cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
59+ // enabled.
5460 rpc CreateInstance (CreateInstanceRequest ) returns (google.longrunning.Operation ) {
5561 option (google.api.http ) = {
5662 post : "/v2/{parent=projects/*}/instances"
@@ -112,6 +118,12 @@ service BigtableInstanceAdmin {
112118 }
113119
114120 // Creates a cluster within an instance.
121+ //
122+ // Note that exactly one of Cluster.serve_nodes and
123+ // Cluster.cluster_config.cluster_autoscaling_config can be set. If
124+ // serve_nodes is set to non-zero, then the cluster is manually scaled. If
125+ // cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is
126+ // enabled.
115127 rpc CreateCluster (CreateClusterRequest ) returns (google.longrunning.Operation ) {
116128 option (google.api.http ) = {
117129 post : "/v2/{parent=projects/*/instances/*}/clusters"
@@ -141,6 +153,10 @@ service BigtableInstanceAdmin {
141153 }
142154
143155 // Updates a cluster within an instance.
156+ //
157+ // Note that UpdateCluster does not support updating
158+ // cluster_config.cluster_autoscaling_config. In order to update it, you
159+ // must use PartialUpdateCluster.
144160 rpc UpdateCluster (Cluster ) returns (google.longrunning.Operation ) {
145161 option (google.api.http ) = {
146162 put : "/v2/{name=projects/*/instances/*/clusters/*}"
@@ -152,6 +168,30 @@ service BigtableInstanceAdmin {
152168 };
153169 }
154170
171+ // Partially updates a cluster within a project. This method is the preferred
172+ // way to update a Cluster.
173+ //
174+ // To enable and update autoscaling, set
175+ // cluster_config.cluster_autoscaling_config. When autoscaling is enabled,
176+ // serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it
177+ // are ignored. Note that an update cannot simultaneously set serve_nodes to
178+ // non-zero and cluster_config.cluster_autoscaling_config to non-empty, and
179+ // also specify both in the update_mask.
180+ //
181+ // To disable autoscaling, clear cluster_config.cluster_autoscaling_config,
182+ // and explicitly set a serve_node count via the update_mask.
183+ rpc PartialUpdateCluster (PartialUpdateClusterRequest ) returns (google.longrunning.Operation ) {
184+ option (google.api.http ) = {
185+ patch : "/v2/{cluster.name=projects/*/instances/*/clusters/*}"
186+ body : "cluster"
187+ };
188+ option (google.api.method_signature ) = "cluster,update_mask" ;
189+ option (google.longrunning.operation_info ) = {
190+ response_type : "Cluster"
191+ metadata_type : "PartialUpdateClusterMetadata"
192+ };
193+ }
194+
155195 // Deletes a cluster from an instance.
156196 rpc DeleteCluster (DeleteClusterRequest ) returns (google.protobuf.Empty ) {
157197 option (google.api.http ) = {
@@ -457,6 +497,28 @@ message UpdateClusterMetadata {
457497 google.protobuf.Timestamp finish_time = 3 ;
458498}
459499
500+ // The metadata for the Operation returned by PartialUpdateCluster.
501+ message PartialUpdateClusterMetadata {
502+ // The time at which the original request was received.
503+ google.protobuf.Timestamp request_time = 1 ;
504+
505+ // The time at which the operation failed or was completed successfully.
506+ google.protobuf.Timestamp finish_time = 2 ;
507+
508+ // The original request for PartialUpdateCluster.
509+ PartialUpdateClusterRequest original_request = 3 ;
510+ }
511+
512+ // Request message for BigtableInstanceAdmin.PartialUpdateCluster.
513+ message PartialUpdateClusterRequest {
514+ // Required. The Cluster which contains the partial updates to be applied, subject to
515+ // the update_mask.
516+ Cluster cluster = 1 [(google.api.field_behavior ) = REQUIRED ];
517+
518+ // Required. The subset of Cluster fields which should be replaced.
519+ google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior ) = REQUIRED ];
520+ }
521+
460522// Request message for BigtableInstanceAdmin.CreateAppProfile.
461523message CreateAppProfileRequest {
462524 // Required. The unique name of the instance in which to create the new app profile.
0 commit comments