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