membership.proto 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  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.v1alpha2;
  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. option csharp_namespace = "Google.Cloud.GkeHub.V1Alpha2";
  24. option go_package = "google.golang.org/genproto/googleapis/cloud/gkehub/v1alpha2;gkehub";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "MembershipProto";
  27. option java_package = "com.google.cloud.gkehub.v1alpha2";
  28. option php_namespace = "Google\\Cloud\\GkeHub\\V1alpha2";
  29. option ruby_package = "Google::Cloud::GkeHub::V1alpha2";
  30. // The GKE Hub service handles the registration of many Kubernetes
  31. // clusters to Google Cloud, represented with the [Membership][google.cloud.gkehub.v1alpha2.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 GkeHub {
  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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{name=projects/*/locations/*/memberships/*}:generateConnectManifest"
  105. };
  106. }
  107. // Initializes the Hub in this project, which includes creating the default
  108. // Hub Service Account and the Hub Workload Identity Pool. Initialization is
  109. // optional, and happens automatically when the first Membership is created.
  110. //
  111. // InitializeHub should be called when the first Membership cannot be
  112. // registered without these resources. A common example is granting the Hub
  113. // Service Account access to another project, which requires the account to
  114. // exist first.
  115. rpc InitializeHub(InitializeHubRequest) returns (InitializeHubResponse) {
  116. option (google.api.http) = {
  117. post: "/v1alpha2/{project=projects/*/locations/global/memberships}:initializeHub"
  118. body: "*"
  119. };
  120. }
  121. }
  122. // Membership contains information about a member cluster.
  123. message Membership {
  124. option (google.api.resource) = {
  125. type: "gkehub.googleapis.com/Membership"
  126. pattern: "projects/{project}/locations/{location}/memberships/{membership}"
  127. };
  128. // Specifies the infrastructure type of a Membership. Infrastructure type is
  129. // used by Hub to control infrastructure-specific behavior, including pricing.
  130. //
  131. // Each GKE distribution (on-GCP, on-Prem, on-X,...) will set this field
  132. // automatically, but Attached Clusters customers should specify a type
  133. // during registration.
  134. enum InfrastructureType {
  135. // No type was specified. Some Hub functionality may require a type be
  136. // specified, and will not support Memberships with this value.
  137. INFRASTRUCTURE_TYPE_UNSPECIFIED = 0;
  138. // Private infrastructure that is owned or operated by customer. This
  139. // includes GKE distributions such as GKE-OnPrem and GKE-OnBareMetal.
  140. ON_PREM = 1;
  141. // Public cloud infrastructure.
  142. MULTI_CLOUD = 2;
  143. }
  144. // Output only. The full, unique name of this Membership resource in the format
  145. // `projects/*/locations/*/memberships/{membership_id}`, set during creation.
  146. //
  147. // `membership_id` must be a valid RFC 1123 compliant DNS label:
  148. //
  149. // 1. At most 63 characters in length
  150. // 2. It must consist of lower case alphanumeric characters or `-`
  151. // 3. It must start and end with an alphanumeric character
  152. //
  153. // Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`,
  154. // with a maximum length of 63 characters.
  155. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  156. // Optional. GCP labels for this membership.
  157. map<string, string> labels = 2 [(google.api.field_behavior) = OPTIONAL];
  158. // Output only. Description of this membership, limited to 63 characters.
  159. // Must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.\ ]*`
  160. //
  161. // This field is present for legacy purposes.
  162. string description = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  163. // Type of resource represented by this Membership
  164. oneof type {
  165. // Optional. Endpoint information to reach this member.
  166. MembershipEndpoint endpoint = 4 [(google.api.field_behavior) = OPTIONAL];
  167. }
  168. // Output only. State of the Membership resource.
  169. MembershipState state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  170. // Output only. When the Membership was created.
  171. google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  172. // Output only. When the Membership was last updated.
  173. google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  174. // Output only. When the Membership was deleted.
  175. google.protobuf.Timestamp delete_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  176. // Optional. An externally-generated and managed ID for this Membership. This ID may
  177. // be modified after creation, but this is not recommended. For GKE clusters,
  178. // external_id is managed by the Hub API and updates will be ignored.
  179. //
  180. // The ID must match the regex: `[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`
  181. //
  182. // If this Membership represents a Kubernetes cluster, this value should be
  183. // set to the UID of the `kube-system` namespace object.
  184. string external_id = 9 [(google.api.field_behavior) = OPTIONAL];
  185. // Optional. How to identify workloads from this Membership.
  186. // See the documentation on Workload Identity for more details:
  187. // https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
  188. Authority authority = 10 [(google.api.field_behavior) = OPTIONAL];
  189. // Output only. For clusters using Connect, the timestamp of the most recent connection
  190. // established with Google Cloud. This time is updated every several minutes,
  191. // not continuously. For clusters that do not use GKE Connect, or that have
  192. // never connected successfully, this field will be unset.
  193. google.protobuf.Timestamp last_connection_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
  194. // Output only. Google-generated UUID for this resource. This is unique across all
  195. // Membership resources. If a Membership resource is deleted and another
  196. // resource with the same name is created, it gets a different unique_id.
  197. string unique_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  198. // Optional. The infrastructure type this Membership is running on.
  199. InfrastructureType infrastructure_type = 13 [(google.api.field_behavior) = OPTIONAL];
  200. }
  201. // MembershipEndpoint contains information needed to contact a Kubernetes API,
  202. // endpoint and any additional Kubernetes metadata.
  203. message MembershipEndpoint {
  204. // Cluster information of the registered cluster.
  205. oneof type {
  206. // Optional. Specific information for a GKE-on-GCP cluster.
  207. GkeCluster gke_cluster = 1 [(google.api.field_behavior) = OPTIONAL];
  208. // Optional. Specific information for a GKE On-Prem cluster.
  209. OnPremCluster on_prem_cluster = 4 [(google.api.field_behavior) = OPTIONAL];
  210. // Optional. Specific information for a GKE Multi-Cloud cluster.
  211. MultiCloudCluster multi_cloud_cluster = 5 [(google.api.field_behavior) = OPTIONAL];
  212. }
  213. // Output only. Useful Kubernetes-specific metadata.
  214. KubernetesMetadata kubernetes_metadata = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  215. // Optional. The in-cluster Kubernetes Resources that should be applied for a correctly
  216. // registered cluster, in the steady state. These resources:
  217. //
  218. // * Ensure that the cluster is exclusively registered to one and only one
  219. // Hub Membership.
  220. // * Propagate Workload Pool Information available in the Membership
  221. // Authority field.
  222. // * Ensure proper initial configuration of default Hub Features.
  223. KubernetesResource kubernetes_resource = 3 [(google.api.field_behavior) = OPTIONAL];
  224. }
  225. // KubernetesResource contains the YAML manifests and configuration for
  226. // Membership Kubernetes resources in the cluster. After CreateMembership or
  227. // UpdateMembership, these resources should be re-applied in the cluster.
  228. message KubernetesResource {
  229. // Input only. The YAML representation of the Membership CR. This field is ignored for GKE
  230. // clusters where Hub can read the CR directly.
  231. //
  232. // Callers should provide the CR that is currently present in the cluster
  233. // during Create or Update, or leave this field empty if none exists. The CR
  234. // manifest is used to validate the cluster has not been registered with
  235. // another Membership.
  236. string membership_cr_manifest = 1 [(google.api.field_behavior) = INPUT_ONLY];
  237. // Output only. Additional Kubernetes resources that need to be applied to the cluster
  238. // after Membership creation, and after every update.
  239. //
  240. // This field is only populated in the Membership returned from a successful
  241. // long-running operation from CreateMembership or UpdateMembership. It is not
  242. // populated during normal GetMembership or ListMemberships requests. To get
  243. // the resource manifest after the initial registration, the caller should
  244. // make a UpdateMembership call with an empty field mask.
  245. repeated ResourceManifest membership_resources = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  246. // Output only. The Kubernetes resources for installing the GKE Connect agent.
  247. //
  248. // This field is only populated in the Membership returned from a successful
  249. // long-running operation from CreateMembership or UpdateMembership. It is not
  250. // populated during normal GetMembership or ListMemberships requests. To get
  251. // the resource manifest after the initial registration, the caller should
  252. // make a UpdateMembership call with an empty field mask.
  253. repeated ResourceManifest connect_resources = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  254. // Optional. Options for Kubernetes resource generation.
  255. ResourceOptions resource_options = 5 [(google.api.field_behavior) = OPTIONAL];
  256. }
  257. // ResourceOptions represent options for Kubernetes resource generation.
  258. message ResourceOptions {
  259. // Optional. The Connect agent version to use for connect_resources. Defaults to the
  260. // latest GKE Connect version. The version must be a currently supported
  261. // version, obsolete versions will be rejected.
  262. string connect_version = 1 [(google.api.field_behavior) = OPTIONAL];
  263. // Optional. Use `apiextensions/v1beta1` instead of `apiextensions/v1` for
  264. // CustomResourceDefinition resources.
  265. // This option should be set for clusters with Kubernetes apiserver versions
  266. // <1.16.
  267. bool v1beta1_crd = 2 [(google.api.field_behavior) = OPTIONAL];
  268. // Major version of the Kubernetes cluster. This is only used to determine
  269. // which version to use for the CustomResourceDefinition resources,
  270. // `apiextensions/v1beta1` or`apiextensions/v1`.
  271. string k8s_version = 3 [(google.api.field_behavior) = OPTIONAL];
  272. }
  273. // GkeCluster contains information specific to GKE clusters.
  274. message GkeCluster {
  275. // Immutable. Self-link of the GCP resource for the GKE cluster. For example:
  276. //
  277. // //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
  278. //
  279. // Zonal clusters are also supported.
  280. string resource_link = 1 [(google.api.field_behavior) = IMMUTABLE];
  281. // Output only. If cluster_missing is set then it denotes that the GKE cluster no longer
  282. // exists in the GKE Control Plane.
  283. bool cluster_missing = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  284. }
  285. // OnPremCluster contains information specific to GKE On-Prem clusters.
  286. message OnPremCluster {
  287. // Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For example:
  288. //
  289. // //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/vmwareClusters/my-cluster
  290. // //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/bareMetalClusters/my-cluster
  291. string resource_link = 1 [(google.api.field_behavior) = IMMUTABLE];
  292. // Output only. If cluster_missing is set then it denotes that
  293. // API(gkeonprem.googleapis.com) resource for this GKE On-Prem cluster no
  294. // longer exists.
  295. bool cluster_missing = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  296. // Immutable. Whether the cluster is an admin cluster.
  297. bool admin_cluster = 3 [(google.api.field_behavior) = IMMUTABLE];
  298. }
  299. // MultiCloudCluster contains information specific to GKE Multi-Cloud clusters.
  300. message MultiCloudCluster {
  301. // Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster. For
  302. // example:
  303. //
  304. // //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/awsClusters/my-cluster
  305. // //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/azureClusters/my-cluster
  306. string resource_link = 1 [(google.api.field_behavior) = IMMUTABLE];
  307. // Output only. If cluster_missing is set then it denotes that
  308. // API(gkemulticloud.googleapis.com) resource for this GKE Multi-Cloud cluster
  309. // no longer exists.
  310. bool cluster_missing = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  311. }
  312. // KubernetesMetadata provides informational metadata for Memberships
  313. // that are created from Kubernetes Endpoints (currently, these are equivalent
  314. // to Kubernetes clusters).
  315. message KubernetesMetadata {
  316. // Output only. Kubernetes API server version string as reported by '/version'.
  317. string kubernetes_api_server_version = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  318. // Output only. Node providerID as reported by the first node in the list of nodes on
  319. // the Kubernetes endpoint. On Kubernetes platforms that support zero-node
  320. // clusters (like GKE-on-GCP), the node_count will be zero and the
  321. // node_provider_id will be empty.
  322. string node_provider_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  323. // Output only. Node count as reported by Kubernetes nodes resources.
  324. int32 node_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  325. // Output only. vCPU count as reported by Kubernetes nodes resources.
  326. int32 vcpu_count = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  327. // Output only. The total memory capacity as reported by the sum of all Kubernetes nodes
  328. // resources, defined in MB.
  329. int32 memory_mb = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  330. // Output only. The time at which these details were last updated. This update_time is
  331. // different from the Membership-level update_time since EndpointDetails are
  332. // updated internally for API consumers.
  333. google.protobuf.Timestamp update_time = 100 [(google.api.field_behavior) = OUTPUT_ONLY];
  334. }
  335. // Authority encodes how Google will recognize identities from this Membership.
  336. // See the workload identity documentation for more details:
  337. // https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
  338. message Authority {
  339. // Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start with `https://` and
  340. // be a valid URL with length <2000 characters.
  341. //
  342. // If set, then Google will allow valid OIDC tokens from this issuer to
  343. // authenticate within the workload_identity_pool. OIDC discovery will be
  344. // performed on this URI to validate tokens from the issuer, unless
  345. // `oidc_jwks` is set.
  346. //
  347. // Clearing `issuer` disables Workload Identity. `issuer` cannot be directly
  348. // modified; it must be cleared (and Workload Identity disabled) before using
  349. // a new issuer (and re-enabling Workload Identity).
  350. string issuer = 1 [(google.api.field_behavior) = OPTIONAL];
  351. // Optional. OIDC verification keys for this Membership in JWKS format (RFC 7517).
  352. //
  353. // When this field is set, OIDC discovery will NOT be performed on `issuer`,
  354. // and instead OIDC tokens will be validated using this field.
  355. bytes oidc_jwks = 5 [(google.api.field_behavior) = OPTIONAL];
  356. // Output only. An identity provider that reflects the `issuer` in the workload identity
  357. // pool.
  358. string identity_provider = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  359. // Output only. The name of the workload identity pool in which `issuer` will be
  360. // recognized.
  361. //
  362. // There is a single Workload Identity Pool per Hub that is shared
  363. // between all Memberships that belong to that Hub. For a Hub hosted in
  364. // {PROJECT_ID}, the workload pool format is `{PROJECT_ID}.hub.id.goog`,
  365. // although this is subject to change in newer versions of this API.
  366. string workload_identity_pool = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  367. }
  368. // MembershipState describes the state of a Membership resource.
  369. message MembershipState {
  370. // Code describes the state of a Membership resource.
  371. enum Code {
  372. // The code is not set.
  373. CODE_UNSPECIFIED = 0;
  374. // The cluster is being registered.
  375. CREATING = 1;
  376. // The cluster is registered.
  377. READY = 2;
  378. // The cluster is being unregistered.
  379. DELETING = 3;
  380. // The Membership is being updated.
  381. UPDATING = 4;
  382. // The Membership is being updated by the Hub Service.
  383. SERVICE_UPDATING = 5;
  384. }
  385. // Output only. The current state of the Membership resource.
  386. Code code = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  387. }
  388. // Request message for `GkeHub.ListMemberships` method.
  389. message ListMembershipsRequest {
  390. // Required. The parent (project and location) where the Memberships will be listed.
  391. // Specified in the format `projects/*/locations/*`.
  392. string parent = 1 [
  393. (google.api.field_behavior) = REQUIRED,
  394. (google.api.resource_reference) = {
  395. child_type: "gkehub.googleapis.com/Membership"
  396. }
  397. ];
  398. // Optional. When requesting a 'page' of resources, `page_size` specifies number of
  399. // resources to return. If unspecified or set to 0, all resources will
  400. // be returned.
  401. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  402. // Optional. Token returned by previous call to `ListMemberships` which
  403. // specifies the position in the list from where to continue listing the
  404. // resources.
  405. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  406. // Optional. Lists Memberships that match the filter expression, following the syntax
  407. // outlined in https://google.aip.dev/160.
  408. //
  409. // Examples:
  410. //
  411. // - Name is `bar` in project `foo-proj` and location `global`:
  412. //
  413. // name = "projects/foo-proj/locations/global/membership/bar"
  414. //
  415. // - Memberships that have a label called `foo`:
  416. //
  417. // labels.foo:*
  418. //
  419. // - Memberships that have a label called `foo` whose value is `bar`:
  420. //
  421. // labels.foo = bar
  422. //
  423. // - Memberships in the CREATING state:
  424. //
  425. // state = CREATING
  426. string filter = 4 [(google.api.field_behavior) = OPTIONAL];
  427. // Optional. One or more fields to compare and use to sort the output.
  428. // See https://google.aip.dev/132#ordering.
  429. string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
  430. }
  431. // Response message for the `GkeHub.ListMemberships` method.
  432. message ListMembershipsResponse {
  433. // The list of matching Memberships.
  434. repeated Membership resources = 1;
  435. // A token to request the next page of resources from the
  436. // `ListMemberships` method. The value of an empty string means that
  437. // there are no more resources to return.
  438. string next_page_token = 2;
  439. // List of locations that could not be reached while fetching this list.
  440. repeated string unreachable = 3;
  441. }
  442. // Request message for `GkeHub.GetMembership` method.
  443. message GetMembershipRequest {
  444. // Required. The Membership resource name in the format
  445. // `projects/*/locations/*/memberships/*`.
  446. string name = 1 [
  447. (google.api.field_behavior) = REQUIRED,
  448. (google.api.resource_reference) = {
  449. type: "gkehub.googleapis.com/Membership"
  450. }
  451. ];
  452. }
  453. // Request message for the `GkeHub.CreateMembership` method.
  454. message CreateMembershipRequest {
  455. // Required. The parent (project and location) where the Memberships will be created.
  456. // Specified in the format `projects/*/locations/*`.
  457. string parent = 1 [
  458. (google.api.field_behavior) = REQUIRED,
  459. (google.api.resource_reference) = {
  460. child_type: "gkehub.googleapis.com/Membership"
  461. }
  462. ];
  463. // Required. Client chosen ID for the membership. `membership_id` must be a valid RFC
  464. // 1123 compliant DNS label:
  465. //
  466. // 1. At most 63 characters in length
  467. // 2. It must consist of lower case alphanumeric characters or `-`
  468. // 3. It must start and end with an alphanumeric character
  469. //
  470. // Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`,
  471. // with a maximum length of 63 characters.
  472. string membership_id = 2 [(google.api.field_behavior) = REQUIRED];
  473. // Required. The membership to create.
  474. Membership resource = 3 [(google.api.field_behavior) = REQUIRED];
  475. }
  476. // Request message for `GkeHub.DeleteMembership` method.
  477. message DeleteMembershipRequest {
  478. // Required. The Membership resource name in the format
  479. // `projects/*/locations/*/memberships/*`.
  480. string name = 1 [
  481. (google.api.field_behavior) = REQUIRED,
  482. (google.api.resource_reference) = {
  483. type: "gkehub.googleapis.com/Membership"
  484. }
  485. ];
  486. }
  487. // Request message for `GkeHub.UpdateMembership` method.
  488. message UpdateMembershipRequest {
  489. // Required. The Membership resource name in the format
  490. // `projects/*/locations/*/memberships/*`.
  491. string name = 1 [
  492. (google.api.field_behavior) = REQUIRED];
  493. // Required. Mask of fields to update.
  494. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  495. // Required. Only fields specified in update_mask are updated.
  496. // If you specify a field in the update_mask but don't specify its value here
  497. // that field will be deleted.
  498. // If you are updating a map field, set the value of a key to null or empty
  499. // string to delete the key from the map. It's not possible to update a key's
  500. // value to the empty string.
  501. // If you specify the update_mask to be a special path "*", fully replaces all
  502. // user-modifiable fields to match `resource`.
  503. Membership resource = 3 [(google.api.field_behavior) = REQUIRED];
  504. }
  505. // Request message for `GkeHub.GenerateConnectManifest`
  506. // method.
  507. // .
  508. message GenerateConnectManifestRequest {
  509. // Required. The Membership resource name the Agent will associate with, in the format
  510. // `projects/*/locations/*/memberships/*`.
  511. string name = 1 [
  512. (google.api.field_behavior) = REQUIRED];
  513. // Optional. Namespace for GKE Connect agent resources. Defaults to `gke-connect`.
  514. //
  515. // The Connect Agent is authorized automatically when run in the default
  516. // namespace. Otherwise, explicit authorization must be granted with an
  517. // additional IAM binding.
  518. string namespace = 2 [(google.api.field_behavior) = OPTIONAL];
  519. // Optional. URI of a proxy if connectivity from the agent to gkeconnect.googleapis.com
  520. // requires the use of a proxy. Format must be in the form
  521. // `http(s)://{proxy_address}`, depending on the HTTP/HTTPS protocol
  522. // supported by the proxy. This will direct the connect agent's outbound
  523. // traffic through a HTTP(S) proxy.
  524. bytes proxy = 3 [(google.api.field_behavior) = OPTIONAL];
  525. // Optional. The Connect agent version to use. Defaults to the most current version.
  526. string version = 4 [(google.api.field_behavior) = OPTIONAL];
  527. // Optional. If true, generate the resources for upgrade only. Some resources
  528. // generated only for installation (e.g. secrets) will be excluded.
  529. bool is_upgrade = 5 [(google.api.field_behavior) = OPTIONAL];
  530. // Optional. The registry to fetch the connect agent image from. Defaults to
  531. // gcr.io/gkeconnect.
  532. string registry = 6 [(google.api.field_behavior) = OPTIONAL];
  533. // Optional. The image pull secret content for the registry, if not public.
  534. bytes image_pull_secret_content = 7 [(google.api.field_behavior) = OPTIONAL];
  535. }
  536. // GenerateConnectManifestResponse contains manifest information for
  537. // installing/upgrading a Connect agent.
  538. message GenerateConnectManifestResponse {
  539. // The ordered list of Kubernetes resources that need to be applied to the
  540. // cluster for GKE Connect agent installation/upgrade.
  541. repeated ConnectAgentResource manifest = 1;
  542. }
  543. // ConnectAgentResource represents a Kubernetes resource manifest for Connect
  544. // Agent deployment.
  545. message ConnectAgentResource {
  546. // Kubernetes type of the resource.
  547. TypeMeta type = 1;
  548. // YAML manifest of the resource.
  549. string manifest = 2;
  550. }
  551. // ResourceManifest represents a single Kubernetes resource to be applied to
  552. // the cluster.
  553. message ResourceManifest {
  554. // YAML manifest of the resource.
  555. string manifest = 1;
  556. // Whether the resource provided in the manifest is `cluster_scoped`.
  557. // If unset, the manifest is assumed to be namespace scoped.
  558. //
  559. // This field is used for REST mapping when applying the resource in a
  560. // cluster.
  561. bool cluster_scoped = 2;
  562. }
  563. // TypeMeta is the type information needed for content unmarshalling of
  564. // Kubernetes resources in the manifest.
  565. message TypeMeta {
  566. // Kind of the resource (e.g. Deployment).
  567. string kind = 1;
  568. // APIVersion of the resource (e.g. v1).
  569. string api_version = 2;
  570. }
  571. // Request message for the InitializeHub method.
  572. message InitializeHubRequest {
  573. // Required. The Hub to initialize, in the format
  574. // `projects/*/locations/*/memberships/*`.
  575. string project = 1 [(google.api.field_behavior) = REQUIRED];
  576. }
  577. // Response message for the InitializeHub method.
  578. message InitializeHubResponse {
  579. // Name of the Hub default service identity, in the format:
  580. //
  581. // service-<project-number>@gcp-sa-gkehub.iam.gserviceaccount.com
  582. //
  583. // The service account has `roles/gkehub.serviceAgent` in the Hub project.
  584. string service_identity = 1;
  585. // The Workload Identity Pool used for Workload Identity-enabled clusters
  586. // registered with this Hub. Format: `<project-id>.hub.id.goog`
  587. string workload_identity_pool = 2;
  588. }
  589. // Represents the metadata of the long-running operation.
  590. message OperationMetadata {
  591. // Output only. The time the operation was created.
  592. google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  593. // Output only. The time the operation finished running.
  594. google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  595. // Output only. Server-defined resource path for the target of the operation.
  596. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  597. // Output only. Name of the verb executed by the operation.
  598. string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  599. // Output only. Human-readable status of the operation, if any.
  600. string status_detail = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  601. // Output only. Identifies whether the user has requested cancellation
  602. // of the operation. Operations that have successfully been cancelled
  603. // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
  604. // corresponding to `Code.CANCELLED`.
  605. bool cancel_requested = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  606. // Output only. API version used to start the operation.
  607. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  608. }