vpc_access.proto 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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.vpcaccess.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/longrunning/operations.proto";
  21. import "google/protobuf/timestamp.proto";
  22. option csharp_namespace = "Google.Cloud.VpcAccess.V1";
  23. option go_package = "google.golang.org/genproto/googleapis/cloud/vpcaccess/v1;vpcaccess";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "VpcAccessProto";
  26. option java_package = "com.google.cloud.vpcaccess.v1";
  27. option php_namespace = "Google\\Cloud\\VpcAccess\\V1";
  28. option ruby_package = "Google::Cloud::VpcAccess::V1";
  29. // Serverless VPC Access API allows users to create and manage connectors for
  30. // App Engine, Cloud Functions and Cloud Run to have internal connections to
  31. // Virtual Private Cloud networks.
  32. service VpcAccessService {
  33. option (google.api.default_host) = "vpcaccess.googleapis.com";
  34. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  35. // Creates a Serverless VPC Access connector, returns an operation.
  36. rpc CreateConnector(CreateConnectorRequest) returns (google.longrunning.Operation) {
  37. option (google.api.http) = {
  38. post: "/v1/{parent=projects/*/locations/*}/connectors"
  39. body: "connector"
  40. };
  41. option (google.api.method_signature) = "parent,connector_id,connector";
  42. option (google.longrunning.operation_info) = {
  43. response_type: "Connector"
  44. metadata_type: "OperationMetadata"
  45. };
  46. }
  47. // Gets a Serverless VPC Access connector. Returns NOT_FOUND if the resource
  48. // does not exist.
  49. rpc GetConnector(GetConnectorRequest) returns (Connector) {
  50. option (google.api.http) = {
  51. get: "/v1/{name=projects/*/locations/*/connectors/*}"
  52. };
  53. option (google.api.method_signature) = "name";
  54. }
  55. // Lists Serverless VPC Access connectors.
  56. rpc ListConnectors(ListConnectorsRequest) returns (ListConnectorsResponse) {
  57. option (google.api.http) = {
  58. get: "/v1/{parent=projects/*/locations/*}/connectors"
  59. };
  60. option (google.api.method_signature) = "parent";
  61. }
  62. // Deletes a Serverless VPC Access connector. Returns NOT_FOUND if the
  63. // resource does not exist.
  64. rpc DeleteConnector(DeleteConnectorRequest) returns (google.longrunning.Operation) {
  65. option (google.api.http) = {
  66. delete: "/v1/{name=projects/*/locations/*/connectors/*}"
  67. };
  68. option (google.api.method_signature) = "name";
  69. option (google.longrunning.operation_info) = {
  70. response_type: "google.protobuf.Empty"
  71. metadata_type: "OperationMetadata"
  72. };
  73. }
  74. }
  75. // Definition of a Serverless VPC Access connector.
  76. message Connector {
  77. option (google.api.resource) = {
  78. type: "vpcaccess.googleapis.com/Connector"
  79. pattern: "projects/{project}/locations/{location}/connectors/{connector}"
  80. };
  81. // State of a connector.
  82. enum State {
  83. // Invalid state.
  84. STATE_UNSPECIFIED = 0;
  85. // Connector is deployed and ready to receive traffic.
  86. READY = 1;
  87. // An Insert operation is in progress. Transient condition.
  88. CREATING = 2;
  89. // A Delete operation is in progress. Transient condition.
  90. DELETING = 3;
  91. // Connector is in a bad state, manual deletion recommended.
  92. ERROR = 4;
  93. // The connector is being updated.
  94. UPDATING = 5;
  95. }
  96. // The subnet in which to house the connector
  97. message Subnet {
  98. // Subnet name (relative, not fully qualified).
  99. // E.g. if the full subnet selfLink is
  100. // https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetName}
  101. // the correct input for this field would be {subnetName}
  102. string name = 1;
  103. // Project in which the subnet exists.
  104. // If not set, this project is assumed to be the project for which
  105. // the connector create request was issued.
  106. string project_id = 2;
  107. }
  108. // The resource name in the format `projects/*/locations/*/connectors/*`.
  109. string name = 1;
  110. // Name of a VPC network.
  111. string network = 2;
  112. // The range of internal addresses that follows RFC 4632 notation.
  113. // Example: `10.132.0.0/28`.
  114. string ip_cidr_range = 3;
  115. // Output only. State of the VPC access connector.
  116. State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  117. // Minimum throughput of the connector in Mbps. Default and min is 200.
  118. int32 min_throughput = 5;
  119. // Maximum throughput of the connector in Mbps. Default is 300, max is 1000.
  120. int32 max_throughput = 6;
  121. // Output only. List of projects using the connector.
  122. repeated string connected_projects = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  123. // The subnet in which to house the VPC Access Connector.
  124. Subnet subnet = 8;
  125. // Machine type of VM Instance underlying connector. Default is e2-micro
  126. string machine_type = 10;
  127. // Minimum value of instances in autoscaling group underlying the connector.
  128. int32 min_instances = 11;
  129. // Maximum value of instances in autoscaling group underlying the connector.
  130. int32 max_instances = 12;
  131. }
  132. // Request for creating a Serverless VPC Access connector.
  133. message CreateConnectorRequest {
  134. // Required. The project and location in which the configuration should be created,
  135. // specified in the format `projects/*/locations/*`.
  136. string parent = 1 [
  137. (google.api.field_behavior) = REQUIRED,
  138. (google.api.resource_reference) = {
  139. type: "locations.googleapis.com/Location"
  140. }
  141. ];
  142. // Required. The ID to use for this connector.
  143. string connector_id = 2 [(google.api.field_behavior) = REQUIRED];
  144. // Required. Resource to create.
  145. Connector connector = 3 [(google.api.field_behavior) = REQUIRED];
  146. }
  147. // Request for getting a Serverless VPC Access connector.
  148. message GetConnectorRequest {
  149. // Required. Name of a Serverless VPC Access connector to get.
  150. string name = 1 [
  151. (google.api.field_behavior) = REQUIRED,
  152. (google.api.resource_reference) = {
  153. type: "vpcaccess.googleapis.com/Connector"
  154. }
  155. ];
  156. }
  157. // Request for listing Serverless VPC Access connectors in a location.
  158. message ListConnectorsRequest {
  159. // Required. The project and location from which the routes should be listed.
  160. string parent = 1 [
  161. (google.api.field_behavior) = REQUIRED,
  162. (google.api.resource_reference) = {
  163. type: "locations.googleapis.com/Location"
  164. }
  165. ];
  166. // Maximum number of functions to return per call.
  167. int32 page_size = 2;
  168. // Continuation token.
  169. string page_token = 3;
  170. }
  171. // Response for listing Serverless VPC Access connectors.
  172. message ListConnectorsResponse {
  173. // List of Serverless VPC Access connectors.
  174. repeated Connector connectors = 1;
  175. // Continuation token.
  176. string next_page_token = 2;
  177. }
  178. // Request for deleting a Serverless VPC Access connector.
  179. message DeleteConnectorRequest {
  180. // Required. Name of a Serverless VPC Access connector to delete.
  181. string name = 1 [
  182. (google.api.field_behavior) = REQUIRED,
  183. (google.api.resource_reference) = {
  184. type: "vpcaccess.googleapis.com/Connector"
  185. }
  186. ];
  187. }
  188. // Metadata for google.longrunning.Operation.
  189. message OperationMetadata {
  190. // Output only. Method that initiated the operation e.g.
  191. // google.cloud.vpcaccess.v1.Connectors.CreateConnector.
  192. string method = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  193. // Output only. Time when the operation was created.
  194. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  195. // Output only. Time when the operation completed.
  196. google.protobuf.Timestamp end_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  197. // Output only. Name of the resource that this operation is acting on e.g.
  198. // projects/my-project/locations/us-central1/connectors/v1.
  199. string target = 5 [
  200. (google.api.field_behavior) = OUTPUT_ONLY,
  201. (google.api.resource_reference) = {
  202. type: "vpcaccess.googleapis.com/Connector"
  203. }
  204. ];
  205. }