xref: /aosp_15_r20/external/googleapis/google/bigtable/admin/v2/instance.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.bigtable.admin.v2;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/bigtable/admin/v2/common.proto";
22import "google/protobuf/timestamp.proto";
23
24option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2";
25option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin";
26option java_multiple_files = true;
27option java_outer_classname = "InstanceProto";
28option java_package = "com.google.bigtable.admin.v2";
29option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2";
30option ruby_package = "Google::Cloud::Bigtable::Admin::V2";
31option (google.api.resource_definition) = {
32  type: "cloudkms.googleapis.com/CryptoKey"
33  pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
34};
35
36// A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and
37// the resources that serve them.
38// All tables in an instance are served from all
39// [Clusters][google.bigtable.admin.v2.Cluster] in the instance.
40message Instance {
41  option (google.api.resource) = {
42    type: "bigtableadmin.googleapis.com/Instance"
43    pattern: "projects/{project}/instances/{instance}"
44  };
45
46  // Possible states of an instance.
47  enum State {
48    // The state of the instance could not be determined.
49    STATE_NOT_KNOWN = 0;
50
51    // The instance has been successfully created and can serve requests
52    // to its tables.
53    READY = 1;
54
55    // The instance is currently being created, and may be destroyed
56    // if the creation process encounters an error.
57    CREATING = 2;
58  }
59
60  // The type of the instance.
61  enum Type {
62    // The type of the instance is unspecified. If set when creating an
63    // instance, a `PRODUCTION` instance will be created. If set when updating
64    // an instance, the type will be left unchanged.
65    TYPE_UNSPECIFIED = 0;
66
67    // An instance meant for production use. `serve_nodes` must be set
68    // on the cluster.
69    PRODUCTION = 1;
70
71    // DEPRECATED: Prefer PRODUCTION for all use cases, as it no longer enforces
72    // a higher minimum node count than DEVELOPMENT.
73    DEVELOPMENT = 2;
74  }
75
76  // The unique name of the instance. Values are of the form
77  // `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`.
78  string name = 1;
79
80  // Required. The descriptive name for this instance as it appears in UIs.
81  // Can be changed at any time, but should be kept globally unique
82  // to avoid confusion.
83  string display_name = 2 [(google.api.field_behavior) = REQUIRED];
84
85  // (`OutputOnly`)
86  // The current state of the instance.
87  State state = 3;
88
89  // The type of the instance. Defaults to `PRODUCTION`.
90  Type type = 4;
91
92  // Labels are a flexible and lightweight mechanism for organizing cloud
93  // resources into groups that reflect a customer's organizational needs and
94  // deployment strategies. They can be used to filter resources and aggregate
95  // metrics.
96  //
97  // * Label keys must be between 1 and 63 characters long and must conform to
98  //   the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
99  // * Label values must be between 0 and 63 characters long and must conform to
100  //   the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
101  // * No more than 64 labels can be associated with a given resource.
102  // * Keys and values must both be under 128 bytes.
103  map<string, string> labels = 5;
104
105  // Output only. A server-assigned timestamp representing when this Instance
106  // was created. For instances created before this field was added (August
107  // 2021), this value is `seconds: 0, nanos: 1`.
108  google.protobuf.Timestamp create_time = 7
109      [(google.api.field_behavior) = OUTPUT_ONLY];
110
111  // Output only. Reserved for future use.
112  optional bool satisfies_pzs = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
113}
114
115// The Autoscaling targets for a Cluster. These determine the recommended nodes.
116message AutoscalingTargets {
117  // The cpu utilization that the Autoscaler should be trying to achieve.
118  // This number is on a scale from 0 (no utilization) to
119  // 100 (total utilization), and is limited between 10 and 80, otherwise it
120  // will return INVALID_ARGUMENT error.
121  int32 cpu_utilization_percent = 2;
122
123  // The storage utilization that the Autoscaler should be trying to achieve.
124  // This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD
125  // cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster,
126  // otherwise it will return INVALID_ARGUMENT error. If this value is set to 0,
127  // it will be treated as if it were set to the default value: 2560 for SSD,
128  // 8192 for HDD.
129  int32 storage_utilization_gib_per_node = 3;
130}
131
132// Limits for the number of nodes a Cluster can autoscale up/down to.
133message AutoscalingLimits {
134  // Required. Minimum number of nodes to scale down to.
135  int32 min_serve_nodes = 1 [(google.api.field_behavior) = REQUIRED];
136
137  // Required. Maximum number of nodes to scale up to.
138  int32 max_serve_nodes = 2 [(google.api.field_behavior) = REQUIRED];
139}
140
141// A resizable group of nodes in a particular cloud location, capable
142// of serving all [Tables][google.bigtable.admin.v2.Table] in the parent
143// [Instance][google.bigtable.admin.v2.Instance].
144message Cluster {
145  option (google.api.resource) = {
146    type: "bigtableadmin.googleapis.com/Cluster"
147    pattern: "projects/{project}/instances/{instance}/clusters/{cluster}"
148  };
149
150  // Possible states of a cluster.
151  enum State {
152    // The state of the cluster could not be determined.
153    STATE_NOT_KNOWN = 0;
154
155    // The cluster has been successfully created and is ready to serve requests.
156    READY = 1;
157
158    // The cluster is currently being created, and may be destroyed
159    // if the creation process encounters an error.
160    // A cluster may not be able to serve requests while being created.
161    CREATING = 2;
162
163    // The cluster is currently being resized, and may revert to its previous
164    // node count if the process encounters an error.
165    // A cluster is still capable of serving requests while being resized,
166    // but may exhibit performance as if its number of allocated nodes is
167    // between the starting and requested states.
168    RESIZING = 3;
169
170    // The cluster has no backing nodes. The data (tables) still
171    // exist, but no operations can be performed on the cluster.
172    DISABLED = 4;
173  }
174
175  // Autoscaling config for a cluster.
176  message ClusterAutoscalingConfig {
177    // Required. Autoscaling limits for this cluster.
178    AutoscalingLimits autoscaling_limits = 1
179        [(google.api.field_behavior) = REQUIRED];
180
181    // Required. Autoscaling targets for this cluster.
182    AutoscalingTargets autoscaling_targets = 2
183        [(google.api.field_behavior) = REQUIRED];
184  }
185
186  // Configuration for a cluster.
187  message ClusterConfig {
188    // Autoscaling configuration for this cluster.
189    ClusterAutoscalingConfig cluster_autoscaling_config = 1;
190  }
191
192  // Cloud Key Management Service (Cloud KMS) settings for a CMEK-protected
193  // cluster.
194  message EncryptionConfig {
195    // Describes the Cloud KMS encryption key that will be used to protect the
196    // destination Bigtable cluster. The requirements for this key are:
197    //  1) The Cloud Bigtable service account associated with the project that
198    //  contains this cluster must be granted the
199    //  `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
200    //  2) Only regional keys can be used and the region of the CMEK key must
201    //  match the region of the cluster.
202    //  3) All clusters within an instance must use the same CMEK key.
203    // Values are of the form
204    // `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}`
205    string kms_key_name = 1 [(google.api.resource_reference) = {
206      type: "cloudkms.googleapis.com/CryptoKey"
207    }];
208  }
209
210  // The unique name of the cluster. Values are of the form
211  // `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
212  string name = 1;
213
214  // Immutable. The location where this cluster's nodes and storage reside. For
215  // best performance, clients should be located as close as possible to this
216  // cluster. Currently only zones are supported, so values should be of the
217  // form `projects/{project}/locations/{zone}`.
218  string location = 2 [
219    (google.api.field_behavior) = IMMUTABLE,
220    (google.api.resource_reference) = {
221      type: "locations.googleapis.com/Location"
222    }
223  ];
224
225  // Output only. The current state of the cluster.
226  State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
227
228  // The number of nodes allocated to this cluster. More nodes enable higher
229  // throughput and more consistent performance.
230  int32 serve_nodes = 4;
231
232  oneof config {
233    // Configuration for this cluster.
234    ClusterConfig cluster_config = 7;
235  }
236
237  // Immutable. The type of storage used by this cluster to serve its
238  // parent instance's tables, unless explicitly overridden.
239  StorageType default_storage_type = 5
240      [(google.api.field_behavior) = IMMUTABLE];
241
242  // Immutable. The encryption configuration for CMEK-protected clusters.
243  EncryptionConfig encryption_config = 6
244      [(google.api.field_behavior) = IMMUTABLE];
245}
246
247// A configuration object describing how Cloud Bigtable should treat traffic
248// from a particular end user application.
249message AppProfile {
250  option (google.api.resource) = {
251    type: "bigtableadmin.googleapis.com/AppProfile"
252    pattern: "projects/{project}/instances/{instance}/appProfiles/{app_profile}"
253  };
254
255  // Read/write requests are routed to the nearest cluster in the instance, and
256  // will fail over to the nearest cluster that is available in the event of
257  // transient errors or delays. Clusters in a region are considered
258  // equidistant. Choosing this option sacrifices read-your-writes consistency
259  // to improve availability.
260  message MultiClusterRoutingUseAny {
261    // The set of clusters to route to. The order is ignored; clusters will be
262    // tried in order of distance. If left empty, all clusters are eligible.
263    repeated string cluster_ids = 1;
264  }
265
266  // Unconditionally routes all read/write requests to a specific cluster.
267  // This option preserves read-your-writes consistency but does not improve
268  // availability.
269  message SingleClusterRouting {
270    // The cluster to which read/write requests should be routed.
271    string cluster_id = 1;
272
273    // Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are
274    // allowed by this app profile. It is unsafe to send these requests to
275    // the same table/row/column in multiple clusters.
276    bool allow_transactional_writes = 2;
277  }
278
279  // Possible priorities for an app profile. Note that higher priority writes
280  // can sometimes queue behind lower priority writes to the same tablet, as
281  // writes must be strictly sequenced in the durability log.
282  enum Priority {
283    // Default value. Mapped to PRIORITY_HIGH (the legacy behavior) on creation.
284    PRIORITY_UNSPECIFIED = 0;
285
286    PRIORITY_LOW = 1;
287
288    PRIORITY_MEDIUM = 2;
289
290    PRIORITY_HIGH = 3;
291  }
292
293  // Standard options for isolating this app profile's traffic from other use
294  // cases.
295  message StandardIsolation {
296    // The priority of requests sent using this app profile.
297    Priority priority = 1;
298  }
299
300  // Data Boost is a serverless compute capability that lets you run
301  // high-throughput read jobs on your Bigtable data, without impacting the
302  // performance of the clusters that handle your application traffic.
303  // Currently, Data Boost exclusively supports read-only use-cases with
304  // single-cluster routing.
305  //
306  // Data Boost reads are only guaranteed to see the results of writes that
307  // were written at least 30 minutes ago. This means newly written values may
308  // not become visible for up to 30m, and also means that old values may
309  // remain visible for up to 30m after being deleted or overwritten. To
310  // mitigate the staleness of the data, users may either wait 30m, or use
311  // CheckConsistency.
312  message DataBoostIsolationReadOnly {
313    // Compute Billing Owner specifies how usage should be accounted when using
314    // Data Boost. Compute Billing Owner also configures which Cloud Project is
315    // charged for relevant quota.
316    enum ComputeBillingOwner {
317      // Unspecified value.
318      COMPUTE_BILLING_OWNER_UNSPECIFIED = 0;
319
320      // The host Cloud Project containing the targeted Bigtable Instance /
321      // Table pays for compute.
322      HOST_PAYS = 1;
323    }
324
325    // The Compute Billing Owner for this Data Boost App Profile.
326    optional ComputeBillingOwner compute_billing_owner = 1;
327  }
328
329  // The unique name of the app profile. Values are of the form
330  // `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
331  string name = 1;
332
333  // Strongly validated etag for optimistic concurrency control. Preserve the
334  // value returned from `GetAppProfile` when calling `UpdateAppProfile` to
335  // fail the request if there has been a modification in the mean time. The
336  // `update_mask` of the request need not include `etag` for this protection
337  // to apply.
338  // See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
339  // [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
340  // details.
341  string etag = 2;
342
343  // Long form description of the use case for this AppProfile.
344  string description = 3;
345
346  // The routing policy for all read/write requests that use this app profile.
347  // A value must be explicitly set.
348  oneof routing_policy {
349    // Use a multi-cluster routing policy.
350    MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5;
351
352    // Use a single-cluster routing policy.
353    SingleClusterRouting single_cluster_routing = 6;
354  }
355
356  // Options for isolating this app profile's traffic from other use cases.
357  oneof isolation {
358    // This field has been deprecated in favor of `standard_isolation.priority`.
359    // If you set this field, `standard_isolation.priority` will be set instead.
360    //
361    // The priority of requests sent using this app profile.
362    Priority priority = 7 [deprecated = true];
363
364    // The standard options used for isolating this app profile's traffic from
365    // other use cases.
366    StandardIsolation standard_isolation = 11;
367
368    // Specifies that this app profile is intended for read-only usage via the
369    // Data Boost feature.
370    DataBoostIsolationReadOnly data_boost_isolation_read_only = 10;
371  }
372}
373
374// A tablet is a defined by a start and end key and is explained in
375// https://cloud.google.com/bigtable/docs/overview#architecture and
376// https://cloud.google.com/bigtable/docs/performance#optimization.
377// A Hot tablet is a tablet that exhibits high average cpu usage during the time
378// interval from start time to end time.
379message HotTablet {
380  option (google.api.resource) = {
381    type: "bigtableadmin.googleapis.com/HotTablet"
382    pattern: "projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/{hot_tablet}"
383  };
384
385  // The unique name of the hot tablet. Values are of the form
386  // `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`.
387  string name = 1;
388
389  // Name of the table that contains the tablet. Values are of the form
390  // `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
391  string table_name = 2 [(google.api.resource_reference) = {
392    type: "bigtableadmin.googleapis.com/Table"
393  }];
394
395  // Output only. The start time of the hot tablet.
396  google.protobuf.Timestamp start_time = 3
397      [(google.api.field_behavior) = OUTPUT_ONLY];
398
399  // Output only. The end time of the hot tablet.
400  google.protobuf.Timestamp end_time = 4
401      [(google.api.field_behavior) = OUTPUT_ONLY];
402
403  // Tablet Start Key (inclusive).
404  string start_key = 5;
405
406  // Tablet End Key (inclusive).
407  string end_key = 6;
408
409  // Output only. The average CPU usage spent by a node on this tablet over the
410  // start_time to end_time time range. The percentage is the amount of CPU used
411  // by the node to serve the tablet, from 0% (tablet was not interacted with)
412  // to 100% (the node spent all cycles serving the hot tablet).
413  float node_cpu_usage_percent = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
414}
415