resources.proto 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  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.cloud.edgecontainer.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/timestamp.proto";
  19. import "google/rpc/status.proto";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/edgecontainer/v1;edgecontainer";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "ResourcesProto";
  23. option java_package = "com.google.cloud.edgecontainer.v1";
  24. option (google.api.resource_definition) = {
  25. type: "cloudkms.googleapis.com/CryptoKey"
  26. pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
  27. };
  28. option (google.api.resource_definition) = {
  29. type: "cloudkms.googleapis.com/CryptoKeyVersion"
  30. pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}"
  31. };
  32. // Represents the accessibility state of a customer-managed KMS key used for
  33. // CMEK integration.
  34. enum KmsKeyState {
  35. // Unspecified.
  36. KMS_KEY_STATE_UNSPECIFIED = 0;
  37. // The key is available for use, and dependent resources should be accessible.
  38. KMS_KEY_STATE_KEY_AVAILABLE = 1;
  39. // The key is unavailable for an unspecified reason. Dependent resources may
  40. // be inaccessible.
  41. KMS_KEY_STATE_KEY_UNAVAILABLE = 2;
  42. }
  43. // A Google Distributed Cloud Edge Kubernetes cluster.
  44. message Cluster {
  45. option (google.api.resource) = {
  46. type: "edgecontainer.googleapis.com/Cluster"
  47. pattern: "projects/{project}/locations/{location}/clusters/{cluster}"
  48. };
  49. // Required. The resource name of the cluster.
  50. string name = 1 [
  51. (google.api.field_behavior) = REQUIRED,
  52. (google.api.resource_reference) = {
  53. type: "edgecontainer.googleapis.com/Cluster"
  54. }
  55. ];
  56. // Output only. The time when the cluster was created.
  57. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  58. // Output only. The time when the cluster was last updated.
  59. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  60. // Labels associated with this resource.
  61. map<string, string> labels = 4;
  62. // Optional. Fleet configuration.
  63. Fleet fleet = 11 [(google.api.field_behavior) = OPTIONAL];
  64. // Required. Cluster-wide networking configuration.
  65. ClusterNetworking networking = 7 [(google.api.field_behavior) = REQUIRED];
  66. // Required. Immutable. RBAC policy that will be applied and managed by GEC.
  67. Authorization authorization = 9 [
  68. (google.api.field_behavior) = REQUIRED,
  69. (google.api.field_behavior) = IMMUTABLE
  70. ];
  71. // Optional. The default maximum number of pods per node used if a maximum value is not
  72. // specified explicitly for a node pool in this cluster. If unspecified, the
  73. // Kubernetes default value will be used.
  74. int32 default_max_pods_per_node = 8 [(google.api.field_behavior) = OPTIONAL];
  75. // Output only. The IP address of the Kubernetes API server.
  76. string endpoint = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  77. // Output only. The PEM-encoded public certificate of the cluster's CA.
  78. string cluster_ca_certificate = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  79. // Optional. Cluster-wide maintenance policy configuration.
  80. MaintenancePolicy maintenance_policy = 12 [(google.api.field_behavior) = OPTIONAL];
  81. }
  82. // Cluster-wide networking configuration.
  83. message ClusterNetworking {
  84. // Required. All pods in the cluster are assigned an RFC1918 IPv4 address from these
  85. // blocks. Only a single block is supported. This field cannot be changed
  86. // after creation.
  87. repeated string cluster_ipv4_cidr_blocks = 1 [(google.api.field_behavior) = REQUIRED];
  88. // Required. All services in the cluster are assigned an RFC1918 IPv4 address from these
  89. // blocks. Only a single block is supported. This field cannot be changed
  90. // after creation.
  91. repeated string services_ipv4_cidr_blocks = 2 [(google.api.field_behavior) = REQUIRED];
  92. }
  93. // Fleet related configuration.
  94. //
  95. // Fleets are a Google Cloud concept for logically organizing clusters,
  96. // letting you use and manage multi-cluster capabilities and apply
  97. // consistent policies across your systems.
  98. message Fleet {
  99. // Required. The name of the Fleet host project where this cluster will be registered.
  100. //
  101. // Project names are formatted as
  102. // `projects/<project-number>`.
  103. string project = 1 [(google.api.field_behavior) = REQUIRED];
  104. // Output only. The name of the managed Hub Membership resource associated to this cluster.
  105. //
  106. // Membership names are formatted as
  107. // `projects/<project-number>/locations/global/membership/<cluster-id>`.
  108. string membership = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  109. }
  110. // A user principal for an RBAC policy.
  111. message ClusterUser {
  112. // Required. An active Google username.
  113. string username = 1 [(google.api.field_behavior) = REQUIRED];
  114. }
  115. // RBAC policy that will be applied and managed by GEC.
  116. message Authorization {
  117. // Required. User that will be granted the cluster-admin role on the cluster, providing
  118. // full access to the cluster. Currently, this is a singular field, but will
  119. // be expanded to allow multiple admins in the future.
  120. ClusterUser admin_users = 1 [(google.api.field_behavior) = REQUIRED];
  121. }
  122. // A set of Kubernetes nodes in a cluster with common configuration and
  123. // specification.
  124. message NodePool {
  125. option (google.api.resource) = {
  126. type: "edgecontainer.googleapis.com/NodePool"
  127. pattern: "projects/{project}/locations/{location}/clusters/{cluster}/nodePools/{node_pool}"
  128. };
  129. // Configuration for CMEK support for edge machine local disk encryption.
  130. message LocalDiskEncryption {
  131. // Immutable. The Cloud KMS CryptoKey e.g.
  132. // projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}
  133. // to use for protecting node local disks. If not specified, a
  134. // Google-managed key will be used instead.
  135. string kms_key = 1 [
  136. (google.api.field_behavior) = IMMUTABLE,
  137. (google.api.resource_reference) = {
  138. type: "cloudkms.googleapis.com/CryptoKey"
  139. }
  140. ];
  141. // Output only. The Cloud KMS CryptoKeyVersion currently in use for protecting node local
  142. // disks. Only applicable if kms_key is set.
  143. string kms_key_active_version = 2 [
  144. (google.api.field_behavior) = OUTPUT_ONLY,
  145. (google.api.resource_reference) = {
  146. type: "cloudkms.googleapis.com/CryptoKeyVersion"
  147. }
  148. ];
  149. // Output only. Availability of the Cloud KMS CryptoKey. If not `KEY_AVAILABLE`, then
  150. // nodes may go offline as they cannot access their local data. This can be
  151. // caused by a lack of permissions to use the key, or if the key is disabled
  152. // or deleted.
  153. KmsKeyState kms_key_state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  154. // Output only. Error status returned by Cloud KMS when using this key. This field may be
  155. // populated only if `kms_key_state` is not `KMS_KEY_STATE_KEY_AVAILABLE`.
  156. // If populated, this field contains the error status reported by Cloud KMS.
  157. google.rpc.Status kms_status = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  158. }
  159. // Required. The resource name of the node pool.
  160. string name = 1 [
  161. (google.api.field_behavior) = REQUIRED,
  162. (google.api.resource_reference) = {
  163. type: "edgecontainer.googleapis.com/NodePool"
  164. }
  165. ];
  166. // Output only. The time when the node pool was created.
  167. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  168. // Output only. The time when the node pool was last updated.
  169. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  170. // Labels associated with this resource.
  171. map<string, string> labels = 4;
  172. // Name of the Google Distributed Cloud Edge zone where this node pool will be
  173. // created. For example: `us-central1-edge-customer-a`.
  174. string node_location = 8;
  175. // Required. The number of nodes in the pool.
  176. int32 node_count = 6 [(google.api.field_behavior) = REQUIRED];
  177. // Only machines matching this filter will be allowed to join the node pool.
  178. // The filtering language accepts strings like "name=<name>", and is
  179. // documented in more detail in [AIP-160](https://google.aip.dev/160).
  180. string machine_filter = 7;
  181. // Optional. Local disk encryption options. This field is only used when enabling CMEK
  182. // support.
  183. LocalDiskEncryption local_disk_encryption = 9 [(google.api.field_behavior) = OPTIONAL];
  184. }
  185. // A Google Distributed Cloud Edge machine capable of acting as a Kubernetes
  186. // node.
  187. message Machine {
  188. option (google.api.resource) = {
  189. type: "edgecontainer.googleapis.com/Machine"
  190. pattern: "projects/{project}/locations/{location}/machines/{machine}"
  191. };
  192. // Required. The resource name of the machine.
  193. string name = 1 [
  194. (google.api.field_behavior) = REQUIRED,
  195. (google.api.resource_reference) = {
  196. type: "edgecontainer.googleapis.com/Machine"
  197. }
  198. ];
  199. // Output only. The time when the node pool was created.
  200. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  201. // Output only. The time when the node pool was last updated.
  202. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  203. // Labels associated with this resource.
  204. map<string, string> labels = 4;
  205. // Canonical resource name of the node that this machine is responsible for
  206. // hosting e.g.
  207. // projects/{project}/locations/{location}/clusters/{cluster_id}/nodePools/{pool_id}/{node},
  208. // Or empty if the machine is not assigned to assume the role of a node.
  209. string hosted_node = 5;
  210. // The Google Distributed Cloud Edge zone of this machine.
  211. string zone = 6;
  212. // Output only. Whether the machine is disabled. If disabled, the machine is unable to
  213. // enter service.
  214. bool disabled = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  215. }
  216. // A VPN connection .
  217. message VpnConnection {
  218. option (google.api.resource) = {
  219. type: "edgecontainer.googleapis.com/VpnConnection"
  220. pattern: "projects/{project}/locations/{location}/vpnConnections/{vpn_connection}"
  221. };
  222. // Project detail of the VPC network.
  223. message VpcProject {
  224. // The project of the VPC to connect to. If not specified, it is the same as
  225. // the cluster project.
  226. string project_id = 1;
  227. // Optional. The service account in the VPC project configured by user. It is used to
  228. // create/delete Cloud Router and Cloud HA VPNs for VPN connection. If this
  229. // SA is changed during/after a VPN connection is created, you need to
  230. // remove the Cloud Router and Cloud VPN resources in |project_id|.
  231. // It is in the form of
  232. // service-{project_number}@gcp-sa-edgecontainer.iam.gserviceaccount.com.
  233. string service_account = 2 [(google.api.field_behavior) = OPTIONAL];
  234. }
  235. // The created connection details.
  236. message Details {
  237. // The Cloud Router info.
  238. message CloudRouter {
  239. // The created Cloud Router name.
  240. string name = 1;
  241. }
  242. // The Cloud VPN info.
  243. message CloudVpn {
  244. // The created Cloud VPN gateway name.
  245. string gateway = 1;
  246. }
  247. // The current connection state.
  248. enum State {
  249. // Unknown.
  250. STATE_UNSPECIFIED = 0;
  251. // Connected.
  252. STATE_CONNECTED = 1;
  253. // Still connecting.
  254. STATE_CONNECTING = 2;
  255. // Error occurred.
  256. STATE_ERROR = 3;
  257. }
  258. // The state of this connection.
  259. State state = 1;
  260. // The error message. This is only populated when state=ERROR.
  261. string error = 2;
  262. // The Cloud Router info.
  263. CloudRouter cloud_router = 3;
  264. // Each connection has multiple Cloud VPN gateways.
  265. repeated CloudVpn cloud_vpns = 4;
  266. }
  267. // Routing mode.
  268. enum BgpRoutingMode {
  269. // Unknown.
  270. BGP_ROUTING_MODE_UNSPECIFIED = 0;
  271. // Regional mode.
  272. REGIONAL = 1;
  273. // Global mode.
  274. GLOBAL = 2;
  275. }
  276. // Required. The resource name of VPN connection
  277. string name = 1 [
  278. (google.api.field_behavior) = REQUIRED,
  279. (google.api.resource_reference) = {
  280. type: "edgecontainer.googleapis.com/VpnConnection"
  281. }
  282. ];
  283. // Output only. The time when the VPN connection was created.
  284. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  285. // Output only. The time when the VPN connection was last updated.
  286. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  287. // Labels associated with this resource.
  288. map<string, string> labels = 4;
  289. // NAT gateway IP, or WAN IP address. If a customer has multiple NAT IPs, the
  290. // customer needs to configure NAT such that only one external IP maps to the
  291. // GMEC Anthos cluster. This is empty if NAT is not used.
  292. string nat_gateway_ip = 5;
  293. // Dynamic routing mode of the VPC network, `regional` or `global`.
  294. BgpRoutingMode bgp_routing_mode = 6 [deprecated = true];
  295. // The canonical Cluster name to connect to. It is in the form of
  296. // projects/{project}/locations/{location}/clusters/{cluster}.
  297. string cluster = 7 [(google.api.resource_reference) = {
  298. type: "edgecontainer.googleapis.com/Cluster"
  299. }];
  300. // The network ID of VPC to connect to.
  301. string vpc = 8;
  302. // Optional. Project detail of the VPC network. Required if VPC is in a different
  303. // project than the cluster project.
  304. VpcProject vpc_project = 11 [(google.api.field_behavior) = OPTIONAL];
  305. // Whether this VPN connection has HA enabled on cluster side. If enabled,
  306. // when creating VPN connection we will attempt to use 2 ANG floating IPs.
  307. bool enable_high_availability = 9;
  308. // Output only. The created connection details.
  309. Details details = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  310. }
  311. // Metadata for a given [google.cloud.location.Location][google.cloud.location.Location].
  312. message LocationMetadata {
  313. // The set of available Google Distributed Cloud Edge zones in the location.
  314. // The map is keyed by the lowercase ID of each zone.
  315. map<string, ZoneMetadata> available_zones = 1;
  316. }
  317. // A Google Distributed Cloud Edge zone where edge machines are located.
  318. message ZoneMetadata {
  319. // Quota for resources in this zone.
  320. repeated Quota quota = 1;
  321. }
  322. // Represents quota for Edge Container resources.
  323. message Quota {
  324. // Name of the quota metric.
  325. string metric = 1;
  326. // Quota limit for this metric.
  327. double limit = 2;
  328. // Current usage of this metric.
  329. double usage = 3;
  330. }
  331. // Maintenance policy configuration.
  332. message MaintenancePolicy {
  333. // Specifies the maintenance window in which maintenance may be performed.
  334. MaintenanceWindow window = 1;
  335. }
  336. // Maintenance window configuration
  337. message MaintenanceWindow {
  338. // Configuration of a recurring maintenance window.
  339. RecurringTimeWindow recurring_window = 1;
  340. }
  341. // Represents an arbitrary window of time that recurs.
  342. message RecurringTimeWindow {
  343. // The window of the first recurrence.
  344. TimeWindow window = 1;
  345. // An RRULE (https://tools.ietf.org/html/rfc5545#section-3.8.5.3) for how
  346. // this window recurs. They go on for the span of time between the start and
  347. // end time.
  348. string recurrence = 2;
  349. }
  350. // Represents an arbitrary window of time.
  351. message TimeWindow {
  352. // The time that the window first starts.
  353. google.protobuf.Timestamp start_time = 1;
  354. // The time that the window ends. The end time must take place after the
  355. // start time.
  356. google.protobuf.Timestamp end_time = 2;
  357. }