instance.proto 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. // Copyright 2021 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. option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2";
  20. option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "InstanceProto";
  23. option java_package = "com.google.bigtable.admin.v2";
  24. option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2";
  25. option ruby_package = "Google::Cloud::Bigtable::Admin::V2";
  26. option (google.api.resource_definition) = {
  27. type: "cloudkms.googleapis.com/CryptoKey"
  28. pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
  29. };
  30. // A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and
  31. // the resources that serve them.
  32. // All tables in an instance are served from all
  33. // [Clusters][google.bigtable.admin.v2.Cluster] in the instance.
  34. message Instance {
  35. option (google.api.resource) = {
  36. type: "bigtable.googleapis.com/Instance"
  37. pattern: "projects/{project}/instances/{instance}"
  38. };
  39. // Possible states of an instance.
  40. enum State {
  41. // The state of the instance could not be determined.
  42. STATE_NOT_KNOWN = 0;
  43. // The instance has been successfully created and can serve requests
  44. // to its tables.
  45. READY = 1;
  46. // The instance is currently being created, and may be destroyed
  47. // if the creation process encounters an error.
  48. CREATING = 2;
  49. }
  50. // The type of the instance.
  51. enum Type {
  52. // The type of the instance is unspecified. If set when creating an
  53. // instance, a `PRODUCTION` instance will be created. If set when updating
  54. // an instance, the type will be left unchanged.
  55. TYPE_UNSPECIFIED = 0;
  56. // An instance meant for production use. `serve_nodes` must be set
  57. // on the cluster.
  58. PRODUCTION = 1;
  59. // The instance is meant for development and testing purposes only; it has
  60. // no performance or uptime guarantees and is not covered by SLA.
  61. // After a development instance is created, it can be upgraded by
  62. // updating the instance to type `PRODUCTION`. An instance created
  63. // as a production instance cannot be changed to a development instance.
  64. // When creating a development instance, `serve_nodes` on the cluster must
  65. // not be set.
  66. DEVELOPMENT = 2;
  67. }
  68. // The unique name of the instance. Values are of the form
  69. // `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`.
  70. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  71. // Required. The descriptive name for this instance as it appears in UIs.
  72. // Can be changed at any time, but should be kept globally unique
  73. // to avoid confusion.
  74. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  75. // (`OutputOnly`)
  76. // The current state of the instance.
  77. State state = 3;
  78. // The type of the instance. Defaults to `PRODUCTION`.
  79. Type type = 4;
  80. // Labels are a flexible and lightweight mechanism for organizing cloud
  81. // resources into groups that reflect a customer's organizational needs and
  82. // deployment strategies. They can be used to filter resources and aggregate
  83. // metrics.
  84. //
  85. // * Label keys must be between 1 and 63 characters long and must conform to
  86. // the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`.
  87. // * Label values must be between 0 and 63 characters long and must conform to
  88. // the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`.
  89. // * No more than 64 labels can be associated with a given resource.
  90. // * Keys and values must both be under 128 bytes.
  91. map<string, string> labels = 5;
  92. }
  93. // A resizable group of nodes in a particular cloud location, capable
  94. // of serving all [Tables][google.bigtable.admin.v2.Table] in the parent
  95. // [Instance][google.bigtable.admin.v2.Instance].
  96. message Cluster {
  97. option (google.api.resource) = {
  98. type: "bigtable.googleapis.com/Cluster"
  99. pattern: "projects/{project}/instances/{instance}/clusters/{cluster}"
  100. };
  101. // Cloud Key Management Service (Cloud KMS) settings for a CMEK-protected
  102. // cluster.
  103. message EncryptionConfig {
  104. // Describes the Cloud KMS encryption key that will be used to protect the
  105. // destination Bigtable cluster. The requirements for this key are:
  106. // 1) The Cloud Bigtable service account associated with the project that
  107. // contains this cluster must be granted the
  108. // `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
  109. // 2) Only regional keys can be used and the region of the CMEK key must
  110. // match the region of the cluster.
  111. // 3) All clusters within an instance must use the same CMEK key.
  112. string kms_key_name = 1 [(google.api.resource_reference) = {
  113. type: "cloudkms.googleapis.com/CryptoKey"
  114. }];
  115. }
  116. // Possible states of a cluster.
  117. enum State {
  118. // The state of the cluster could not be determined.
  119. STATE_NOT_KNOWN = 0;
  120. // The cluster has been successfully created and is ready to serve requests.
  121. READY = 1;
  122. // The cluster is currently being created, and may be destroyed
  123. // if the creation process encounters an error.
  124. // A cluster may not be able to serve requests while being created.
  125. CREATING = 2;
  126. // The cluster is currently being resized, and may revert to its previous
  127. // node count if the process encounters an error.
  128. // A cluster is still capable of serving requests while being resized,
  129. // but may exhibit performance as if its number of allocated nodes is
  130. // between the starting and requested states.
  131. RESIZING = 3;
  132. // The cluster has no backing nodes. The data (tables) still
  133. // exist, but no operations can be performed on the cluster.
  134. DISABLED = 4;
  135. }
  136. // The unique name of the cluster. Values are of the form
  137. // `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
  138. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  139. // (`CreationOnly`)
  140. // The location where this cluster's nodes and storage reside. For best
  141. // performance, clients should be located as close as possible to this
  142. // cluster. Currently only zones are supported, so values should be of the
  143. // form `projects/{project}/locations/{zone}`.
  144. string location = 2 [(google.api.resource_reference) = {
  145. type: "locations.googleapis.com/Location"
  146. }];
  147. // The current state of the cluster.
  148. State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  149. // Required. The number of nodes allocated to this cluster. More nodes enable
  150. // higher throughput and more consistent performance.
  151. int32 serve_nodes = 4 [(google.api.field_behavior) = REQUIRED];
  152. // (`CreationOnly`)
  153. // The type of storage used by this cluster to serve its
  154. // parent instance's tables, unless explicitly overridden.
  155. StorageType default_storage_type = 5;
  156. // Immutable. The encryption configuration for CMEK-protected clusters.
  157. EncryptionConfig encryption_config = 6
  158. [(google.api.field_behavior) = IMMUTABLE];
  159. }
  160. // A configuration object describing how Cloud Bigtable should treat traffic
  161. // from a particular end user application.
  162. message AppProfile {
  163. option (google.api.resource) = {
  164. type: "bigtable.googleapis.com/AppProfile"
  165. pattern: "projects/{project}/instances/{instance}/appProfiles/{app_profile}"
  166. };
  167. // Read/write requests are routed to the nearest cluster in the instance, and
  168. // will fail over to the nearest cluster that is available in the event of
  169. // transient errors or delays. Clusters in a region are considered
  170. // equidistant. Choosing this option sacrifices read-your-writes consistency
  171. // to improve availability.
  172. message MultiClusterRoutingUseAny {}
  173. // Unconditionally routes all read/write requests to a specific cluster.
  174. // This option preserves read-your-writes consistency but does not improve
  175. // availability.
  176. message SingleClusterRouting {
  177. // The cluster to which read/write requests should be routed.
  178. string cluster_id = 1;
  179. // Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are
  180. // allowed by this app profile. It is unsafe to send these requests to
  181. // the same table/row/column in multiple clusters.
  182. bool allow_transactional_writes = 2;
  183. }
  184. // (`OutputOnly`)
  185. // The unique name of the app profile. Values are of the form
  186. // `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
  187. string name = 1;
  188. // Strongly validated etag for optimistic concurrency control. Preserve the
  189. // value returned from `GetAppProfile` when calling `UpdateAppProfile` to
  190. // fail the request if there has been a modification in the mean time. The
  191. // `update_mask` of the request need not include `etag` for this protection
  192. // to apply.
  193. // See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
  194. // [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
  195. // details.
  196. string etag = 2;
  197. // Optional long form description of the use case for this AppProfile.
  198. string description = 3;
  199. // The routing policy for all read/write requests that use this app profile.
  200. // A value must be explicitly set.
  201. oneof routing_policy {
  202. // Use a multi-cluster routing policy.
  203. MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5;
  204. // Use a single-cluster routing policy.
  205. SingleClusterRouting single_cluster_routing = 6;
  206. }
  207. }