apigateway.proto 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. // Copyright 2021 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.apigateway.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/field_mask.proto";
  19. import "google/protobuf/timestamp.proto";
  20. import "google/api/annotations.proto";
  21. option csharp_namespace = "Google.Cloud.ApiGateway.V1";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/apigateway/v1;apigateway";
  23. option java_multiple_files = true;
  24. option java_package = "com.google.cloud.apigateway.v1";
  25. option php_namespace = "Google\\Cloud\\ApiGateway\\V1";
  26. option ruby_package = "Google::Cloud::ApiGateway::V1";
  27. option (google.api.resource_definition) = {
  28. type: "iam.googleapis.com/ServiceAccount"
  29. pattern: "projects/{project}/serviceAccounts/{service_account}"
  30. };
  31. option (google.api.resource_definition) = {
  32. type: "servicemanagement.googleapis.com/ManagedService"
  33. pattern: "services/{service}"
  34. };
  35. option (google.api.resource_definition) = {
  36. type: "servicemanagement.googleapis.com/Service"
  37. pattern: "services/{service}/configs/{config}"
  38. };
  39. // An API that can be served by one or more Gateways.
  40. message Api {
  41. option (google.api.resource) = {
  42. type: "apigateway.googleapis.com/Api"
  43. pattern: "projects/{project}/locations/global/apis/{api}"
  44. };
  45. // All the possible API states.
  46. enum State {
  47. // API does not have a state yet.
  48. STATE_UNSPECIFIED = 0;
  49. // API is being created.
  50. CREATING = 1;
  51. // API is active.
  52. ACTIVE = 2;
  53. // API creation failed.
  54. FAILED = 3;
  55. // API is being deleted.
  56. DELETING = 4;
  57. // API is being updated.
  58. UPDATING = 5;
  59. }
  60. // Output only. Resource name of the API.
  61. // Format: projects/{project}/locations/global/apis/{api}
  62. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  63. // Output only. Created time.
  64. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  65. // Output only. Updated time.
  66. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  67. // Optional. Resource labels to represent user-provided metadata.
  68. // Refer to cloud documentation on labels for more details.
  69. // https://cloud.google.com/compute/docs/labeling-resources
  70. map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];
  71. // Optional. Display name.
  72. string display_name = 5 [(google.api.field_behavior) = OPTIONAL];
  73. // Optional. Immutable. The name of a Google Managed Service (
  74. // https://cloud.google.com/service-infrastructure/docs/glossary#managed). If
  75. // not specified, a new Service will automatically be created in the same
  76. // project as this API.
  77. string managed_service = 7 [
  78. (google.api.field_behavior) = IMMUTABLE,
  79. (google.api.field_behavior) = OPTIONAL,
  80. (google.api.resource_reference) = {
  81. type: "servicemanagement.googleapis.com/ManagedService"
  82. }
  83. ];
  84. // Output only. State of the API.
  85. State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  86. }
  87. // An API Configuration is a combination of settings for both the Managed
  88. // Service and Gateways serving this API Config.
  89. message ApiConfig {
  90. option (google.api.resource) = {
  91. type: "apigateway.googleapis.com/ApiConfig"
  92. pattern: "projects/{project}/locations/global/apis/{api}/configs/{api_config}"
  93. };
  94. // A lightweight description of a file.
  95. message File {
  96. // The file path (full or relative path). This is typically the path of the
  97. // file when it is uploaded.
  98. string path = 1;
  99. // The bytes that constitute the file.
  100. bytes contents = 2;
  101. }
  102. // An OpenAPI Specification Document describing an API.
  103. message OpenApiDocument {
  104. // The OpenAPI Specification document file.
  105. File document = 1;
  106. }
  107. // A gRPC service definition.
  108. message GrpcServiceDefinition {
  109. // Input only. File descriptor set, generated by protoc.
  110. //
  111. // To generate, use protoc with imports and source info included.
  112. // For an example test.proto file, the following command would put the value
  113. // in a new file named out.pb.
  114. //
  115. // $ protoc --include_imports --include_source_info test.proto -o out.pb
  116. File file_descriptor_set = 1 [(google.api.field_behavior) = INPUT_ONLY];
  117. // Optional. Uncompiled proto files associated with the descriptor set, used for
  118. // display purposes (server-side compilation is not supported). These
  119. // should match the inputs to 'protoc' command used to generate
  120. // file_descriptor_set.
  121. repeated File source = 2 [(google.api.field_behavior) = OPTIONAL];
  122. }
  123. // All the possible API Config states.
  124. enum State {
  125. // API Config does not have a state yet.
  126. STATE_UNSPECIFIED = 0;
  127. // API Config is being created and deployed to the API Controller.
  128. CREATING = 1;
  129. // API Config is ready for use by Gateways.
  130. ACTIVE = 2;
  131. // API Config creation failed.
  132. FAILED = 3;
  133. // API Config is being deleted.
  134. DELETING = 4;
  135. // API Config is being updated.
  136. UPDATING = 5;
  137. // API Config settings are being activated in downstream systems.
  138. // API Configs in this state cannot be used by Gateways.
  139. ACTIVATING = 6;
  140. }
  141. // Output only. Resource name of the API Config.
  142. // Format: projects/{project}/locations/global/apis/{api}/configs/{api_config}
  143. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  144. // Output only. Created time.
  145. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  146. // Output only. Updated time.
  147. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  148. // Optional. Resource labels to represent user-provided metadata.
  149. // Refer to cloud documentation on labels for more details.
  150. // https://cloud.google.com/compute/docs/labeling-resources
  151. map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];
  152. // Optional. Display name.
  153. string display_name = 5 [(google.api.field_behavior) = OPTIONAL];
  154. // Immutable. The Google Cloud IAM Service Account that Gateways serving this config
  155. // should use to authenticate to other services. This may either be the
  156. // Service Account's email
  157. // (`{ACCOUNT_ID}@{PROJECT}.iam.gserviceaccount.com`) or its full resource
  158. // name (`projects/{PROJECT}/accounts/{UNIQUE_ID}`). This is most often used
  159. // when the service is a GCP resource such as a Cloud Run Service or an
  160. // IAP-secured service.
  161. string gateway_service_account = 14 [
  162. (google.api.field_behavior) = IMMUTABLE,
  163. (google.api.resource_reference) = {
  164. type: "iam.googleapis.com/ServiceAccount"
  165. }
  166. ];
  167. // Output only. The ID of the associated Service Config (
  168. // https://cloud.google.com/service-infrastructure/docs/glossary#config).
  169. string service_config_id = 12 [
  170. (google.api.field_behavior) = OUTPUT_ONLY,
  171. (google.api.resource_reference) = {
  172. type: "servicemanagement.googleapis.com/Service"
  173. }
  174. ];
  175. // Output only. State of the API Config.
  176. State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  177. // Optional. OpenAPI specification documents. If specified, grpc_services and
  178. // managed_service_configs must not be included.
  179. repeated OpenApiDocument openapi_documents = 9 [(google.api.field_behavior) = OPTIONAL];
  180. // Optional. gRPC service definition files. If specified, openapi_documents must
  181. // not be included.
  182. repeated GrpcServiceDefinition grpc_services = 10 [(google.api.field_behavior) = OPTIONAL];
  183. // Optional. Service Configuration files. At least one must be included when using gRPC
  184. // service definitions. See
  185. // https://cloud.google.com/endpoints/docs/grpc/grpc-service-config#service_configuration_overview
  186. // for the expected file contents.
  187. //
  188. // If multiple files are specified, the files are merged with the following
  189. // rules:
  190. // * All singular scalar fields are merged using "last one wins" semantics in
  191. // the order of the files uploaded.
  192. // * Repeated fields are concatenated.
  193. // * Singular embedded messages are merged using these rules for nested
  194. // fields.
  195. repeated File managed_service_configs = 11 [(google.api.field_behavior) = OPTIONAL];
  196. }
  197. // A Gateway is an API-aware HTTP proxy. It performs API-Method and/or
  198. // API-Consumer specific actions based on an API Config such as authentication,
  199. // policy enforcement, and backend selection.
  200. message Gateway {
  201. option (google.api.resource) = {
  202. type: "apigateway.googleapis.com/Gateway"
  203. pattern: "projects/{project}/locations/{location}/gateways/{gateway}"
  204. };
  205. // All the possible Gateway states.
  206. enum State {
  207. // Gateway does not have a state yet.
  208. STATE_UNSPECIFIED = 0;
  209. // Gateway is being created.
  210. CREATING = 1;
  211. // Gateway is running and ready for requests.
  212. ACTIVE = 2;
  213. // Gateway creation failed.
  214. FAILED = 3;
  215. // Gateway is being deleted.
  216. DELETING = 4;
  217. // Gateway is being updated.
  218. UPDATING = 5;
  219. }
  220. // Output only. Resource name of the Gateway.
  221. // Format: projects/{project}/locations/{location}/gateways/{gateway}
  222. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  223. // Output only. Created time.
  224. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  225. // Output only. Updated time.
  226. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  227. // Optional. Resource labels to represent user-provided metadata.
  228. // Refer to cloud documentation on labels for more details.
  229. // https://cloud.google.com/compute/docs/labeling-resources
  230. map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];
  231. // Optional. Display name.
  232. string display_name = 5 [(google.api.field_behavior) = OPTIONAL];
  233. // Required. Resource name of the API Config for this Gateway.
  234. // Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig}
  235. string api_config = 6 [
  236. (google.api.field_behavior) = REQUIRED,
  237. (google.api.resource_reference) = {
  238. type: "apigateway.googleapis.com/ApiConfig"
  239. }
  240. ];
  241. // Output only. The current state of the Gateway.
  242. State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  243. // Output only. The default API Gateway host name of the form
  244. // `{gateway_id}-{hash}.{region_code}.gateway.dev`.
  245. string default_hostname = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  246. }
  247. // Request message for ApiGatewayService.ListGateways
  248. message ListGatewaysRequest {
  249. // Required. Parent resource of the Gateway, of the form:
  250. // `projects/*/locations/*`
  251. string parent = 1 [
  252. (google.api.field_behavior) = REQUIRED,
  253. (google.api.resource_reference) = {
  254. type: "locations.googleapis.com/Location"
  255. }
  256. ];
  257. // Page size.
  258. int32 page_size = 2;
  259. // Page token.
  260. string page_token = 3;
  261. // Filter.
  262. string filter = 4;
  263. // Order by parameters.
  264. string order_by = 5;
  265. }
  266. // Response message for ApiGatewayService.ListGateways
  267. message ListGatewaysResponse {
  268. // Gateways.
  269. repeated Gateway gateways = 1;
  270. // Next page token.
  271. string next_page_token = 2;
  272. // Locations that could not be reached.
  273. repeated string unreachable_locations = 3;
  274. }
  275. // Request message for ApiGatewayService.GetGateway
  276. message GetGatewayRequest {
  277. // Required. Resource name of the form:
  278. // `projects/*/locations/*/gateways/*`
  279. string name = 1 [
  280. (google.api.field_behavior) = REQUIRED,
  281. (google.api.resource_reference) = {
  282. type: "apigateway.googleapis.com/Gateway"
  283. }
  284. ];
  285. }
  286. // Request message for ApiGatewayService.CreateGateway
  287. message CreateGatewayRequest {
  288. // Required. Parent resource of the Gateway, of the form:
  289. // `projects/*/locations/*`
  290. string parent = 1 [
  291. (google.api.field_behavior) = REQUIRED,
  292. (google.api.resource_reference) = {
  293. type: "locations.googleapis.com/Location"
  294. }
  295. ];
  296. // Required. Identifier to assign to the Gateway. Must be unique within scope of
  297. // the parent resource.
  298. string gateway_id = 2 [(google.api.field_behavior) = REQUIRED];
  299. // Required. Gateway resource.
  300. Gateway gateway = 3 [(google.api.field_behavior) = REQUIRED];
  301. }
  302. // Request message for ApiGatewayService.UpdateGateway
  303. message UpdateGatewayRequest {
  304. // Field mask is used to specify the fields to be overwritten in the
  305. // Gateway resource by the update.
  306. // The fields specified in the update_mask are relative to the resource, not
  307. // the full request. A field will be overwritten if it is in the mask. If the
  308. // user does not provide a mask then all fields will be overwritten.
  309. google.protobuf.FieldMask update_mask = 1;
  310. // Required. Gateway resource.
  311. Gateway gateway = 2 [(google.api.field_behavior) = REQUIRED];
  312. }
  313. // Request message for ApiGatewayService.DeleteGateway
  314. message DeleteGatewayRequest {
  315. // Required. Resource name of the form:
  316. // `projects/*/locations/*/gateways/*`
  317. string name = 1 [
  318. (google.api.field_behavior) = REQUIRED,
  319. (google.api.resource_reference) = {
  320. type: "apigateway.googleapis.com/Gateway"
  321. }
  322. ];
  323. }
  324. // Request message for ApiGatewayService.ListApis
  325. message ListApisRequest {
  326. // Required. Parent resource of the API, of the form:
  327. // `projects/*/locations/global`
  328. string parent = 1 [
  329. (google.api.field_behavior) = REQUIRED,
  330. (google.api.resource_reference) = {
  331. type: "locations.googleapis.com/Location"
  332. }
  333. ];
  334. // Page size.
  335. int32 page_size = 2;
  336. // Page token.
  337. string page_token = 3;
  338. // Filter.
  339. string filter = 4;
  340. // Order by parameters.
  341. string order_by = 5;
  342. }
  343. // Response message for ApiGatewayService.ListApis
  344. message ListApisResponse {
  345. // APIs.
  346. repeated Api apis = 1;
  347. // Next page token.
  348. string next_page_token = 2;
  349. // Locations that could not be reached.
  350. repeated string unreachable_locations = 3;
  351. }
  352. // Request message for ApiGatewayService.GetApi
  353. message GetApiRequest {
  354. // Required. Resource name of the form:
  355. // `projects/*/locations/global/apis/*`
  356. string name = 1 [
  357. (google.api.field_behavior) = REQUIRED,
  358. (google.api.resource_reference) = {
  359. type: "apigateway.googleapis.com/Api"
  360. }
  361. ];
  362. }
  363. // Request message for ApiGatewayService.CreateApi
  364. message CreateApiRequest {
  365. // Required. Parent resource of the API, of the form:
  366. // `projects/*/locations/global`
  367. string parent = 1 [
  368. (google.api.field_behavior) = REQUIRED,
  369. (google.api.resource_reference) = {
  370. type: "locations.googleapis.com/Location"
  371. }
  372. ];
  373. // Required. Identifier to assign to the API. Must be unique within scope of
  374. // the parent resource.
  375. string api_id = 2 [(google.api.field_behavior) = REQUIRED];
  376. // Required. API resource.
  377. Api api = 3 [(google.api.field_behavior) = REQUIRED];
  378. }
  379. // Request message for ApiGatewayService.UpdateApi
  380. message UpdateApiRequest {
  381. // Field mask is used to specify the fields to be overwritten in the
  382. // Api resource by the update.
  383. // The fields specified in the update_mask are relative to the resource, not
  384. // the full request. A field will be overwritten if it is in the mask. If the
  385. // user does not provide a mask then all fields will be overwritten.
  386. google.protobuf.FieldMask update_mask = 1;
  387. // Required. API resource.
  388. Api api = 2 [(google.api.field_behavior) = REQUIRED];
  389. }
  390. // Request message for ApiGatewayService.DeleteApi
  391. message DeleteApiRequest {
  392. // Required. Resource name of the form:
  393. // `projects/*/locations/global/apis/*`
  394. string name = 1 [
  395. (google.api.field_behavior) = REQUIRED,
  396. (google.api.resource_reference) = {
  397. type: "apigateway.googleapis.com/Api"
  398. }
  399. ];
  400. }
  401. // Request message for ApiGatewayService.ListApiConfigs
  402. message ListApiConfigsRequest {
  403. // Required. Parent resource of the API Config, of the form:
  404. // `projects/*/locations/global/apis/*`
  405. string parent = 1 [
  406. (google.api.field_behavior) = REQUIRED,
  407. (google.api.resource_reference) = {
  408. type: "apigateway.googleapis.com/Api"
  409. }
  410. ];
  411. // Page size.
  412. int32 page_size = 2;
  413. // Page token.
  414. string page_token = 3;
  415. // Filter.
  416. string filter = 4;
  417. // Order by parameters.
  418. string order_by = 5;
  419. }
  420. // Response message for ApiGatewayService.ListApiConfigs
  421. message ListApiConfigsResponse {
  422. // API Configs.
  423. repeated ApiConfig api_configs = 1;
  424. // Next page token.
  425. string next_page_token = 2;
  426. // Locations that could not be reached.
  427. repeated string unreachable_locations = 3;
  428. }
  429. // Request message for ApiGatewayService.GetApiConfig
  430. message GetApiConfigRequest {
  431. // Enum to control which fields should be included in the response.
  432. enum ConfigView {
  433. CONFIG_VIEW_UNSPECIFIED = 0;
  434. // Do not include configuration source files.
  435. BASIC = 1;
  436. // Include configuration source files.
  437. FULL = 2;
  438. }
  439. // Required. Resource name of the form:
  440. // `projects/*/locations/global/apis/*/configs/*`
  441. string name = 1 [
  442. (google.api.field_behavior) = REQUIRED,
  443. (google.api.resource_reference) = {
  444. type: "apigateway.googleapis.com/ApiConfig"
  445. }
  446. ];
  447. // Specifies which fields of the API Config are returned in the response.
  448. // Defaults to `BASIC` view.
  449. ConfigView view = 3;
  450. }
  451. // Request message for ApiGatewayService.CreateApiConfig
  452. message CreateApiConfigRequest {
  453. // Required. Parent resource of the API Config, of the form:
  454. // `projects/*/locations/global/apis/*`
  455. string parent = 1 [
  456. (google.api.field_behavior) = REQUIRED,
  457. (google.api.resource_reference) = {
  458. type: "apigateway.googleapis.com/Api"
  459. }
  460. ];
  461. // Required. Identifier to assign to the API Config. Must be unique within scope of
  462. // the parent resource.
  463. string api_config_id = 2 [(google.api.field_behavior) = REQUIRED];
  464. // Required. API resource.
  465. ApiConfig api_config = 3 [(google.api.field_behavior) = REQUIRED];
  466. }
  467. // Request message for ApiGatewayService.UpdateApiConfig
  468. message UpdateApiConfigRequest {
  469. // Field mask is used to specify the fields to be overwritten in the
  470. // ApiConfig resource by the update.
  471. // The fields specified in the update_mask are relative to the resource, not
  472. // the full request. A field will be overwritten if it is in the mask. If the
  473. // user does not provide a mask then all fields will be overwritten.
  474. google.protobuf.FieldMask update_mask = 1;
  475. // Required. API Config resource.
  476. ApiConfig api_config = 2 [(google.api.field_behavior) = REQUIRED];
  477. }
  478. // Request message for ApiGatewayService.DeleteApiConfig
  479. message DeleteApiConfigRequest {
  480. // Required. Resource name of the form:
  481. // `projects/*/locations/global/apis/*/configs/*`
  482. string name = 1 [
  483. (google.api.field_behavior) = REQUIRED,
  484. (google.api.resource_reference) = {
  485. type: "apigateway.googleapis.com/ApiConfig"
  486. }
  487. ];
  488. }
  489. // Represents the metadata of the long-running operation.
  490. message OperationMetadata {
  491. // Diagnostic information from configuration processing.
  492. message Diagnostic {
  493. // Location of the diagnostic.
  494. string location = 1;
  495. // The diagnostic message.
  496. string message = 2;
  497. }
  498. // Output only. The time the operation was created.
  499. google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  500. // Output only. The time the operation finished running.
  501. google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  502. // Output only. Server-defined resource path for the target of the operation.
  503. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  504. // Output only. Name of the verb executed by the operation.
  505. string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  506. // Output only. Human-readable status of the operation, if any.
  507. string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  508. // Output only. Identifies whether the user has requested cancellation
  509. // of the operation. Operations that have successfully been cancelled
  510. // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
  511. // corresponding to `Code.CANCELLED`.
  512. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  513. // Output only. API version used to start the operation.
  514. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  515. // Output only. Diagnostics generated during processing of configuration source files.
  516. repeated Diagnostic diagnostics = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  517. }