endpoint.proto 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. // Copyright 2016 Google Inc.
  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.api;
  16. import "google/api/annotations.proto";
  17. option java_multiple_files = true;
  18. option java_outer_classname = "EndpointProto";
  19. option java_package = "com.google.api";
  20. option objc_class_prefix = "GAPI";
  21. // `Endpoint` describes a network endpoint that serves a set of APIs.
  22. // A service may expose any number of endpoints, and all endpoints share the
  23. // same service configuration, such as quota configuration and monitoring
  24. // configuration.
  25. //
  26. // Example service configuration:
  27. //
  28. // name: library-example.googleapis.com
  29. // endpoints:
  30. // # Below entry makes 'google.example.library.v1.Library'
  31. // # API be served from endpoint address library-example.googleapis.com.
  32. // # It also allows HTTP OPTIONS calls to be passed to the backend, for
  33. // # it to decide whether the subsequent cross-origin request is
  34. // # allowed to proceed.
  35. // - name: library-example.googleapis.com
  36. // apis: google.example.library.v1.Library
  37. // allow_cors: true
  38. // # Below entry makes 'google.example.library.v1.Library'
  39. // # API be served from endpoint address
  40. // # google.example.library-example.v1.LibraryManager.
  41. // - name: library-manager.googleapis.com
  42. // apis: google.example.library.v1.LibraryManager
  43. // # BNS address for a borg job. Can specify a task by appending
  44. // # "/taskId" (e.g. "/0") to the job spec.
  45. //
  46. // Example OpenAPI extension for endpoint with allow_cors set to true:
  47. //
  48. // {
  49. // "swagger": "2.0",
  50. // "info": {
  51. // "description": "A simple..."
  52. // },
  53. // "host": "MY_PROJECT_ID.appspot.com",
  54. // "x-google-endpoints": [{
  55. // "name": "MY_PROJECT_ID.appspot.com",
  56. // "allow_cors": "true"
  57. // }]
  58. // }
  59. message Endpoint {
  60. // The canonical name of this endpoint.
  61. string name = 1;
  62. // DEPRECATED: This field is no longer supported. Instead of using aliases,
  63. // please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intented
  64. // alias.
  65. //
  66. // Additional names that this endpoint will be hosted on.
  67. repeated string aliases = 2;
  68. // The list of APIs served by this endpoint.
  69. repeated string apis = 3;
  70. // The list of features enabled on this endpoint.
  71. repeated string features = 4;
  72. // Allowing
  73. // [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka
  74. // cross-domain traffic, would allow the backends served from this endpoint to
  75. // receive and respond to HTTP OPTIONS requests. The response will be used by
  76. // the browser to determine whether the subsequent cross-origin request is
  77. // allowed to proceed.
  78. bool allow_cors = 5;
  79. }