instance.proto 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. // Copyright 2022 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. syntax = "proto3";
  15. package google.bigtable.admin.v2;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/bigtable/admin/v2/common.proto";
  19. import "google/protobuf/timestamp.proto";
  20. option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2";
  21. option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "InstanceProto";
  24. option java_package = "com.google.bigtable.admin.v2";
  25. option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2";
  26. option ruby_package = "Google::Cloud::Bigtable::Admin::V2";
  27. option (google.api.resource_definition) = {
  28. type: "cloudkms.googleapis.com/CryptoKey"
  29. pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
  30. };
  31. // A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and
  32. // the resources that serve them.
  33. // All tables in an instance are served from all
  34. // [Clusters][google.bigtable.admin.v2.Cluster] in the instance.
  35. message Instance {
  36. option (google.api.resource) = {
  37. type: "bigtableadmin.googleapis.com/Instance"
  38. pattern: "projects/{project}/instances/{instance}"
  39. };
  40. // Possible states of an instance.
  41. enum State {
  42. // The state of the instance could not be determined.
  43. STATE_NOT_KNOWN = 0;
  44. // The instance has been successfully created and can serve requests
  45. // to its tables.
  46. READY = 1;
  47. // The instance is currently being created, and may be destroyed
  48. // if the creation process encounters an error.
  49. CREATING = 2;
  50. }
  51. // The type of the instance.
  52. enum Type {
  53. // The type of the instance is unspecified. If set when creating an
  54. // instance, a `PRODUCTION` instance will be created. If set when updating
  55. // an instance, the type will be left unchanged.
  56. TYPE_UNSPECIFIED = 0;
  57. // An instance meant for production use. `serve_nodes` must be set
  58. // on the cluster.
  59. PRODUCTION = 1;
  60. // DEPRECATED: Prefer PRODUCTION for all use cases, as it no longer enforces
  61. // a higher minimum node count than DEVELOPMENT.
  62. DEVELOPMENT = 2;
  63. }
  64. // The unique name of the instance. Values are of the form
  65. // `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`.
  66. string name = 1;
  67. // Required. The descriptive name for this instance as it appears in UIs.
  68. // Can be changed at any time, but should be kept globally unique
  69. // to avoid confusion.
  70. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  71. // (`OutputOnly`)
  72. // The current state of the instance.
  73. State state = 3;
  74. // The type of the instance. Defaults to `PRODUCTION`.
  75. Type type = 4;
  76. // Labels are a flexible and lightweight mechanism for organizing cloud
  77. // resources into groups that reflect a customer's organizational needs and
  78. // deployment strategies. They can be used to filter resources and aggregate
  79. // metrics.
  80. //
  81. // * Label keys must be between 1 and 63 characters long and must conform to
  82. // the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
  83. // * Label values must be between 0 and 63 characters long and must conform to
  84. // the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
  85. // * No more than 64 labels can be associated with a given resource.
  86. // * Keys and values must both be under 128 bytes.
  87. map<string, string> labels = 5;
  88. // Output only. A server-assigned timestamp representing when this Instance was created.
  89. // For instances created before this field was added (August 2021), this value
  90. // is `seconds: 0, nanos: 1`.
  91. google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  92. // Output only. Reserved for future use.
  93. optional bool satisfies_pzs = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  94. }
  95. // The Autoscaling targets for a Cluster. These determine the recommended nodes.
  96. message AutoscalingTargets {
  97. // The cpu utilization that the Autoscaler should be trying to achieve.
  98. // This number is on a scale from 0 (no utilization) to
  99. // 100 (total utilization), and is limited between 10 and 80, otherwise it
  100. // will return INVALID_ARGUMENT error.
  101. int32 cpu_utilization_percent = 2;
  102. // The storage utilization that the Autoscaler should be trying to achieve.
  103. // This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD
  104. // cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster;
  105. // otherwise it will return INVALID_ARGUMENT error. If this value is set to 0,
  106. // it will be treated as if it were set to the default value: 2560 for SSD,
  107. // 8192 for HDD.
  108. int32 storage_utilization_gib_per_node = 3;
  109. }
  110. // Limits for the number of nodes a Cluster can autoscale up/down to.
  111. message AutoscalingLimits {
  112. // Required. Minimum number of nodes to scale down to.
  113. int32 min_serve_nodes = 1 [(google.api.field_behavior) = REQUIRED];
  114. // Required. Maximum number of nodes to scale up to.
  115. int32 max_serve_nodes = 2 [(google.api.field_behavior) = REQUIRED];
  116. }
  117. // A resizable group of nodes in a particular cloud location, capable
  118. // of serving all [Tables][google.bigtable.admin.v2.Table] in the parent
  119. // [Instance][google.bigtable.admin.v2.Instance].
  120. message Cluster {
  121. option (google.api.resource) = {
  122. type: "bigtableadmin.googleapis.com/Cluster"
  123. pattern: "projects/{project}/instances/{instance}/clusters/{cluster}"
  124. };
  125. // Possible states of a cluster.
  126. enum State {
  127. // The state of the cluster could not be determined.
  128. STATE_NOT_KNOWN = 0;
  129. // The cluster has been successfully created and is ready to serve requests.
  130. READY = 1;
  131. // The cluster is currently being created, and may be destroyed
  132. // if the creation process encounters an error.
  133. // A cluster may not be able to serve requests while being created.
  134. CREATING = 2;
  135. // The cluster is currently being resized, and may revert to its previous
  136. // node count if the process encounters an error.
  137. // A cluster is still capable of serving requests while being resized,
  138. // but may exhibit performance as if its number of allocated nodes is
  139. // between the starting and requested states.
  140. RESIZING = 3;
  141. // The cluster has no backing nodes. The data (tables) still
  142. // exist, but no operations can be performed on the cluster.
  143. DISABLED = 4;
  144. }
  145. // Autoscaling config for a cluster.
  146. message ClusterAutoscalingConfig {
  147. // Required. Autoscaling limits for this cluster.
  148. AutoscalingLimits autoscaling_limits = 1 [(google.api.field_behavior) = REQUIRED];
  149. // Required. Autoscaling targets for this cluster.
  150. AutoscalingTargets autoscaling_targets = 2 [(google.api.field_behavior) = REQUIRED];
  151. }
  152. // Configuration for a cluster.
  153. message ClusterConfig {
  154. // Autoscaling configuration for this cluster.
  155. ClusterAutoscalingConfig cluster_autoscaling_config = 1;
  156. }
  157. // Cloud Key Management Service (Cloud KMS) settings for a CMEK-protected
  158. // cluster.
  159. message EncryptionConfig {
  160. // Describes the Cloud KMS encryption key that will be used to protect the
  161. // destination Bigtable cluster. The requirements for this key are:
  162. // 1) The Cloud Bigtable service account associated with the project that
  163. // contains this cluster must be granted the
  164. // `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
  165. // 2) Only regional keys can be used and the region of the CMEK key must
  166. // match the region of the cluster.
  167. // 3) All clusters within an instance must use the same CMEK key.
  168. // Values are of the form
  169. // `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}`
  170. string kms_key_name = 1 [(google.api.resource_reference) = {
  171. type: "cloudkms.googleapis.com/CryptoKey"
  172. }];
  173. }
  174. // The unique name of the cluster. Values are of the form
  175. // `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
  176. string name = 1;
  177. // Immutable. The location where this cluster's nodes and storage reside. For best
  178. // performance, clients should be located as close as possible to this
  179. // cluster. Currently only zones are supported, so values should be of the
  180. // form `projects/{project}/locations/{zone}`.
  181. string location = 2 [
  182. (google.api.field_behavior) = IMMUTABLE,
  183. (google.api.resource_reference) = {
  184. type: "locations.googleapis.com/Location"
  185. }
  186. ];
  187. // Output only. The current state of the cluster.
  188. State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  189. // The number of nodes allocated to this cluster. More nodes enable higher
  190. // throughput and more consistent performance.
  191. int32 serve_nodes = 4;
  192. oneof config {
  193. // Configuration for this cluster.
  194. ClusterConfig cluster_config = 7;
  195. }
  196. // Immutable. The type of storage used by this cluster to serve its
  197. // parent instance's tables, unless explicitly overridden.
  198. StorageType default_storage_type = 5 [(google.api.field_behavior) = IMMUTABLE];
  199. // Immutable. The encryption configuration for CMEK-protected clusters.
  200. EncryptionConfig encryption_config = 6 [(google.api.field_behavior) = IMMUTABLE];
  201. }
  202. // A configuration object describing how Cloud Bigtable should treat traffic
  203. // from a particular end user application.
  204. message AppProfile {
  205. option (google.api.resource) = {
  206. type: "bigtableadmin.googleapis.com/AppProfile"
  207. pattern: "projects/{project}/instances/{instance}/appProfiles/{app_profile}"
  208. };
  209. // Read/write requests are routed to the nearest cluster in the instance, and
  210. // will fail over to the nearest cluster that is available in the event of
  211. // transient errors or delays. Clusters in a region are considered
  212. // equidistant. Choosing this option sacrifices read-your-writes consistency
  213. // to improve availability.
  214. message MultiClusterRoutingUseAny {
  215. // The set of clusters to route to. The order is ignored; clusters will be
  216. // tried in order of distance. If left empty, all clusters are eligible.
  217. repeated string cluster_ids = 1;
  218. }
  219. // Unconditionally routes all read/write requests to a specific cluster.
  220. // This option preserves read-your-writes consistency but does not improve
  221. // availability.
  222. message SingleClusterRouting {
  223. // The cluster to which read/write requests should be routed.
  224. string cluster_id = 1;
  225. // Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are
  226. // allowed by this app profile. It is unsafe to send these requests to
  227. // the same table/row/column in multiple clusters.
  228. bool allow_transactional_writes = 2;
  229. }
  230. // The unique name of the app profile. Values are of the form
  231. // `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
  232. string name = 1;
  233. // Strongly validated etag for optimistic concurrency control. Preserve the
  234. // value returned from `GetAppProfile` when calling `UpdateAppProfile` to
  235. // fail the request if there has been a modification in the mean time. The
  236. // `update_mask` of the request need not include `etag` for this protection
  237. // to apply.
  238. // See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
  239. // [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
  240. // details.
  241. string etag = 2;
  242. // Long form description of the use case for this AppProfile.
  243. string description = 3;
  244. // The routing policy for all read/write requests that use this app profile.
  245. // A value must be explicitly set.
  246. oneof routing_policy {
  247. // Use a multi-cluster routing policy.
  248. MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5;
  249. // Use a single-cluster routing policy.
  250. SingleClusterRouting single_cluster_routing = 6;
  251. }
  252. }
  253. // A tablet is a defined by a start and end key and is explained in
  254. // https://cloud.google.com/bigtable/docs/overview#architecture and
  255. // https://cloud.google.com/bigtable/docs/performance#optimization.
  256. // A Hot tablet is a tablet that exhibits high average cpu usage during the time
  257. // interval from start time to end time.
  258. message HotTablet {
  259. option (google.api.resource) = {
  260. type: "bigtableadmin.googleapis.com/HotTablet"
  261. pattern: "projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/{hot_tablet}"
  262. };
  263. // The unique name of the hot tablet. Values are of the form
  264. // `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`.
  265. string name = 1;
  266. // Name of the table that contains the tablet. Values are of the form
  267. // `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
  268. string table_name = 2 [(google.api.resource_reference) = {
  269. type: "bigtableadmin.googleapis.com/Table"
  270. }];
  271. // Output only. The start time of the hot tablet.
  272. google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  273. // Output only. The end time of the hot tablet.
  274. google.protobuf.Timestamp end_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  275. // Tablet Start Key (inclusive).
  276. string start_key = 5;
  277. // Tablet End Key (inclusive).
  278. string end_key = 6;
  279. // Output only. The average CPU usage spent by a node on this tablet over the start_time to
  280. // end_time time range. The percentage is the amount of CPU used by the node
  281. // to serve the tablet, from 0% (tablet was not interacted with) to 100% (the
  282. // node spent all cycles serving the hot tablet).
  283. float node_cpu_usage_percent = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  284. }