membership.proto 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881
  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.gkehub.v1beta1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/longrunning/operations.proto";
  21. import "google/protobuf/field_mask.proto";
  22. import "google/protobuf/timestamp.proto";
  23. import "google/rpc/status.proto";
  24. option csharp_namespace = "Google.Cloud.GkeHub.V1Beta1";
  25. option go_package = "google.golang.org/genproto/googleapis/cloud/gkehub/v1beta1;gkehub";
  26. option java_multiple_files = true;
  27. option java_package = "com.google.cloud.gkehub.v1beta1";
  28. option php_namespace = "Google\\Cloud\\GkeHub\\V1beta1";
  29. option ruby_package = "Google::Cloud::GkeHub::V1beta1";
  30. // The GKE Hub MembershipService handles the registration of many Kubernetes
  31. // clusters to Google Cloud, represented with the [Membership][google.cloud.gkehub.v1beta1.Membership] resource.
  32. //
  33. // GKE Hub is currently only available in the global region.
  34. //
  35. // **Membership management may be non-trivial:** it is recommended to use one
  36. // of the Google-provided client libraries or tools where possible when working
  37. // with Membership resources.
  38. service GkeHubMembershipService {
  39. option (google.api.default_host) = "gkehub.googleapis.com";
  40. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  41. // Lists Memberships in a given project and location.
  42. rpc ListMemberships(ListMembershipsRequest) returns (ListMembershipsResponse) {
  43. option (google.api.http) = {
  44. get: "/v1beta1/{parent=projects/*/locations/*}/memberships"
  45. };
  46. option (google.api.method_signature) = "parent";
  47. }
  48. // Gets the details of a Membership.
  49. rpc GetMembership(GetMembershipRequest) returns (Membership) {
  50. option (google.api.http) = {
  51. get: "/v1beta1/{name=projects/*/locations/*/memberships/*}"
  52. };
  53. option (google.api.method_signature) = "name";
  54. }
  55. // Creates a new Membership.
  56. //
  57. // **This is currently only supported for GKE clusters on Google Cloud**.
  58. // To register other clusters, follow the instructions at
  59. // https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster.
  60. rpc CreateMembership(CreateMembershipRequest) returns (google.longrunning.Operation) {
  61. option (google.api.http) = {
  62. post: "/v1beta1/{parent=projects/*/locations/*}/memberships"
  63. body: "resource"
  64. };
  65. option (google.api.method_signature) = "parent,resource,membership_id";
  66. option (google.longrunning.operation_info) = {
  67. response_type: "Membership"
  68. metadata_type: "OperationMetadata"
  69. };
  70. }
  71. // Removes a Membership.
  72. //
  73. // **This is currently only supported for GKE clusters on Google Cloud**.
  74. // To unregister other clusters, follow the instructions at
  75. // https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster.
  76. rpc DeleteMembership(DeleteMembershipRequest) returns (google.longrunning.Operation) {
  77. option (google.api.http) = {
  78. delete: "/v1beta1/{name=projects/*/locations/*/memberships/*}"
  79. };
  80. option (google.api.method_signature) = "name";
  81. option (google.longrunning.operation_info) = {
  82. response_type: "google.protobuf.Empty"
  83. metadata_type: "OperationMetadata"
  84. };
  85. }
  86. // Updates an existing Membership.
  87. rpc UpdateMembership(UpdateMembershipRequest) returns (google.longrunning.Operation) {
  88. option (google.api.http) = {
  89. patch: "/v1beta1/{name=projects/*/locations/*/memberships/*}"
  90. body: "resource"
  91. };
  92. option (google.api.method_signature) = "name,resource,update_mask";
  93. option (google.longrunning.operation_info) = {
  94. response_type: "Membership"
  95. metadata_type: "OperationMetadata"
  96. };
  97. }
  98. // Generates the manifest for deployment of the GKE connect agent.
  99. //
  100. // **This method is used internally by Google-provided libraries.**
  101. // Most clients should not need to call this method directly.
  102. rpc GenerateConnectManifest(GenerateConnectManifestRequest) returns (GenerateConnectManifestResponse) {
  103. option (google.api.http) = {
  104. get: "/v1beta1/{name=projects/*/locations/*/memberships/*}:generateConnectManifest"
  105. };
  106. }
  107. // ValidateExclusivity validates the state of exclusivity in the cluster.
  108. // The validation does not depend on an existing Hub membership resource.
  109. rpc ValidateExclusivity(ValidateExclusivityRequest) returns (ValidateExclusivityResponse) {
  110. option (google.api.http) = {
  111. get: "/v1beta1/{parent=projects/*/locations/*}/memberships:validateExclusivity"
  112. };
  113. }
  114. // GenerateExclusivityManifest generates the manifests to update the
  115. // exclusivity artifacts in the cluster if needed.
  116. //
  117. // Exclusivity artifacts include the Membership custom resource definition
  118. // (CRD) and the singleton Membership custom resource (CR). Combined with
  119. // ValidateExclusivity, exclusivity artifacts guarantee that a Kubernetes
  120. // cluster is only registered to a single GKE Hub.
  121. //
  122. // The Membership CRD is versioned, and may require conversion when the GKE
  123. // Hub API server begins serving a newer version of the CRD and
  124. // corresponding CR. The response will be the converted CRD and CR if there
  125. // are any differences between the versions.
  126. rpc GenerateExclusivityManifest(GenerateExclusivityManifestRequest) returns (GenerateExclusivityManifestResponse) {
  127. option (google.api.http) = {
  128. get: "/v1beta1/{name=projects/*/locations/*/memberships/*}:generateExclusivityManifest"
  129. };
  130. }
  131. }
  132. // Membership contains information about a member cluster.
  133. message Membership {
  134. option (google.api.resource) = {
  135. type: "gkehub.googleapis.com/Membership"
  136. pattern: "projects/{project}/locations/{location}/memberships/{membership}"
  137. };
  138. // Specifies the infrastructure type of a Membership. Infrastructure type is
  139. // used by Hub to control infrastructure-specific behavior, including pricing.
  140. //
  141. // Each GKE distribution (on-GCP, on-Prem, on-X,...) will set this field
  142. // automatically, but Attached Clusters customers should specify a type
  143. // during registration.
  144. enum InfrastructureType {
  145. // No type was specified. Some Hub functionality may require a type be
  146. // specified, and will not support Memberships with this value.
  147. INFRASTRUCTURE_TYPE_UNSPECIFIED = 0;
  148. // Private infrastructure that is owned or operated by customer. This
  149. // includes GKE distributions such as GKE-OnPrem and GKE-OnBareMetal.
  150. ON_PREM = 1;
  151. // Public cloud infrastructure.
  152. MULTI_CLOUD = 2;
  153. }
  154. // Output only. The full, unique name of this Membership resource in the format
  155. // `projects/*/locations/*/memberships/{membership_id}`, set during creation.
  156. //
  157. // `membership_id` must be a valid RFC 1123 compliant DNS label:
  158. //
  159. // 1. At most 63 characters in length
  160. // 2. It must consist of lower case alphanumeric characters or `-`
  161. // 3. It must start and end with an alphanumeric character
  162. //
  163. // Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`,
  164. // with a maximum length of 63 characters.
  165. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  166. // Optional. GCP labels for this membership.
  167. map<string, string> labels = 2 [(google.api.field_behavior) = OPTIONAL];
  168. // Optional. Description of this membership, limited to 63 characters.
  169. // Must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.\ ]*`
  170. string description = 3 [(google.api.field_behavior) = OPTIONAL];
  171. // Type of resource represented by this Membership
  172. oneof type {
  173. // Optional. Endpoint information to reach this member.
  174. MembershipEndpoint endpoint = 4 [(google.api.field_behavior) = OPTIONAL];
  175. }
  176. // Output only. State of the Membership resource.
  177. MembershipState state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  178. // Optional. How to identify workloads from this Membership.
  179. // See the documentation on Workload Identity for more details:
  180. // https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
  181. Authority authority = 9 [(google.api.field_behavior) = OPTIONAL];
  182. // Output only. When the Membership was created.
  183. google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  184. // Output only. When the Membership was last updated.
  185. google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  186. // Output only. When the Membership was deleted.
  187. google.protobuf.Timestamp delete_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  188. // Optional. An externally-generated and managed ID for this Membership. This ID may
  189. // be modified after creation, but this is not recommended. For GKE clusters,
  190. // external_id is managed by the Hub API and updates will be ignored.
  191. //
  192. // The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
  193. //
  194. // If this Membership represents a Kubernetes cluster, this value should be
  195. // set to the UID of the `kube-system` namespace object.
  196. string external_id = 10 [(google.api.field_behavior) = OPTIONAL];
  197. // Output only. For clusters using Connect, the timestamp of the most recent connection
  198. // established with Google Cloud. This time is updated every several minutes,
  199. // not continuously. For clusters that do not use GKE Connect, or that have
  200. // never connected successfully, this field will be unset.
  201. google.protobuf.Timestamp last_connection_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
  202. // Output only. Google-generated UUID for this resource. This is unique across all
  203. // Membership resources. If a Membership resource is deleted and another
  204. // resource with the same name is created, it gets a different unique_id.
  205. string unique_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  206. // Optional. The infrastructure type this Membership is running on.
  207. InfrastructureType infrastructure_type = 13 [(google.api.field_behavior) = OPTIONAL];
  208. }
  209. // MembershipEndpoint contains information needed to contact a Kubernetes API,
  210. // endpoint and any additional Kubernetes metadata.
  211. message MembershipEndpoint {
  212. // Cluster information of the registered cluster.
  213. oneof type {
  214. // Optional. Specific information for a GKE-on-GCP cluster.
  215. GkeCluster gke_cluster = 4 [(google.api.field_behavior) = OPTIONAL];
  216. // Optional. Specific information for a GKE On-Prem cluster. An onprem user-cluster
  217. // who has no resourceLink is not allowed to use this field, it should have
  218. // a nil "type" instead.
  219. OnPremCluster on_prem_cluster = 7 [(google.api.field_behavior) = OPTIONAL];
  220. // Optional. Specific information for a GKE Multi-Cloud cluster.
  221. MultiCloudCluster multi_cloud_cluster = 8 [(google.api.field_behavior) = OPTIONAL];
  222. // Optional. Specific information for a Google Edge cluster.
  223. EdgeCluster edge_cluster = 9 [(google.api.field_behavior) = OPTIONAL];
  224. // Optional. Specific information for a GDC Edge Appliance cluster.
  225. ApplianceCluster appliance_cluster = 10 [(google.api.field_behavior) = OPTIONAL];
  226. }
  227. // Output only. Useful Kubernetes-specific metadata.
  228. KubernetesMetadata kubernetes_metadata = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  229. // Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
  230. // registered cluster, in the steady state. These resources:
  231. //
  232. // * Ensure that the cluster is exclusively registered to one and only one
  233. // Hub Membership.
  234. // * Propagate Workload Pool Information available in the Membership
  235. // Authority field.
  236. // * Ensure proper initial configuration of default Hub Features.
  237. KubernetesResource kubernetes_resource = 6 [(google.api.field_behavior) = OPTIONAL];
  238. }
  239. // KubernetesResource contains the YAML manifests and configuration for
  240. // Membership Kubernetes resources in the cluster. After CreateMembership or
  241. // UpdateMembership, these resources should be re-applied in the cluster.
  242. message KubernetesResource {
  243. // Input only. The YAML representation of the Membership CR. This field is ignored for GKE
  244. // clusters where Hub can read the CR directly.
  245. //
  246. // Callers should provide the CR that is currently present in the cluster
  247. // during CreateMembership or UpdateMembership, or leave this field empty if
  248. // none exists. The CR manifest is used to validate the cluster has not been
  249. // registered with another Membership.
  250. string membership_cr_manifest = 1 [(google.api.field_behavior) = INPUT_ONLY];
  251. // Output only. Additional Kubernetes resources that need to be applied to the cluster
  252. // after Membership creation, and after every update.
  253. //
  254. // This field is only populated in the Membership returned from a successful
  255. // long-running operation from CreateMembership or UpdateMembership. It is not
  256. // populated during normal GetMembership or ListMemberships requests. To get
  257. // the resource manifest after the initial registration, the caller should
  258. // make a UpdateMembership call with an empty field mask.
  259. repeated ResourceManifest membership_resources = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  260. // Output only. The Kubernetes resources for installing the GKE Connect agent
  261. //
  262. // This field is only populated in the Membership returned from a successful
  263. // long-running operation from CreateMembership or UpdateMembership. It is not
  264. // populated during normal GetMembership or ListMemberships requests. To get
  265. // the resource manifest after the initial registration, the caller should
  266. // make a UpdateMembership call with an empty field mask.
  267. repeated ResourceManifest connect_resources = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  268. // Optional. Options for Kubernetes resource generation.
  269. ResourceOptions resource_options = 4 [(google.api.field_behavior) = OPTIONAL];
  270. }
  271. // ResourceOptions represent options for Kubernetes resource generation.
  272. message ResourceOptions {
  273. // Optional. The Connect agent version to use for connect_resources. Defaults to the
  274. // latest GKE Connect version. The version must be a currently supported
  275. // version, obsolete versions will be rejected.
  276. string connect_version = 1 [(google.api.field_behavior) = OPTIONAL];
  277. // Optional. Use `apiextensions/v1beta1` instead of `apiextensions/v1` for
  278. // CustomResourceDefinition resources.
  279. // This option should be set for clusters with Kubernetes apiserver versions
  280. // <1.16.
  281. bool v1beta1_crd = 2 [(google.api.field_behavior) = OPTIONAL];
  282. // Optional. Major version of the Kubernetes cluster. This is only used to determine
  283. // which version to use for the CustomResourceDefinition resources,
  284. // `apiextensions/v1beta1` or`apiextensions/v1`.
  285. string k8s_version = 3 [(google.api.field_behavior) = OPTIONAL];
  286. }
  287. // ResourceManifest represents a single Kubernetes resource to be applied to
  288. // the cluster.
  289. message ResourceManifest {
  290. // YAML manifest of the resource.
  291. string manifest = 1;
  292. // Whether the resource provided in the manifest is `cluster_scoped`.
  293. // If unset, the manifest is assumed to be namespace scoped.
  294. //
  295. // This field is used for REST mapping when applying the resource in a
  296. // cluster.
  297. bool cluster_scoped = 2;
  298. }
  299. // GkeCluster contains information specific to GKE clusters.
  300. message GkeCluster {
  301. // Immutable. Self-link of the GCP resource for the GKE cluster. For example:
  302. //
  303. // //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
  304. //
  305. // Zonal clusters are also supported.
  306. string resource_link = 1 [(google.api.field_behavior) = IMMUTABLE];
  307. // Output only. If cluster_missing is set then it denotes that the GKE cluster no longer
  308. // exists in the GKE Control Plane.
  309. bool cluster_missing = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  310. }
  311. // OnPremCluster contains information specific to GKE On-Prem clusters.
  312. message OnPremCluster {
  313. // ClusterType describes on prem cluster's type.
  314. enum ClusterType {
  315. // The ClusterType is not set.
  316. CLUSTERTYPE_UNSPECIFIED = 0;
  317. // The ClusterType is bootstrap cluster.
  318. BOOTSTRAP = 1;
  319. // The ClusterType is baremetal hybrid cluster.
  320. HYBRID = 2;
  321. // The ClusterType is baremetal standalone cluster.
  322. STANDALONE = 3;
  323. // The ClusterType is user cluster.
  324. USER = 4;
  325. }
  326. // Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For example:
  327. //
  328. // //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/vmwareClusters/my-cluster
  329. // //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/bareMetalClusters/my-cluster
  330. string resource_link = 1 [(google.api.field_behavior) = IMMUTABLE];
  331. // Output only. If cluster_missing is set then it denotes that
  332. // API(gkeonprem.googleapis.com) resource for this GKE On-Prem cluster no
  333. // longer exists.
  334. bool cluster_missing = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  335. // Immutable. Whether the cluster is an admin cluster.
  336. bool admin_cluster = 3 [(google.api.field_behavior) = IMMUTABLE];
  337. // Immutable. The on prem cluster's type.
  338. ClusterType cluster_type = 4 [(google.api.field_behavior) = IMMUTABLE];
  339. }
  340. // MultiCloudCluster contains information specific to GKE Multi-Cloud clusters.
  341. message MultiCloudCluster {
  342. // Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster. For
  343. // example:
  344. //
  345. // //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/awsClusters/my-cluster
  346. // //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/azureClusters/my-cluster
  347. string resource_link = 1 [(google.api.field_behavior) = IMMUTABLE];
  348. // Output only. If cluster_missing is set then it denotes that
  349. // API(gkemulticloud.googleapis.com) resource for this GKE Multi-Cloud cluster
  350. // no longer exists.
  351. bool cluster_missing = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  352. }
  353. // EdgeCluster contains information specific to Google Edge Clusters.
  354. message EdgeCluster {
  355. // Immutable. Self-link of the GCP resource for the Edge Cluster. For
  356. // example:
  357. //
  358. // //edgecontainer.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
  359. string resource_link = 1 [(google.api.field_behavior) = IMMUTABLE];
  360. }
  361. // ApplianceCluster contains information specific to GDC Edge Appliance
  362. // Clusters.
  363. message ApplianceCluster {
  364. // Immutable. Self-link of the GCP resource for the Appliance Cluster. For
  365. // example:
  366. //
  367. // //transferappliance.googleapis.com/projects/my-project/locations/us-west1-a/appliances/my-appliance
  368. string resource_link = 1 [(google.api.field_behavior) = IMMUTABLE];
  369. }
  370. // KubernetesMetadata provides informational metadata for Memberships
  371. // representing Kubernetes clusters.
  372. message KubernetesMetadata {
  373. // Output only. Kubernetes API server version string as reported by '/version'.
  374. string kubernetes_api_server_version = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  375. // Output only. Node providerID as reported by the first node in the list of nodes on
  376. // the Kubernetes endpoint. On Kubernetes platforms that support zero-node
  377. // clusters (like GKE-on-GCP), the node_count will be zero and the
  378. // node_provider_id will be empty.
  379. string node_provider_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  380. // Output only. Node count as reported by Kubernetes nodes resources.
  381. int32 node_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  382. // Output only. vCPU count as reported by Kubernetes nodes resources.
  383. int32 vcpu_count = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  384. // Output only. The total memory capacity as reported by the sum of all Kubernetes nodes
  385. // resources, defined in MB.
  386. int32 memory_mb = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  387. // Output only. The time at which these details were last updated. This update_time is
  388. // different from the Membership-level update_time since EndpointDetails are
  389. // updated internally for API consumers.
  390. google.protobuf.Timestamp update_time = 100 [(google.api.field_behavior) = OUTPUT_ONLY];
  391. }
  392. // Authority encodes how Google will recognize identities from this Membership.
  393. // See the workload identity documentation for more details:
  394. // https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
  395. message Authority {
  396. // Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with `https://` and
  397. // be a valid URL with length <2000 characters.
  398. //
  399. // If set, then Google will allow valid OIDC tokens from this issuer to
  400. // authenticate within the workload_identity_pool. OIDC discovery will be
  401. // performed on this URI to validate tokens from the issuer.
  402. //
  403. // Clearing `issuer` disables Workload Identity. `issuer` cannot be directly
  404. // modified; it must be cleared (and Workload Identity disabled) before using
  405. // a new issuer (and re-enabling Workload Identity).
  406. string issuer = 1 [(google.api.field_behavior) = OPTIONAL];
  407. // Output only. The name of the workload identity pool in which `issuer` will be
  408. // recognized.
  409. //
  410. // There is a single Workload Identity Pool per Hub that is shared
  411. // between all Memberships that belong to that Hub. For a Hub hosted in
  412. // {PROJECT_ID}, the workload pool format is `{PROJECT_ID}.hub.id.goog`,
  413. // although this is subject to change in newer versions of this API.
  414. string workload_identity_pool = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  415. // Output only. An identity provider that reflects the `issuer` in the workload identity
  416. // pool.
  417. string identity_provider = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  418. // Optional. OIDC verification keys for this Membership in JWKS format (RFC 7517).
  419. //
  420. // When this field is set, OIDC discovery will NOT be performed on `issuer`,
  421. // and instead OIDC tokens will be validated using this field.
  422. bytes oidc_jwks = 4 [(google.api.field_behavior) = OPTIONAL];
  423. }
  424. // State of the Membership resource.
  425. message MembershipState {
  426. // Code describes the state of a Membership resource.
  427. enum Code {
  428. // The code is not set.
  429. CODE_UNSPECIFIED = 0;
  430. // The cluster is being registered.
  431. CREATING = 1;
  432. // The cluster is registered.
  433. READY = 2;
  434. // The cluster is being unregistered.
  435. DELETING = 3;
  436. // The Membership is being updated.
  437. UPDATING = 4;
  438. // The Membership is being updated by the Hub Service.
  439. SERVICE_UPDATING = 5;
  440. }
  441. // Output only. The current state of the Membership resource.
  442. Code code = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  443. // This field is never set by the Hub Service.
  444. string description = 2 [deprecated = true];
  445. // This field is never set by the Hub Service.
  446. google.protobuf.Timestamp update_time = 3 [deprecated = true];
  447. }
  448. // Request message for `GkeHubMembershipService.ListMemberships` method.
  449. message ListMembershipsRequest {
  450. // Required. The parent (project and location) where the Memberships will be listed.
  451. // Specified in the format `projects/*/locations/*`.
  452. string parent = 1 [
  453. (google.api.field_behavior) = REQUIRED,
  454. (google.api.resource_reference) = {
  455. child_type: "gkehub.googleapis.com/Membership"
  456. }
  457. ];
  458. // Optional. When requesting a 'page' of resources, `page_size` specifies number of
  459. // resources to return. If unspecified or set to 0, all resources will
  460. // be returned.
  461. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  462. // Optional. Token returned by previous call to `ListMemberships` which
  463. // specifies the position in the list from where to continue listing the
  464. // resources.
  465. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  466. // Optional. Lists Memberships that match the filter expression, following the syntax
  467. // outlined in https://google.aip.dev/160.
  468. //
  469. // Examples:
  470. //
  471. // - Name is `bar` in project `foo-proj` and location `global`:
  472. //
  473. // name = "projects/foo-proj/locations/global/membership/bar"
  474. //
  475. // - Memberships that have a label called `foo`:
  476. //
  477. // labels.foo:*
  478. //
  479. // - Memberships that have a label called `foo` whose value is `bar`:
  480. //
  481. // labels.foo = bar
  482. //
  483. // - Memberships in the CREATING state:
  484. //
  485. // state = CREATING
  486. string filter = 4 [(google.api.field_behavior) = OPTIONAL];
  487. // Optional. One or more fields to compare and use to sort the output.
  488. // See https://google.aip.dev/132#ordering.
  489. string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
  490. }
  491. // Response message for the `GkeHubMembershipService.ListMemberships` method.
  492. message ListMembershipsResponse {
  493. // The list of matching Memberships.
  494. repeated Membership resources = 1;
  495. // A token to request the next page of resources from the
  496. // `ListMemberships` method. The value of an empty string means that
  497. // there are no more resources to return.
  498. string next_page_token = 2;
  499. // List of locations that could not be reached while fetching this list.
  500. repeated string unreachable = 3;
  501. }
  502. // Request message for `GkeHubMembershipService.GetMembership` method.
  503. message GetMembershipRequest {
  504. // Required. The Membership resource name in the format
  505. // `projects/*/locations/*/memberships/*`.
  506. string name = 1 [
  507. (google.api.field_behavior) = REQUIRED,
  508. (google.api.resource_reference) = {
  509. type: "gkehub.googleapis.com/Membership"
  510. }
  511. ];
  512. }
  513. // Request message for the `GkeHubMembershipService.CreateMembership` method.
  514. message CreateMembershipRequest {
  515. // Required. The parent (project and location) where the Memberships will be created.
  516. // Specified in the format `projects/*/locations/*`.
  517. string parent = 1 [
  518. (google.api.field_behavior) = REQUIRED,
  519. (google.api.resource_reference) = {
  520. child_type: "gkehub.googleapis.com/Membership"
  521. }
  522. ];
  523. // Required. Client chosen ID for the membership. `membership_id` must be a valid RFC
  524. // 1123 compliant DNS label:
  525. //
  526. // 1. At most 63 characters in length
  527. // 2. It must consist of lower case alphanumeric characters or `-`
  528. // 3. It must start and end with an alphanumeric character
  529. //
  530. // Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`,
  531. // with a maximum length of 63 characters.
  532. string membership_id = 2 [(google.api.field_behavior) = REQUIRED];
  533. // Required. The membership to create.
  534. Membership resource = 3 [(google.api.field_behavior) = REQUIRED];
  535. // Optional. A request ID to identify requests. Specify a unique request ID
  536. // so that if you must retry your request, the server will know to ignore
  537. // the request if it has already been completed. The server will guarantee
  538. // that for at least 60 minutes after the first request.
  539. //
  540. // For example, consider a situation where you make an initial request and
  541. // the request times out. If you make the request again with the same request
  542. // ID, the server can check if original operation with the same request ID
  543. // was received, and if so, will ignore the second request. This prevents
  544. // clients from accidentally creating duplicate commitments.
  545. //
  546. // The request ID must be a valid UUID with the exception that zero UUID is
  547. // not supported (00000000-0000-0000-0000-000000000000).
  548. string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
  549. }
  550. // Request message for `GkeHubMembershipService.DeleteMembership` method.
  551. message DeleteMembershipRequest {
  552. // Required. The Membership resource name in the format
  553. // `projects/*/locations/*/memberships/*`.
  554. string name = 1 [
  555. (google.api.field_behavior) = REQUIRED,
  556. (google.api.resource_reference) = {
  557. type: "gkehub.googleapis.com/Membership"
  558. }
  559. ];
  560. // Optional. A request ID to identify requests. Specify a unique request ID
  561. // so that if you must retry your request, the server will know to ignore
  562. // the request if it has already been completed. The server will guarantee
  563. // that for at least 60 minutes after the first request.
  564. //
  565. // For example, consider a situation where you make an initial request and
  566. // the request times out. If you make the request again with the same request
  567. // ID, the server can check if original operation with the same request ID
  568. // was received, and if so, will ignore the second request. This prevents
  569. // clients from accidentally creating duplicate commitments.
  570. //
  571. // The request ID must be a valid UUID with the exception that zero UUID is
  572. // not supported (00000000-0000-0000-0000-000000000000).
  573. string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
  574. }
  575. // Request message for `GkeHubMembershipService.UpdateMembership` method.
  576. message UpdateMembershipRequest {
  577. // Required. The membership resource name in the format:
  578. // `projects/[project_id]/locations/global/memberships/[membership_id]`
  579. string name = 1 [
  580. (google.api.field_behavior) = REQUIRED,
  581. (google.api.resource_reference) = {
  582. type: "gkehub.googleapis.com/Membership"
  583. }
  584. ];
  585. // Required. Mask of fields to update. At least one field path must be specified in this
  586. // mask.
  587. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  588. // Required. Only fields specified in update_mask are updated.
  589. // If you specify a field in the update_mask but don't specify its value here
  590. // that field will be deleted.
  591. // If you are updating a map field, set the value of a key to null or empty
  592. // string to delete the key from the map. It's not possible to update a key's
  593. // value to the empty string.
  594. // If you specify the update_mask to be a special path "*", fully replaces all
  595. // user-modifiable fields to match `resource`.
  596. Membership resource = 3 [(google.api.field_behavior) = REQUIRED];
  597. // Optional. A request ID to identify requests. Specify a unique request ID
  598. // so that if you must retry your request, the server will know to ignore
  599. // the request if it has already been completed. The server will guarantee
  600. // that for at least 60 minutes after the first request.
  601. //
  602. // For example, consider a situation where you make an initial request and
  603. // the request times out. If you make the request again with the same request
  604. // ID, the server can check if original operation with the same request ID
  605. // was received, and if so, will ignore the second request. This prevents
  606. // clients from accidentally creating duplicate commitments.
  607. //
  608. // The request ID must be a valid UUID with the exception that zero UUID is
  609. // not supported (00000000-0000-0000-0000-000000000000).
  610. string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
  611. }
  612. // Request message for `GkeHubMembershipService.GenerateConnectManifest`
  613. // method.
  614. // .
  615. message GenerateConnectManifestRequest {
  616. // Required. The Membership resource name the Agent will associate with, in the format
  617. // `projects/*/locations/*/memberships/*`.
  618. string name = 1 [
  619. (google.api.field_behavior) = REQUIRED,
  620. (google.api.resource_reference) = {
  621. type: "gkehub.googleapis.com/Membership"
  622. }
  623. ];
  624. // Optional. The connect agent to generate manifest for.
  625. ConnectAgent connect_agent = 2 [(google.api.field_behavior) = OPTIONAL];
  626. // Optional. The Connect agent version to use. Defaults to the most current version.
  627. string version = 3 [(google.api.field_behavior) = OPTIONAL];
  628. // Optional. If true, generate the resources for upgrade only. Some resources
  629. // generated only for installation (e.g. secrets) will be excluded.
  630. bool is_upgrade = 4 [(google.api.field_behavior) = OPTIONAL];
  631. // Optional. The registry to fetch the connect agent image from. Defaults to
  632. // gcr.io/gkeconnect.
  633. string registry = 5 [(google.api.field_behavior) = OPTIONAL];
  634. // Optional. The image pull secret content for the registry, if not public.
  635. bytes image_pull_secret_content = 6 [(google.api.field_behavior) = OPTIONAL];
  636. }
  637. // GenerateConnectManifestResponse contains manifest information for
  638. // installing/upgrading a Connect agent.
  639. message GenerateConnectManifestResponse {
  640. // The ordered list of Kubernetes resources that need to be applied to the
  641. // cluster for GKE Connect agent installation/upgrade.
  642. repeated ConnectAgentResource manifest = 1;
  643. }
  644. // ConnectAgentResource represents a Kubernetes resource manifest for Connect
  645. // Agent deployment.
  646. message ConnectAgentResource {
  647. // Kubernetes type of the resource.
  648. TypeMeta type = 1;
  649. // YAML manifest of the resource.
  650. string manifest = 2;
  651. }
  652. // TypeMeta is the type information needed for content unmarshalling of
  653. // Kubernetes resources in the manifest.
  654. message TypeMeta {
  655. // Kind of the resource (e.g. Deployment).
  656. string kind = 1;
  657. // APIVersion of the resource (e.g. v1).
  658. string api_version = 2;
  659. }
  660. // The information required from end users to use GKE Connect.
  661. message ConnectAgent {
  662. // Do not set.
  663. string name = 1 [deprecated = true];
  664. // Optional. URI of a proxy if connectivity from the agent to gkeconnect.googleapis.com
  665. // requires the use of a proxy. Format must be in the form
  666. // `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol
  667. // supported by the proxy. This will direct the connect agent's outbound
  668. // traffic through a HTTP(S) proxy.
  669. bytes proxy = 2 [(google.api.field_behavior) = OPTIONAL];
  670. // Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`.
  671. //
  672. // The Connect Agent is authorized automatically when run in the default
  673. // namespace. Otherwise, explicit authorization must be granted with an
  674. // additional IAM binding.
  675. string namespace = 3 [(google.api.field_behavior) = OPTIONAL];
  676. }
  677. // The request to validate the existing state of the membership CR in the
  678. // cluster.
  679. message ValidateExclusivityRequest {
  680. // Required. The parent (project and location) where the Memberships will be created.
  681. // Specified in the format `projects/*/locations/*`.
  682. string parent = 1 [
  683. (google.api.field_behavior) = REQUIRED,
  684. (google.api.resource_reference) = {
  685. child_type: "gkehub.googleapis.com/Membership"
  686. }
  687. ];
  688. // Optional. The YAML of the membership CR in the cluster. Empty if the membership
  689. // CR does not exist.
  690. string cr_manifest = 2 [(google.api.field_behavior) = OPTIONAL];
  691. // Required. The intended membership name under the `parent`. This method only does
  692. // validation in anticipation of a CreateMembership call with the same name.
  693. string intended_membership = 3 [(google.api.field_behavior) = REQUIRED];
  694. }
  695. // The response of exclusivity artifacts validation result status.
  696. message ValidateExclusivityResponse {
  697. // The validation result.
  698. //
  699. // * `OK` means that exclusivity is validated, assuming the manifest produced
  700. // by GenerateExclusivityManifest is successfully applied.
  701. // * `ALREADY_EXISTS` means that the Membership CRD is already owned by
  702. // another Hub. See `status.message` for more information.
  703. google.rpc.Status status = 1;
  704. }
  705. // The request to generate the manifests for exclusivity artifacts.
  706. message GenerateExclusivityManifestRequest {
  707. // Required. The Membership resource name in the format
  708. // `projects/*/locations/*/memberships/*`.
  709. string name = 1 [
  710. (google.api.field_behavior) = REQUIRED,
  711. (google.api.resource_reference) = {
  712. type: "gkehub.googleapis.com/Membership"
  713. }
  714. ];
  715. // Optional. The YAML manifest of the membership CRD retrieved by
  716. // `kubectl get customresourcedefinitions membership`.
  717. // Leave empty if the resource does not exist.
  718. string crd_manifest = 2 [(google.api.field_behavior) = OPTIONAL];
  719. // Optional. The YAML manifest of the membership CR retrieved by
  720. // `kubectl get memberships membership`.
  721. // Leave empty if the resource does not exist.
  722. string cr_manifest = 3 [(google.api.field_behavior) = OPTIONAL];
  723. }
  724. // The response of the exclusivity artifacts manifests for the client to apply.
  725. message GenerateExclusivityManifestResponse {
  726. // The YAML manifest of the membership CRD to apply if a newer version of the
  727. // CRD is available. Empty if no update needs to be applied.
  728. string crd_manifest = 1;
  729. // The YAML manifest of the membership CR to apply if a new version of the
  730. // CR is available. Empty if no update needs to be applied.
  731. string cr_manifest = 2;
  732. }
  733. // Represents the metadata of the long-running operation.
  734. message OperationMetadata {
  735. // Output only. The time the operation was created.
  736. google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  737. // Output only. The time the operation finished running.
  738. google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  739. // Output only. Server-defined resource path for the target of the operation.
  740. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  741. // Output only. Name of the verb executed by the operation.
  742. string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  743. // Output only. Human-readable status of the operation, if any.
  744. string status_detail = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  745. // Output only. Identifies whether the user has requested cancellation
  746. // of the operation. Operations that have successfully been cancelled
  747. // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
  748. // corresponding to `Code.CANCELLED`.
  749. bool cancel_requested = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  750. // Output only. API version used to start the operation.
  751. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  752. }