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.edgecontainer.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/edgecontainer/v1/resources.proto"; 24import "google/longrunning/operations.proto"; 25import "google/protobuf/field_mask.proto"; 26import "google/protobuf/timestamp.proto"; 27 28option go_package = "cloud.google.com/go/edgecontainer/apiv1/edgecontainerpb;edgecontainerpb"; 29option java_multiple_files = true; 30option java_outer_classname = "ServiceProto"; 31option java_package = "com.google.cloud.edgecontainer.v1"; 32 33// EdgeContainer API provides management of Kubernetes Clusters on Google Edge 34// Cloud deployments. 35service EdgeContainer { 36 option (google.api.default_host) = "edgecontainer.googleapis.com"; 37 option (google.api.oauth_scopes) = 38 "https://www.googleapis.com/auth/cloud-platform"; 39 40 // Lists Clusters in a given project and location. 41 rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { 42 option (google.api.http) = { 43 get: "/v1/{parent=projects/*/locations/*}/clusters" 44 }; 45 option (google.api.method_signature) = "parent"; 46 } 47 48 // Gets details of a single Cluster. 49 rpc GetCluster(GetClusterRequest) returns (Cluster) { 50 option (google.api.http) = { 51 get: "/v1/{name=projects/*/locations/*/clusters/*}" 52 }; 53 option (google.api.method_signature) = "name"; 54 } 55 56 // Creates a new Cluster in a given project and location. 57 rpc CreateCluster(CreateClusterRequest) 58 returns (google.longrunning.Operation) { 59 option (google.api.http) = { 60 post: "/v1/{parent=projects/*/locations/*}/clusters" 61 body: "cluster" 62 }; 63 option (google.api.method_signature) = "parent,cluster,cluster_id"; 64 option (google.longrunning.operation_info) = { 65 response_type: "Cluster" 66 metadata_type: "OperationMetadata" 67 }; 68 } 69 70 // Updates the parameters of a single Cluster. 71 rpc UpdateCluster(UpdateClusterRequest) 72 returns (google.longrunning.Operation) { 73 option (google.api.http) = { 74 patch: "/v1/{cluster.name=projects/*/locations/*/clusters/*}" 75 body: "cluster" 76 }; 77 option (google.api.method_signature) = "cluster,update_mask"; 78 option (google.longrunning.operation_info) = { 79 response_type: "Cluster" 80 metadata_type: "OperationMetadata" 81 }; 82 } 83 84 // Upgrades a single cluster. 85 rpc UpgradeCluster(UpgradeClusterRequest) 86 returns (google.longrunning.Operation) { 87 option (google.api.http) = { 88 post: "/v1/{name=projects/*/locations/*/clusters/*}:upgrade" 89 body: "*" 90 }; 91 option (google.api.method_signature) = "name,target_version,schedule"; 92 option (google.longrunning.operation_info) = { 93 response_type: "Cluster" 94 metadata_type: "OperationMetadata" 95 }; 96 } 97 98 // Deletes a single Cluster. 99 rpc DeleteCluster(DeleteClusterRequest) 100 returns (google.longrunning.Operation) { 101 option (google.api.http) = { 102 delete: "/v1/{name=projects/*/locations/*/clusters/*}" 103 }; 104 option (google.api.method_signature) = "name"; 105 option (google.longrunning.operation_info) = { 106 response_type: "google.protobuf.Empty" 107 metadata_type: "OperationMetadata" 108 }; 109 } 110 111 // Generates an access token for a Cluster. 112 rpc GenerateAccessToken(GenerateAccessTokenRequest) 113 returns (GenerateAccessTokenResponse) { 114 option (google.api.http) = { 115 get: "/v1/{cluster=projects/*/locations/*/clusters/*}:generateAccessToken" 116 }; 117 option (google.api.method_signature) = "cluster"; 118 } 119 120 // Generates an offline credential for a Cluster. 121 rpc GenerateOfflineCredential(GenerateOfflineCredentialRequest) 122 returns (GenerateOfflineCredentialResponse) { 123 option (google.api.http) = { 124 get: "/v1/{cluster=projects/*/locations/*/clusters/*}:generateOfflineCredential" 125 }; 126 option (google.api.method_signature) = "cluster"; 127 } 128 129 // Lists NodePools in a given project and location. 130 rpc ListNodePools(ListNodePoolsRequest) returns (ListNodePoolsResponse) { 131 option (google.api.http) = { 132 get: "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools" 133 }; 134 option (google.api.method_signature) = "parent"; 135 } 136 137 // Gets details of a single NodePool. 138 rpc GetNodePool(GetNodePoolRequest) returns (NodePool) { 139 option (google.api.http) = { 140 get: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" 141 }; 142 option (google.api.method_signature) = "name"; 143 } 144 145 // Creates a new NodePool in a given project and location. 146 rpc CreateNodePool(CreateNodePoolRequest) 147 returns (google.longrunning.Operation) { 148 option (google.api.http) = { 149 post: "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools" 150 body: "node_pool" 151 }; 152 option (google.api.method_signature) = "parent,node_pool,node_pool_id"; 153 option (google.longrunning.operation_info) = { 154 response_type: "NodePool" 155 metadata_type: "OperationMetadata" 156 }; 157 } 158 159 // Updates the parameters of a single NodePool. 160 rpc UpdateNodePool(UpdateNodePoolRequest) 161 returns (google.longrunning.Operation) { 162 option (google.api.http) = { 163 patch: "/v1/{node_pool.name=projects/*/locations/*/clusters/*/nodePools/*}" 164 body: "node_pool" 165 }; 166 option (google.api.method_signature) = "node_pool,update_mask"; 167 option (google.longrunning.operation_info) = { 168 response_type: "NodePool" 169 metadata_type: "OperationMetadata" 170 }; 171 } 172 173 // Deletes a single NodePool. 174 rpc DeleteNodePool(DeleteNodePoolRequest) 175 returns (google.longrunning.Operation) { 176 option (google.api.http) = { 177 delete: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" 178 }; 179 option (google.api.method_signature) = "name"; 180 option (google.longrunning.operation_info) = { 181 response_type: "google.protobuf.Empty" 182 metadata_type: "OperationMetadata" 183 }; 184 } 185 186 // Lists Machines in a given project and location. 187 rpc ListMachines(ListMachinesRequest) returns (ListMachinesResponse) { 188 option (google.api.http) = { 189 get: "/v1/{parent=projects/*/locations/*}/machines" 190 }; 191 option (google.api.method_signature) = "parent"; 192 } 193 194 // Gets details of a single Machine. 195 rpc GetMachine(GetMachineRequest) returns (Machine) { 196 option (google.api.http) = { 197 get: "/v1/{name=projects/*/locations/*/machines/*}" 198 }; 199 option (google.api.method_signature) = "name"; 200 } 201 202 // Lists VPN connections in a given project and location. 203 rpc ListVpnConnections(ListVpnConnectionsRequest) 204 returns (ListVpnConnectionsResponse) { 205 option (google.api.http) = { 206 get: "/v1/{parent=projects/*/locations/*}/vpnConnections" 207 }; 208 option (google.api.method_signature) = "parent"; 209 } 210 211 // Gets details of a single VPN connection. 212 rpc GetVpnConnection(GetVpnConnectionRequest) returns (VpnConnection) { 213 option (google.api.http) = { 214 get: "/v1/{name=projects/*/locations/*/vpnConnections/*}" 215 }; 216 option (google.api.method_signature) = "name"; 217 } 218 219 // Creates a new VPN connection in a given project and location. 220 rpc CreateVpnConnection(CreateVpnConnectionRequest) 221 returns (google.longrunning.Operation) { 222 option (google.api.http) = { 223 post: "/v1/{parent=projects/*/locations/*}/vpnConnections" 224 body: "vpn_connection" 225 }; 226 option (google.api.method_signature) = 227 "parent,vpn_connection,vpn_connection_id"; 228 option (google.longrunning.operation_info) = { 229 response_type: "VpnConnection" 230 metadata_type: "OperationMetadata" 231 }; 232 } 233 234 // Deletes a single VPN connection. 235 rpc DeleteVpnConnection(DeleteVpnConnectionRequest) 236 returns (google.longrunning.Operation) { 237 option (google.api.http) = { 238 delete: "/v1/{name=projects/*/locations/*/vpnConnections/*}" 239 }; 240 option (google.api.method_signature) = "name"; 241 option (google.longrunning.operation_info) = { 242 response_type: "google.protobuf.Empty" 243 metadata_type: "OperationMetadata" 244 }; 245 } 246 247 // Gets the server config. 248 rpc GetServerConfig(GetServerConfigRequest) returns (ServerConfig) { 249 option (google.api.http) = { 250 get: "/v1/{name=projects/*/locations/*}/serverConfig" 251 }; 252 option (google.api.method_signature) = "name"; 253 } 254} 255 256// Long-running operation metadata for Edge Container API methods. 257message OperationMetadata { 258 // The time the operation was created. 259 google.protobuf.Timestamp create_time = 1; 260 261 // The time the operation finished running. 262 google.protobuf.Timestamp end_time = 2; 263 264 // Server-defined resource path for the target of the operation. 265 string target = 3; 266 267 // The verb executed by the operation. 268 string verb = 4; 269 270 // Human-readable status of the operation, if any. 271 string status_message = 5; 272 273 // Identifies whether the user has requested cancellation of the operation. 274 // Operations that have successfully been cancelled have [Operation.error][] 275 // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, 276 // corresponding to `Code.CANCELLED`. 277 bool requested_cancellation = 6; 278 279 // API version used to start the operation. 280 string api_version = 7; 281 282 // Warnings that do not block the operation, but still hold relevant 283 // information for the end user to receive. 284 repeated string warnings = 8; 285} 286 287// Lists clusters in a location. 288message ListClustersRequest { 289 // Required. The parent location, which owns this collection of clusters. 290 string parent = 1 [ 291 (google.api.field_behavior) = REQUIRED, 292 (google.api.resource_reference) = { 293 child_type: "edgecontainer.googleapis.com/Cluster" 294 } 295 ]; 296 297 // The maximum number of resources to list. 298 int32 page_size = 2; 299 300 // A page token received from previous list request. 301 // A page token received from previous list request. 302 string page_token = 3; 303 304 // Only resources matching this filter will be listed. 305 string filter = 4; 306 307 // Specifies the order in which resources will be listed. 308 string order_by = 5; 309} 310 311// List of clusters in a location. 312message ListClustersResponse { 313 // Clusters in the location. 314 repeated Cluster clusters = 1; 315 316 // A token to retrieve next page of results. 317 string next_page_token = 2; 318 319 // Locations that could not be reached. 320 repeated string unreachable = 3; 321} 322 323// Gets a cluster. 324message GetClusterRequest { 325 // Required. The resource name of the cluster. 326 string name = 1 [ 327 (google.api.field_behavior) = REQUIRED, 328 (google.api.resource_reference) = { 329 type: "edgecontainer.googleapis.com/Cluster" 330 } 331 ]; 332} 333 334// Creates a cluster. 335message CreateClusterRequest { 336 // Required. The parent location where this cluster will be created. 337 string parent = 1 [ 338 (google.api.field_behavior) = REQUIRED, 339 (google.api.resource_reference) = { 340 child_type: "edgecontainer.googleapis.com/Cluster" 341 } 342 ]; 343 344 // Required. A client-specified unique identifier for the cluster. 345 string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; 346 347 // Required. The cluster to create. 348 Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; 349 350 // A unique identifier for this request. Restricted to 36 ASCII characters. A 351 // random UUID is recommended. This request is only idempotent if 352 // `request_id` is provided. 353 string request_id = 4; 354} 355 356// Updates a cluster. 357message UpdateClusterRequest { 358 // Field mask is used to specify the fields to be overwritten in the 359 // Cluster resource by the update. 360 // The fields specified in the update_mask are relative to the resource, not 361 // the full request. A field will be overwritten if it is in the mask. If the 362 // user does not provide a mask then all fields will be overwritten. 363 google.protobuf.FieldMask update_mask = 1; 364 365 // The updated cluster. 366 Cluster cluster = 2; 367 368 // A unique identifier for this request. Restricted to 36 ASCII characters. 369 // A random UUID is recommended. 370 // This request is only idempotent if `request_id` is provided. 371 string request_id = 3; 372} 373 374// Upgrades a cluster. 375message UpgradeClusterRequest { 376 // Represents the schedule about when the cluster is going to be upgraded. 377 enum Schedule { 378 // Unspecified. The default is to upgrade the cluster immediately which is 379 // the only option today. 380 SCHEDULE_UNSPECIFIED = 0; 381 382 // The cluster is going to be upgraded immediately after receiving the 383 // request. 384 IMMEDIATELY = 1; 385 } 386 387 // Required. The resource name of the cluster. 388 string name = 1 [ 389 (google.api.field_behavior) = REQUIRED, 390 (google.api.resource_reference) = { 391 type: "edgecontainer.googleapis.com/Cluster" 392 } 393 ]; 394 395 // Required. The version the cluster is going to be upgraded to. 396 string target_version = 2 [(google.api.field_behavior) = REQUIRED]; 397 398 // The schedule for the upgrade. 399 Schedule schedule = 3; 400 401 // A unique identifier for this request. Restricted to 36 ASCII characters. A 402 // random UUID is recommended. This request is only idempotent if 403 // `request_id` is provided. 404 string request_id = 4; 405} 406 407// Deletes a cluster. 408message DeleteClusterRequest { 409 // Required. The resource name of the cluster. 410 string name = 1 [ 411 (google.api.field_behavior) = REQUIRED, 412 (google.api.resource_reference) = { 413 type: "edgecontainer.googleapis.com/Cluster" 414 } 415 ]; 416 417 // A unique identifier for this request. Restricted to 36 ASCII characters. A 418 // random UUID is recommended. This request is only idempotent if 419 // `request_id` is provided. 420 string request_id = 2; 421} 422 423// Generates an access token for a cluster. 424message GenerateAccessTokenRequest { 425 // Required. The resource name of the cluster. 426 string cluster = 1 [ 427 (google.api.field_behavior) = REQUIRED, 428 (google.api.resource_reference) = { 429 type: "edgecontainer.googleapis.com/Cluster" 430 } 431 ]; 432} 433 434// An access token for a cluster. 435message GenerateAccessTokenResponse { 436 // Output only. Access token to authenticate to k8s api-server. 437 string access_token = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 438 439 // Output only. Timestamp at which the token will expire. 440 google.protobuf.Timestamp expire_time = 2 441 [(google.api.field_behavior) = OUTPUT_ONLY]; 442} 443 444// Generates an offline credential(offline) for a cluster. 445message GenerateOfflineCredentialRequest { 446 // Required. The resource name of the cluster. 447 string cluster = 1 [ 448 (google.api.field_behavior) = REQUIRED, 449 (google.api.resource_reference) = { 450 type: "edgecontainer.googleapis.com/Cluster" 451 } 452 ]; 453} 454 455// An offline credential for a cluster. 456message GenerateOfflineCredentialResponse { 457 // Output only. Client certificate to authenticate to k8s api-server. 458 string client_certificate = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 459 460 // Output only. Client private key to authenticate to k8s api-server. 461 string client_key = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 462 463 // Output only. Client's identity. 464 string user_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 465 466 // Output only. Timestamp at which this credential will expire. 467 google.protobuf.Timestamp expire_time = 4 468 [(google.api.field_behavior) = OUTPUT_ONLY]; 469} 470 471// Lists node pools in a cluster. 472message ListNodePoolsRequest { 473 // Required. The parent cluster, which owns this collection of node pools. 474 string parent = 1 [ 475 (google.api.field_behavior) = REQUIRED, 476 (google.api.resource_reference) = { 477 child_type: "edgecontainer.googleapis.com/NodePool" 478 } 479 ]; 480 481 // The maximum number of resources to list. 482 int32 page_size = 2; 483 484 // A page token received from previous list request. 485 string page_token = 3; 486 487 // Only resources matching this filter will be listed. 488 string filter = 4; 489 490 // Specifies the order in which resources will be listed. 491 string order_by = 5; 492} 493 494// List of node pools in a cluster. 495message ListNodePoolsResponse { 496 // Node pools in the cluster. 497 repeated NodePool node_pools = 1; 498 499 // A token to retrieve next page of results. 500 string next_page_token = 2; 501 502 // Locations that could not be reached. 503 repeated string unreachable = 3; 504} 505 506// Gets a node pool. 507message GetNodePoolRequest { 508 // Required. The resource name of the node pool. 509 string name = 1 [ 510 (google.api.field_behavior) = REQUIRED, 511 (google.api.resource_reference) = { 512 type: "edgecontainer.googleapis.com/NodePool" 513 } 514 ]; 515} 516 517// Creates a node pool. 518message CreateNodePoolRequest { 519 // Required. The parent cluster where this node pool will be created. 520 string parent = 1 [ 521 (google.api.field_behavior) = REQUIRED, 522 (google.api.resource_reference) = { 523 child_type: "edgecontainer.googleapis.com/NodePool" 524 } 525 ]; 526 527 // Required. A client-specified unique identifier for the node pool. 528 string node_pool_id = 2 [(google.api.field_behavior) = REQUIRED]; 529 530 // Required. The node pool to create. 531 NodePool node_pool = 3 [(google.api.field_behavior) = REQUIRED]; 532 533 // A unique identifier for this request. Restricted to 36 ASCII characters. A 534 // random UUID is recommended. This request is only idempotent if 535 // `request_id` is provided. 536 string request_id = 4; 537} 538 539// Updates a node pool. 540message UpdateNodePoolRequest { 541 // Field mask is used to specify the fields to be overwritten in the 542 // NodePool resource by the update. 543 // The fields specified in the update_mask are relative to the resource, not 544 // the full request. A field will be overwritten if it is in the mask. If the 545 // user does not provide a mask then all fields will be overwritten. 546 google.protobuf.FieldMask update_mask = 1; 547 548 // The updated node pool. 549 NodePool node_pool = 2; 550 551 // A unique identifier for this request. Restricted to 36 ASCII characters. A 552 // random UUID is recommended. This request is only idempotent if 553 // `request_id` is provided. 554 string request_id = 3; 555} 556 557// Deletes a node pool. 558message DeleteNodePoolRequest { 559 // Required. The resource name of the node pool. 560 string name = 1 [ 561 (google.api.field_behavior) = REQUIRED, 562 (google.api.resource_reference) = { 563 type: "edgecontainer.googleapis.com/NodePool" 564 } 565 ]; 566 567 // A unique identifier for this request. Restricted to 36 ASCII characters. A 568 // random UUID is recommended. This request is only idempotent if 569 // `request_id` is provided. 570 string request_id = 2; 571} 572 573// Lists machines in a site. 574message ListMachinesRequest { 575 // Required. The parent site, which owns this collection of machines. 576 string parent = 1 [ 577 (google.api.field_behavior) = REQUIRED, 578 (google.api.resource_reference) = { 579 child_type: "edgecontainer.googleapis.com/Machine" 580 } 581 ]; 582 583 // The maximum number of resources to list. 584 int32 page_size = 2; 585 586 // A page token received from previous list request. 587 string page_token = 3; 588 589 // Only resources matching this filter will be listed. 590 string filter = 4; 591 592 // Specifies the order in which resources will be listed. 593 string order_by = 5; 594} 595 596// List of machines in a site. 597message ListMachinesResponse { 598 // Machines in the site. 599 repeated Machine machines = 1; 600 601 // A token to retrieve next page of results. 602 string next_page_token = 2; 603 604 // Locations that could not be reached. 605 repeated string unreachable = 3; 606} 607 608// Gets a machine. 609message GetMachineRequest { 610 // Required. The resource name of the machine. 611 string name = 1 [ 612 (google.api.field_behavior) = REQUIRED, 613 (google.api.resource_reference) = { 614 type: "edgecontainer.googleapis.com/Machine" 615 } 616 ]; 617} 618 619// Lists VPN connections. 620message ListVpnConnectionsRequest { 621 // Required. The parent location, which owns this collection of VPN 622 // connections. 623 string parent = 1 [ 624 (google.api.field_behavior) = REQUIRED, 625 (google.api.resource_reference) = { 626 child_type: "edgecontainer.googleapis.com/VpnConnection" 627 } 628 ]; 629 630 // The maximum number of resources to list. 631 int32 page_size = 2; 632 633 // A page token received from previous list request. 634 string page_token = 3; 635 636 // Only resources matching this filter will be listed. 637 string filter = 4; 638 639 // Specifies the order in which resources will be listed. 640 string order_by = 5; 641} 642 643// List of VPN connections in a location. 644message ListVpnConnectionsResponse { 645 // VpnConnections in the location. 646 repeated VpnConnection vpn_connections = 1; 647 648 // A token to retrieve next page of results. 649 string next_page_token = 2; 650 651 // Locations that could not be reached. 652 repeated string unreachable = 3; 653} 654 655// Gets a VPN connection. 656message GetVpnConnectionRequest { 657 // Required. The resource name of the vpn connection. 658 string name = 1 [ 659 (google.api.field_behavior) = REQUIRED, 660 (google.api.resource_reference) = { 661 type: "edgecontainer.googleapis.com/VpnConnection" 662 } 663 ]; 664} 665 666// Creates a VPN connection. 667message CreateVpnConnectionRequest { 668 // Required. The parent location where this vpn connection will be created. 669 string parent = 1 [ 670 (google.api.field_behavior) = REQUIRED, 671 (google.api.resource_reference) = { 672 child_type: "edgecontainer.googleapis.com/VpnConnection" 673 } 674 ]; 675 676 // Required. The VPN connection identifier. 677 string vpn_connection_id = 2 [(google.api.field_behavior) = REQUIRED]; 678 679 // Required. The VPN connection to create. 680 VpnConnection vpn_connection = 3 [(google.api.field_behavior) = REQUIRED]; 681 682 // A unique identifier for this request. Restricted to 36 ASCII characters. A 683 // random UUID is recommended. This request is only idempotent if 684 // `request_id` is provided. 685 string request_id = 4; 686} 687 688// Deletes a vpn connection. 689message DeleteVpnConnectionRequest { 690 // Required. The resource name of the vpn connection. 691 string name = 1 [ 692 (google.api.field_behavior) = REQUIRED, 693 (google.api.resource_reference) = { 694 type: "edgecontainer.googleapis.com/VpnConnection" 695 } 696 ]; 697 698 // A unique identifier for this request. Restricted to 36 ASCII characters. A 699 // random UUID is recommended. This request is only idempotent if 700 // `request_id` is provided. 701 string request_id = 2; 702} 703 704// Gets the server config. 705message GetServerConfigRequest { 706 // Required. The name (project and location) of the server config to get, 707 // specified in the format `projects/*/locations/*`. 708 string name = 1 [ 709 (google.api.field_behavior) = REQUIRED, 710 (google.api.resource_reference) = { 711 type: "locations.googleapis.com/Location" 712 } 713 ]; 714} 715