service.proto 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  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.edgecontainer.v1;
  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/cloud/edgecontainer/v1/resources.proto";
  21. import "google/longrunning/operations.proto";
  22. import "google/protobuf/field_mask.proto";
  23. import "google/protobuf/timestamp.proto";
  24. option go_package = "google.golang.org/genproto/googleapis/cloud/edgecontainer/v1;edgecontainer";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "ServiceProto";
  27. option java_package = "com.google.cloud.edgecontainer.v1";
  28. // EdgeContainer API provides management of Kubernetes Clusters on Google Edge
  29. // Cloud deployments.
  30. service EdgeContainer {
  31. option (google.api.default_host) = "edgecontainer.googleapis.com";
  32. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  33. // Lists Clusters in a given project and location.
  34. rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) {
  35. option (google.api.http) = {
  36. get: "/v1/{parent=projects/*/locations/*}/clusters"
  37. };
  38. option (google.api.method_signature) = "parent";
  39. }
  40. // Gets details of a single Cluster.
  41. rpc GetCluster(GetClusterRequest) returns (Cluster) {
  42. option (google.api.http) = {
  43. get: "/v1/{name=projects/*/locations/*/clusters/*}"
  44. };
  45. option (google.api.method_signature) = "name";
  46. }
  47. // Creates a new Cluster in a given project and location.
  48. rpc CreateCluster(CreateClusterRequest) returns (google.longrunning.Operation) {
  49. option (google.api.http) = {
  50. post: "/v1/{parent=projects/*/locations/*}/clusters"
  51. body: "cluster"
  52. };
  53. option (google.api.method_signature) = "parent,cluster,cluster_id";
  54. option (google.longrunning.operation_info) = {
  55. response_type: "Cluster"
  56. metadata_type: "OperationMetadata"
  57. };
  58. }
  59. // Updates the parameters of a single Cluster.
  60. rpc UpdateCluster(UpdateClusterRequest) returns (google.longrunning.Operation) {
  61. option (google.api.http) = {
  62. patch: "/v1/{cluster.name=projects/*/locations/*/clusters/*}"
  63. body: "cluster"
  64. };
  65. option (google.api.method_signature) = "cluster,update_mask";
  66. option (google.longrunning.operation_info) = {
  67. response_type: "Cluster"
  68. metadata_type: "OperationMetadata"
  69. };
  70. }
  71. // Deletes a single Cluster.
  72. rpc DeleteCluster(DeleteClusterRequest) returns (google.longrunning.Operation) {
  73. option (google.api.http) = {
  74. delete: "/v1/{name=projects/*/locations/*/clusters/*}"
  75. };
  76. option (google.api.method_signature) = "name";
  77. option (google.longrunning.operation_info) = {
  78. response_type: "google.protobuf.Empty"
  79. metadata_type: "OperationMetadata"
  80. };
  81. }
  82. // Generates an access token for a Cluster.
  83. rpc GenerateAccessToken(GenerateAccessTokenRequest) returns (GenerateAccessTokenResponse) {
  84. option (google.api.http) = {
  85. get: "/v1/{cluster=projects/*/locations/*/clusters/*}:generateAccessToken"
  86. };
  87. option (google.api.method_signature) = "cluster";
  88. }
  89. // Lists NodePools in a given project and location.
  90. rpc ListNodePools(ListNodePoolsRequest) returns (ListNodePoolsResponse) {
  91. option (google.api.http) = {
  92. get: "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools"
  93. };
  94. option (google.api.method_signature) = "parent";
  95. }
  96. // Gets details of a single NodePool.
  97. rpc GetNodePool(GetNodePoolRequest) returns (NodePool) {
  98. option (google.api.http) = {
  99. get: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}"
  100. };
  101. option (google.api.method_signature) = "name";
  102. }
  103. // Creates a new NodePool in a given project and location.
  104. rpc CreateNodePool(CreateNodePoolRequest) returns (google.longrunning.Operation) {
  105. option (google.api.http) = {
  106. post: "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools"
  107. body: "node_pool"
  108. };
  109. option (google.api.method_signature) = "parent,node_pool,node_pool_id";
  110. option (google.longrunning.operation_info) = {
  111. response_type: "NodePool"
  112. metadata_type: "OperationMetadata"
  113. };
  114. }
  115. // Updates the parameters of a single NodePool.
  116. rpc UpdateNodePool(UpdateNodePoolRequest) returns (google.longrunning.Operation) {
  117. option (google.api.http) = {
  118. patch: "/v1/{node_pool.name=projects/*/locations/*/clusters/*/nodePools/*}"
  119. body: "node_pool"
  120. };
  121. option (google.api.method_signature) = "node_pool,update_mask";
  122. option (google.longrunning.operation_info) = {
  123. response_type: "NodePool"
  124. metadata_type: "OperationMetadata"
  125. };
  126. }
  127. // Deletes a single NodePool.
  128. rpc DeleteNodePool(DeleteNodePoolRequest) returns (google.longrunning.Operation) {
  129. option (google.api.http) = {
  130. delete: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}"
  131. };
  132. option (google.api.method_signature) = "name";
  133. option (google.longrunning.operation_info) = {
  134. response_type: "google.protobuf.Empty"
  135. metadata_type: "OperationMetadata"
  136. };
  137. }
  138. // Lists Machines in a given project and location.
  139. rpc ListMachines(ListMachinesRequest) returns (ListMachinesResponse) {
  140. option (google.api.http) = {
  141. get: "/v1/{parent=projects/*/locations/*}/machines"
  142. };
  143. option (google.api.method_signature) = "parent";
  144. }
  145. // Gets details of a single Machine.
  146. rpc GetMachine(GetMachineRequest) returns (Machine) {
  147. option (google.api.http) = {
  148. get: "/v1/{name=projects/*/locations/*/machines/*}"
  149. };
  150. option (google.api.method_signature) = "name";
  151. }
  152. // Lists VPN connections in a given project and location.
  153. rpc ListVpnConnections(ListVpnConnectionsRequest) returns (ListVpnConnectionsResponse) {
  154. option (google.api.http) = {
  155. get: "/v1/{parent=projects/*/locations/*}/vpnConnections"
  156. };
  157. option (google.api.method_signature) = "parent";
  158. }
  159. // Gets details of a single VPN connection.
  160. rpc GetVpnConnection(GetVpnConnectionRequest) returns (VpnConnection) {
  161. option (google.api.http) = {
  162. get: "/v1/{name=projects/*/locations/*/vpnConnections/*}"
  163. };
  164. option (google.api.method_signature) = "name";
  165. }
  166. // Creates a new VPN connection in a given project and location.
  167. rpc CreateVpnConnection(CreateVpnConnectionRequest) returns (google.longrunning.Operation) {
  168. option (google.api.http) = {
  169. post: "/v1/{parent=projects/*/locations/*}/vpnConnections"
  170. body: "vpn_connection"
  171. };
  172. option (google.api.method_signature) = "parent,vpn_connection,vpn_connection_id";
  173. option (google.longrunning.operation_info) = {
  174. response_type: "VpnConnection"
  175. metadata_type: "OperationMetadata"
  176. };
  177. }
  178. // Deletes a single VPN connection.
  179. rpc DeleteVpnConnection(DeleteVpnConnectionRequest) returns (google.longrunning.Operation) {
  180. option (google.api.http) = {
  181. delete: "/v1/{name=projects/*/locations/*/vpnConnections/*}"
  182. };
  183. option (google.api.method_signature) = "name";
  184. option (google.longrunning.operation_info) = {
  185. response_type: "google.protobuf.Empty"
  186. metadata_type: "OperationMetadata"
  187. };
  188. }
  189. }
  190. // Long-running operation metadata for Edge Container API methods.
  191. message OperationMetadata {
  192. // The time the operation was created.
  193. google.protobuf.Timestamp create_time = 1;
  194. // The time the operation finished running.
  195. google.protobuf.Timestamp end_time = 2;
  196. // Server-defined resource path for the target of the operation.
  197. string target = 3;
  198. // The verb executed by the operation.
  199. string verb = 4;
  200. // Human-readable status of the operation, if any.
  201. string status_message = 5;
  202. // Identifies whether the user has requested cancellation of the operation.
  203. // Operations that have successfully been cancelled have [Operation.error][]
  204. // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
  205. // `Code.CANCELLED`.
  206. bool requested_cancellation = 6;
  207. // API version used to start the operation.
  208. string api_version = 7;
  209. }
  210. // Lists clusters in a location.
  211. message ListClustersRequest {
  212. // Required. The parent location, which owns this collection of clusters.
  213. string parent = 1 [
  214. (google.api.field_behavior) = REQUIRED,
  215. (google.api.resource_reference) = {
  216. child_type: "edgecontainer.googleapis.com/Cluster"
  217. }
  218. ];
  219. // The maximum number of resources to list.
  220. int32 page_size = 2;
  221. // A page token received from previous list request.
  222. // A page token received from previous list request.
  223. string page_token = 3;
  224. // Only resources matching this filter will be listed.
  225. string filter = 4;
  226. // Specifies the order in which resources will be listed.
  227. string order_by = 5;
  228. }
  229. // List of clusters in a location.
  230. message ListClustersResponse {
  231. // Clusters in the location.
  232. repeated Cluster clusters = 1;
  233. // A token to retrieve next page of results.
  234. string next_page_token = 2;
  235. // Locations that could not be reached.
  236. repeated string unreachable = 3;
  237. }
  238. // Gets a cluster.
  239. message GetClusterRequest {
  240. // Required. The resource name of the cluster.
  241. string name = 1 [
  242. (google.api.field_behavior) = REQUIRED,
  243. (google.api.resource_reference) = {
  244. type: "edgecontainer.googleapis.com/Cluster"
  245. }
  246. ];
  247. }
  248. // Creates a cluster.
  249. message CreateClusterRequest {
  250. // Required. The parent location where this cluster will be created.
  251. string parent = 1 [
  252. (google.api.field_behavior) = REQUIRED,
  253. (google.api.resource_reference) = {
  254. child_type: "edgecontainer.googleapis.com/Cluster"
  255. }
  256. ];
  257. // Required. A client-specified unique identifier for the cluster.
  258. string cluster_id = 2 [(google.api.field_behavior) = REQUIRED];
  259. // Required. The cluster to create.
  260. Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED];
  261. // A unique identifier for this request. Restricted to 36 ASCII characters. A
  262. // random UUID is recommended. This request is only idempotent if
  263. // `request_id` is provided.
  264. string request_id = 4;
  265. }
  266. // Updates a cluster.
  267. message UpdateClusterRequest {
  268. // Field mask is used to specify the fields to be overwritten in the
  269. // Cluster resource by the update.
  270. // The fields specified in the update_mask are relative to the resource, not
  271. // the full request. A field will be overwritten if it is in the mask. If the
  272. // user does not provide a mask then all fields will be overwritten.
  273. google.protobuf.FieldMask update_mask = 1;
  274. // The updated cluster.
  275. Cluster cluster = 2;
  276. // A unique identifier for this request. Restricted to 36 ASCII characters.
  277. // A random UUID is recommended.
  278. // This request is only idempotent if `request_id` is provided.
  279. string request_id = 3;
  280. }
  281. // Deletes a cluster.
  282. message DeleteClusterRequest {
  283. // Required. The resource name of the cluster.
  284. string name = 1 [
  285. (google.api.field_behavior) = REQUIRED,
  286. (google.api.resource_reference) = {
  287. type: "edgecontainer.googleapis.com/Cluster"
  288. }
  289. ];
  290. // A unique identifier for this request. Restricted to 36 ASCII characters. A
  291. // random UUID is recommended. This request is only idempotent if
  292. // `request_id` is provided.
  293. string request_id = 2;
  294. }
  295. // Generates an access token for a cluster.
  296. message GenerateAccessTokenRequest {
  297. // Required. The resource name of the cluster.
  298. string cluster = 1 [
  299. (google.api.field_behavior) = REQUIRED,
  300. (google.api.resource_reference) = {
  301. type: "edgecontainer.googleapis.com/Cluster"
  302. }
  303. ];
  304. }
  305. // An access token for a cluster.
  306. message GenerateAccessTokenResponse {
  307. // Output only. Access token to authenticate to k8s api-server.
  308. string access_token = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  309. // Output only. Timestamp at which the token will expire.
  310. google.protobuf.Timestamp expire_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  311. }
  312. // Lists node pools in a cluster.
  313. message ListNodePoolsRequest {
  314. // Required. The parent cluster, which owns this collection of node pools.
  315. string parent = 1 [
  316. (google.api.field_behavior) = REQUIRED,
  317. (google.api.resource_reference) = {
  318. child_type: "edgecontainer.googleapis.com/NodePool"
  319. }
  320. ];
  321. // The maximum number of resources to list.
  322. int32 page_size = 2;
  323. // A page token received from previous list request.
  324. string page_token = 3;
  325. // Only resources matching this filter will be listed.
  326. string filter = 4;
  327. // Specifies the order in which resources will be listed.
  328. string order_by = 5;
  329. }
  330. // List of node pools in a cluster.
  331. message ListNodePoolsResponse {
  332. // Node pools in the cluster.
  333. repeated NodePool node_pools = 1;
  334. // A token to retrieve next page of results.
  335. string next_page_token = 2;
  336. // Locations that could not be reached.
  337. repeated string unreachable = 3;
  338. }
  339. // Gets a node pool.
  340. message GetNodePoolRequest {
  341. // Required. The resource name of the node pool.
  342. string name = 1 [
  343. (google.api.field_behavior) = REQUIRED,
  344. (google.api.resource_reference) = {
  345. type: "edgecontainer.googleapis.com/NodePool"
  346. }
  347. ];
  348. }
  349. // Creates a node pool.
  350. message CreateNodePoolRequest {
  351. // Required. The parent cluster where this node pool will be created.
  352. string parent = 1 [
  353. (google.api.field_behavior) = REQUIRED,
  354. (google.api.resource_reference) = {
  355. child_type: "edgecontainer.googleapis.com/NodePool"
  356. }
  357. ];
  358. // Required. A client-specified unique identifier for the node pool.
  359. string node_pool_id = 2 [(google.api.field_behavior) = REQUIRED];
  360. // Required. The node pool to create.
  361. NodePool node_pool = 3 [(google.api.field_behavior) = REQUIRED];
  362. // A unique identifier for this request. Restricted to 36 ASCII characters. A
  363. // random UUID is recommended. This request is only idempotent if
  364. // `request_id` is provided.
  365. string request_id = 4;
  366. }
  367. // Updates a node pool.
  368. message UpdateNodePoolRequest {
  369. // Field mask is used to specify the fields to be overwritten in the
  370. // NodePool resource by the update.
  371. // The fields specified in the update_mask are relative to the resource, not
  372. // the full request. A field will be overwritten if it is in the mask. If the
  373. // user does not provide a mask then all fields will be overwritten.
  374. google.protobuf.FieldMask update_mask = 1;
  375. // The updated node pool.
  376. NodePool node_pool = 2;
  377. // A unique identifier for this request. Restricted to 36 ASCII characters. A
  378. // random UUID is recommended. This request is only idempotent if
  379. // `request_id` is provided.
  380. string request_id = 3;
  381. }
  382. // Deletes a node pool.
  383. message DeleteNodePoolRequest {
  384. // Required. The resource name of the node pool.
  385. string name = 1 [
  386. (google.api.field_behavior) = REQUIRED,
  387. (google.api.resource_reference) = {
  388. type: "edgecontainer.googleapis.com/NodePool"
  389. }
  390. ];
  391. // A unique identifier for this request. Restricted to 36 ASCII characters. A
  392. // random UUID is recommended. This request is only idempotent if
  393. // `request_id` is provided.
  394. string request_id = 2;
  395. }
  396. // Lists machines in a site.
  397. message ListMachinesRequest {
  398. // Required. The parent site, which owns this collection of machines.
  399. string parent = 1 [
  400. (google.api.field_behavior) = REQUIRED,
  401. (google.api.resource_reference) = {
  402. child_type: "edgecontainer.googleapis.com/Machine"
  403. }
  404. ];
  405. // The maximum number of resources to list.
  406. int32 page_size = 2;
  407. // A page token received from previous list request.
  408. string page_token = 3;
  409. // Only resources matching this filter will be listed.
  410. string filter = 4;
  411. // Specifies the order in which resources will be listed.
  412. string order_by = 5;
  413. }
  414. // List of machines in a site.
  415. message ListMachinesResponse {
  416. // Machines in the site.
  417. repeated Machine machines = 1;
  418. // A token to retrieve next page of results.
  419. string next_page_token = 2;
  420. // Locations that could not be reached.
  421. repeated string unreachable = 3;
  422. }
  423. // Gets a machine.
  424. message GetMachineRequest {
  425. // Required. The resource name of the machine.
  426. string name = 1 [
  427. (google.api.field_behavior) = REQUIRED,
  428. (google.api.resource_reference) = {
  429. type: "edgecontainer.googleapis.com/Machine"
  430. }
  431. ];
  432. }
  433. // Lists VPN connections.
  434. message ListVpnConnectionsRequest {
  435. // Required. The parent location, which owns this collection of VPN connections.
  436. string parent = 1 [
  437. (google.api.field_behavior) = REQUIRED,
  438. (google.api.resource_reference) = {
  439. child_type: "edgecontainer.googleapis.com/VpnConnection"
  440. }
  441. ];
  442. // The maximum number of resources to list.
  443. int32 page_size = 2;
  444. // A page token received from previous list request.
  445. string page_token = 3;
  446. // Only resources matching this filter will be listed.
  447. string filter = 4;
  448. // Specifies the order in which resources will be listed.
  449. string order_by = 5;
  450. }
  451. // List of VPN connections in a location.
  452. message ListVpnConnectionsResponse {
  453. // VpnConnections in the location.
  454. repeated VpnConnection vpn_connections = 1;
  455. // A token to retrieve next page of results.
  456. string next_page_token = 2;
  457. // Locations that could not be reached.
  458. repeated string unreachable = 3;
  459. }
  460. // Gets a VPN connection.
  461. message GetVpnConnectionRequest {
  462. // Required. The resource name of the vpn connection.
  463. string name = 1 [
  464. (google.api.field_behavior) = REQUIRED,
  465. (google.api.resource_reference) = {
  466. type: "edgecontainer.googleapis.com/VpnConnection"
  467. }
  468. ];
  469. }
  470. // Creates a VPN connection.
  471. message CreateVpnConnectionRequest {
  472. // Required. The parent location where this vpn connection will be created.
  473. string parent = 1 [
  474. (google.api.field_behavior) = REQUIRED,
  475. (google.api.resource_reference) = {
  476. child_type: "edgecontainer.googleapis.com/VpnConnection"
  477. }
  478. ];
  479. // Required. The VPN connection identifier.
  480. string vpn_connection_id = 2 [(google.api.field_behavior) = REQUIRED];
  481. // Required. The VPN connection to create.
  482. VpnConnection vpn_connection = 3 [(google.api.field_behavior) = REQUIRED];
  483. // A unique identifier for this request. Restricted to 36 ASCII characters. A
  484. // random UUID is recommended. This request is only idempotent if
  485. // `request_id` is provided.
  486. string request_id = 4;
  487. }
  488. // Deletes a vpn connection.
  489. message DeleteVpnConnectionRequest {
  490. // Required. The resource name of the vpn connection.
  491. string name = 1 [
  492. (google.api.field_behavior) = REQUIRED,
  493. (google.api.resource_reference) = {
  494. type: "edgecontainer.googleapis.com/VpnConnection"
  495. }
  496. ];
  497. // A unique identifier for this request. Restricted to 36 ASCII characters. A
  498. // random UUID is recommended. This request is only idempotent if
  499. // `request_id` is provided.
  500. string request_id = 2;
  501. }