1
- // Copyright 2020 Google LLC
1
+ // Copyright 2021 Google LLC
2
2
//
3
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
4
// you may not use this file except in compliance with the License.
@@ -51,6 +51,12 @@ service BigtableInstanceAdmin {
51
51
"https://www.googleapis.com/auth/cloud-platform.read-only" ;
52
52
53
53
// 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.
54
60
rpc CreateInstance (CreateInstanceRequest ) returns (google .longrunning .Operation ) {
55
61
option (google.api.http ) = {
56
62
post : "/v2/{parent=projects/*}/instances"
@@ -112,6 +118,12 @@ service BigtableInstanceAdmin {
112
118
}
113
119
114
120
// 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.
115
127
rpc CreateCluster (CreateClusterRequest ) returns (google .longrunning .Operation ) {
116
128
option (google.api.http ) = {
117
129
post : "/v2/{parent=projects/*/instances/*}/clusters"
@@ -141,6 +153,10 @@ service BigtableInstanceAdmin {
141
153
}
142
154
143
155
// 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.
144
160
rpc UpdateCluster (Cluster ) returns (google .longrunning .Operation ) {
145
161
option (google.api.http ) = {
146
162
put : "/v2/{name=projects/*/instances/*/clusters/*}"
@@ -152,6 +168,30 @@ service BigtableInstanceAdmin {
152
168
};
153
169
}
154
170
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
+
155
195
// Deletes a cluster from an instance.
156
196
rpc DeleteCluster (DeleteClusterRequest ) returns (google .protobuf .Empty ) {
157
197
option (google.api.http ) = {
@@ -457,6 +497,28 @@ message UpdateClusterMetadata {
457
497
google.protobuf.Timestamp finish_time = 3 ;
458
498
}
459
499
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
+
460
522
// Request message for BigtableInstanceAdmin.CreateAppProfile.
461
523
message CreateAppProfileRequest {
462
524
// Required. The unique name of the instance in which to create the new app profile.
0 commit comments