xref: /aosp_15_r20/external/googleapis/google/cloud/gkemulticloud/v1/attached_service.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 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.gkemulticloud.v1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/cloud/gkemulticloud/v1/attached_resources.proto";
24import "google/cloud/gkemulticloud/v1/common_resources.proto";
25import "google/longrunning/operations.proto";
26import "google/protobuf/empty.proto";
27import "google/protobuf/field_mask.proto";
28
29option csharp_namespace = "Google.Cloud.GkeMultiCloud.V1";
30option go_package = "cloud.google.com/go/gkemulticloud/apiv1/gkemulticloudpb;gkemulticloudpb";
31option java_multiple_files = true;
32option java_outer_classname = "AttachedServiceProto";
33option java_package = "com.google.cloud.gkemulticloud.v1";
34option php_namespace = "Google\\Cloud\\GkeMultiCloud\\V1";
35option ruby_package = "Google::Cloud::GkeMultiCloud::V1";
36
37// The AttachedClusters API provides a single centrally managed service
38// to register and manage Anthos attached clusters that run on customer's owned
39// infrastructure.
40service AttachedClusters {
41  option (google.api.default_host) = "gkemulticloud.googleapis.com";
42  option (google.api.oauth_scopes) =
43      "https://www.googleapis.com/auth/cloud-platform";
44
45  // Creates a new
46  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource
47  // on a given Google Cloud Platform project and region.
48  //
49  // If successful, the response contains a newly created
50  // [Operation][google.longrunning.Operation] resource that can be
51  // described to track the status of the operation.
52  rpc CreateAttachedCluster(CreateAttachedClusterRequest)
53      returns (google.longrunning.Operation) {
54    option (google.api.http) = {
55      post: "/v1/{parent=projects/*/locations/*}/attachedClusters"
56      body: "attached_cluster"
57    };
58    option (google.api.method_signature) =
59        "parent,attached_cluster,attached_cluster_id";
60    option (google.longrunning.operation_info) = {
61      response_type: "AttachedCluster"
62      metadata_type: "OperationMetadata"
63    };
64  }
65
66  // Updates an
67  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster].
68  rpc UpdateAttachedCluster(UpdateAttachedClusterRequest)
69      returns (google.longrunning.Operation) {
70    option (google.api.http) = {
71      patch: "/v1/{attached_cluster.name=projects/*/locations/*/attachedClusters/*}"
72      body: "attached_cluster"
73    };
74    option (google.api.method_signature) = "attached_cluster,update_mask";
75    option (google.longrunning.operation_info) = {
76      response_type: "AttachedCluster"
77      metadata_type: "OperationMetadata"
78    };
79  }
80
81  // Imports creates a new
82  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource
83  // by importing an existing Fleet Membership resource.
84  //
85  // Attached Clusters created before the introduction of the Anthos Multi-Cloud
86  // API can be imported through this method.
87  //
88  // If successful, the response contains a newly created
89  // [Operation][google.longrunning.Operation] resource that can be
90  // described to track the status of the operation.
91  rpc ImportAttachedCluster(ImportAttachedClusterRequest)
92      returns (google.longrunning.Operation) {
93    option (google.api.http) = {
94      post: "/v1/{parent=projects/*/locations/*}/attachedClusters:import"
95      body: "*"
96    };
97    option (google.api.method_signature) = "parent,fleet_membership";
98    option (google.longrunning.operation_info) = {
99      response_type: "AttachedCluster"
100      metadata_type: "OperationMetadata"
101    };
102  }
103
104  // Describes a specific
105  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.
106  rpc GetAttachedCluster(GetAttachedClusterRequest) returns (AttachedCluster) {
107    option (google.api.http) = {
108      get: "/v1/{name=projects/*/locations/*/attachedClusters/*}"
109    };
110    option (google.api.method_signature) = "name";
111  }
112
113  // Lists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster]
114  // resources on a given Google Cloud project and region.
115  rpc ListAttachedClusters(ListAttachedClustersRequest)
116      returns (ListAttachedClustersResponse) {
117    option (google.api.http) = {
118      get: "/v1/{parent=projects/*/locations/*}/attachedClusters"
119    };
120    option (google.api.method_signature) = "parent";
121  }
122
123  // Deletes a specific
124  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.
125  //
126  // If successful, the response contains a newly created
127  // [Operation][google.longrunning.Operation] resource that can be
128  // described to track the status of the operation.
129  rpc DeleteAttachedCluster(DeleteAttachedClusterRequest)
130      returns (google.longrunning.Operation) {
131    option (google.api.http) = {
132      delete: "/v1/{name=projects/*/locations/*/attachedClusters/*}"
133    };
134    option (google.api.method_signature) = "name";
135    option (google.longrunning.operation_info) = {
136      response_type: "google.protobuf.Empty"
137      metadata_type: "OperationMetadata"
138    };
139  }
140
141  // Returns information, such as supported Kubernetes versions, on a given
142  // Google Cloud location.
143  rpc GetAttachedServerConfig(GetAttachedServerConfigRequest)
144      returns (AttachedServerConfig) {
145    option (google.api.http) = {
146      get: "/v1/{name=projects/*/locations/*/attachedServerConfig}"
147    };
148    option (google.api.method_signature) = "name";
149  }
150
151  // Generates the install manifest to be installed on the target cluster.
152  rpc GenerateAttachedClusterInstallManifest(
153      GenerateAttachedClusterInstallManifestRequest)
154      returns (GenerateAttachedClusterInstallManifestResponse) {
155    option (google.api.http) = {
156      get: "/v1/{parent=projects/*/locations/*}:generateAttachedClusterInstallManifest"
157    };
158    option (google.api.method_signature) = "parent,attached_cluster_id";
159  }
160
161  // Generates an access token for a cluster agent.
162  rpc GenerateAttachedClusterAgentToken(
163      GenerateAttachedClusterAgentTokenRequest)
164      returns (GenerateAttachedClusterAgentTokenResponse) {
165    option (google.api.http) = {
166      post: "/v1/{attached_cluster=projects/*/locations/*/attachedClusters/*}:generateAttachedClusterAgentToken"
167      body: "*"
168    };
169  }
170}
171
172// Request message for `AttachedClusters.GenerateAttachedClusterInstallManifest`
173// method.
174message GenerateAttachedClusterInstallManifestRequest {
175  // Required. The parent location where this
176  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource
177  // will be created.
178  //
179  // Location names are formatted as `projects/<project-id>/locations/<region>`.
180  //
181  // See [Resource Names](https://cloud.google.com/apis/design/resource_names)
182  // for more details on Google Cloud resource names.
183  string parent = 1 [
184    (google.api.field_behavior) = REQUIRED,
185    (google.api.resource_reference) = {
186      child_type: "gkemulticloud.googleapis.com/AttachedCluster"
187    }
188  ];
189
190  // Required. A client provided ID of the resource. Must be unique within the
191  // parent resource.
192  //
193  // The provided ID will be part of the
194  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource
195  // name formatted as
196  // `projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>`.
197  //
198  // Valid characters are `/[a-z][0-9]-/`. Cannot be longer than 63 characters.
199  //
200  // When generating an install manifest for importing an existing Membership
201  // resource, the attached_cluster_id field must be the Membership id.
202  //
203  // Membership names are formatted as
204  // `projects/<project-id>/locations/<region>/memberships/<membership-id>`.
205  string attached_cluster_id = 2 [(google.api.field_behavior) = REQUIRED];
206
207  // Required. The platform version for the cluster (e.g. `1.19.0-gke.1000`).
208  //
209  // You can list all supported versions on a given Google Cloud region by
210  // calling
211  // [GetAttachedServerConfig][google.cloud.gkemulticloud.v1.AttachedClusters.GetAttachedServerConfig].
212  string platform_version = 3 [(google.api.field_behavior) = REQUIRED];
213
214  // Optional. Proxy configuration for outbound HTTP(S) traffic.
215  AttachedProxyConfig proxy_config = 4 [(google.api.field_behavior) = OPTIONAL];
216}
217
218// Response message for
219// `AttachedClusters.GenerateAttachedClusterInstallManifest` method.
220message GenerateAttachedClusterInstallManifestResponse {
221  // A set of Kubernetes resources (in YAML format) to be applied
222  // to the cluster to be attached.
223  string manifest = 1;
224}
225
226// Request message for `AttachedClusters.CreateAttachedCluster` method.
227message CreateAttachedClusterRequest {
228  // Required. The parent location where this
229  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource
230  // will be created.
231  //
232  // Location names are formatted as `projects/<project-id>/locations/<region>`.
233  //
234  // See [Resource Names](https://cloud.google.com/apis/design/resource_names)
235  // for more details on Google Cloud resource names.
236  string parent = 1 [
237    (google.api.field_behavior) = REQUIRED,
238    (google.api.resource_reference) = {
239      child_type: "gkemulticloud.googleapis.com/AttachedCluster"
240    }
241  ];
242
243  // Required. The specification of the
244  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] to create.
245  AttachedCluster attached_cluster = 2 [(google.api.field_behavior) = REQUIRED];
246
247  // Required. A client provided ID the resource. Must be unique within the
248  // parent resource.
249  //
250  // The provided ID will be part of the
251  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource
252  // name formatted as
253  // `projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>`.
254  //
255  // Valid characters are `/[a-z][0-9]-/`. Cannot be longer than 63 characters.
256  string attached_cluster_id = 3 [(google.api.field_behavior) = REQUIRED];
257
258  // If set, only validate the request, but do not actually create the cluster.
259  bool validate_only = 4;
260}
261
262// Request message for `AttachedClusters.ImportAttachedCluster` method.
263message ImportAttachedClusterRequest {
264  // Required. The parent location where this
265  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource
266  // will be created.
267  //
268  // Location names are formatted as `projects/<project-id>/locations/<region>`.
269  //
270  // See [Resource Names](https://cloud.google.com/apis/design/resource_names)
271  // for more details on Google Cloud resource names.
272  string parent = 1 [
273    (google.api.field_behavior) = REQUIRED,
274    (google.api.resource_reference) = {
275      child_type: "gkemulticloud.googleapis.com/AttachedCluster"
276    }
277  ];
278
279  // If set, only validate the request, but do not actually import the cluster.
280  bool validate_only = 2;
281
282  // Required. The name of the fleet membership resource to import.
283  string fleet_membership = 3 [(google.api.field_behavior) = REQUIRED];
284
285  // Required. The platform version for the cluster (e.g. `1.19.0-gke.1000`).
286  //
287  // You can list all supported versions on a given Google Cloud region by
288  // calling
289  // [GetAttachedServerConfig][google.cloud.gkemulticloud.v1.AttachedClusters.GetAttachedServerConfig].
290  string platform_version = 4 [(google.api.field_behavior) = REQUIRED];
291
292  // Required. The Kubernetes distribution of the underlying attached cluster.
293  //
294  // Supported values: ["eks", "aks"].
295  string distribution = 5 [(google.api.field_behavior) = REQUIRED];
296
297  // Optional. Proxy configuration for outbound HTTP(S) traffic.
298  AttachedProxyConfig proxy_config = 6 [(google.api.field_behavior) = OPTIONAL];
299}
300
301// Request message for `AttachedClusters.UpdateAttachedCluster` method.
302message UpdateAttachedClusterRequest {
303  // Required. The
304  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource
305  // to update.
306  AttachedCluster attached_cluster = 1 [(google.api.field_behavior) = REQUIRED];
307
308  // If set, only validate the request, but do not actually update the cluster.
309  bool validate_only = 2;
310
311  // Required. Mask of fields to update. At least one path must be supplied in
312  // this field. The elements of the repeated paths field can only include these
313  // fields from
314  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster]:
315  //
316  //  *   `annotations`.
317  //  *   `authorization.admin_groups`.
318  //  *   `authorization.admin_users`.
319  //  *   `binary_authorization.evaluation_mode`.
320  //  *   `description`.
321  //  *   `logging_config.component_config.enable_components`.
322  //  *   `monitoring_config.managed_prometheus_config.enabled`.
323  //  *   `platform_version`.
324  //  *   `proxy_config.kubernetes_secret.name`.
325  //  *   `proxy_config.kubernetes_secret.namespace`.
326  google.protobuf.FieldMask update_mask = 3
327      [(google.api.field_behavior) = REQUIRED];
328}
329
330// Request message for `AttachedClusters.GetAttachedCluster` method.
331message GetAttachedClusterRequest {
332  // Required. The name of the
333  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource
334  // to describe.
335  //
336  // `AttachedCluster` names are formatted as
337  // `projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>`.
338  //
339  // See [Resource Names](https://cloud.google.com/apis/design/resource_names)
340  // for more details on Google Cloud Platform resource names.
341  string name = 1 [
342    (google.api.field_behavior) = REQUIRED,
343    (google.api.resource_reference) = {
344      type: "gkemulticloud.googleapis.com/AttachedCluster"
345    }
346  ];
347}
348
349// Request message for `AttachedClusters.ListAttachedClusters` method.
350message ListAttachedClustersRequest {
351  // Required. The parent location which owns this collection of
352  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources.
353  //
354  // Location names are formatted as `projects/<project-id>/locations/<region>`.
355  //
356  // See [Resource Names](https://cloud.google.com/apis/design/resource_names)
357  // for more details on Google Cloud Platform resource names.
358  string parent = 1 [
359    (google.api.field_behavior) = REQUIRED,
360    (google.api.resource_reference) = {
361      child_type: "gkemulticloud.googleapis.com/AttachedCluster"
362    }
363  ];
364
365  // The maximum number of items to return.
366  //
367  // If not specified, a default value of 50 will be used by the service.
368  // Regardless of the pageSize value, the response can include a partial list
369  // and a caller should only rely on response's
370  // [nextPageToken][google.cloud.gkemulticloud.v1.ListAttachedClustersResponse.next_page_token]
371  // to determine if there are more instances left to be queried.
372  int32 page_size = 2;
373
374  // The `nextPageToken` value returned from a previous
375  // [attachedClusters.list][google.cloud.gkemulticloud.v1.AttachedClusters.ListAttachedClusters]
376  // request, if any.
377  string page_token = 3;
378}
379
380// Response message for `AttachedClusters.ListAttachedClusters` method.
381message ListAttachedClustersResponse {
382  // A list of [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster]
383  // resources in the specified Google Cloud Platform project and region region.
384  repeated AttachedCluster attached_clusters = 1;
385
386  // Token to retrieve the next page of results, or empty if there are no more
387  // results in the list.
388  string next_page_token = 2;
389}
390
391// Request message for `AttachedClusters.DeleteAttachedCluster` method.
392message DeleteAttachedClusterRequest {
393  // Required. The resource name the
394  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] to delete.
395  //
396  // `AttachedCluster` names are formatted as
397  // `projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>`.
398  //
399  // See [Resource Names](https://cloud.google.com/apis/design/resource_names)
400  // for more details on Google Cloud Platform resource names.
401  string name = 1 [
402    (google.api.field_behavior) = REQUIRED,
403    (google.api.resource_reference) = {
404      type: "gkemulticloud.googleapis.com/AttachedCluster"
405    }
406  ];
407
408  // If set, only validate the request, but do not actually delete the resource.
409  bool validate_only = 2;
410
411  // If set to true, and the
412  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource
413  // is not found, the request will succeed but no action will be taken on the
414  // server and a completed [Operation][google.longrunning.Operation] will be
415  // returned.
416  //
417  // Useful for idempotent deletion.
418  bool allow_missing = 3;
419
420  // If set to true, the deletion of
421  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource
422  // will succeed even if errors occur during deleting in cluster resources.
423  // Using this parameter may result in orphaned resources in the cluster.
424  bool ignore_errors = 5;
425
426  // The current etag of the
427  // [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster].
428  //
429  // Allows clients to perform deletions through optimistic concurrency control.
430  //
431  // If the provided etag does not match the current etag of the cluster,
432  // the request will fail and an ABORTED error will be returned.
433  string etag = 4;
434}
435
436// GetAttachedServerConfigRequest gets the server config for attached
437// clusters.
438message GetAttachedServerConfigRequest {
439  // Required. The name of the
440  // [AttachedServerConfig][google.cloud.gkemulticloud.v1.AttachedServerConfig]
441  // resource to describe.
442  //
443  // `AttachedServerConfig` names are formatted as
444  // `projects/<project-id>/locations/<region>/attachedServerConfig`.
445  //
446  // See [Resource Names](https://cloud.google.com/apis/design/resource_names)
447  // for more details on Google Cloud resource names.
448  string name = 1 [
449    (google.api.field_behavior) = REQUIRED,
450    (google.api.resource_reference) = {
451      type: "gkemulticloud.googleapis.com/AttachedServerConfig"
452    }
453  ];
454}
455
456message GenerateAttachedClusterAgentTokenRequest {
457  // Required.
458  string attached_cluster = 1 [
459    (google.api.field_behavior) = REQUIRED,
460    (google.api.resource_reference) = {
461      type: "gkemulticloud.googleapis.com/AttachedCluster"
462    }
463  ];
464
465  // Required.
466  string subject_token = 2 [(google.api.field_behavior) = REQUIRED];
467
468  // Required.
469  string subject_token_type = 3 [(google.api.field_behavior) = REQUIRED];
470
471  // Required.
472  string version = 4 [(google.api.field_behavior) = REQUIRED];
473
474  // Optional.
475  string grant_type = 6 [(google.api.field_behavior) = OPTIONAL];
476
477  // Optional.
478  string audience = 7 [(google.api.field_behavior) = OPTIONAL];
479
480  // Optional.
481  string scope = 8 [(google.api.field_behavior) = OPTIONAL];
482
483  // Optional.
484  string requested_token_type = 9 [(google.api.field_behavior) = OPTIONAL];
485
486  // Optional.
487  string options = 10 [(google.api.field_behavior) = OPTIONAL];
488}
489
490message GenerateAttachedClusterAgentTokenResponse {
491  string access_token = 1;
492
493  int32 expires_in = 2;
494
495  string token_type = 3;
496}
497