service.proto 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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.appengine.v1;
  16. import "google/api/annotations.proto";
  17. option java_multiple_files = true;
  18. option java_outer_classname = "ServiceProto";
  19. option java_package = "com.google.appengine.v1";
  20. // A Service resource is a logical component of an application that can share
  21. // state and communicate in a secure fashion with other services.
  22. // For example, an application that handles customer requests might
  23. // include separate services to handle tasks such as backend data
  24. // analysis or API requests from mobile devices. Each service has a
  25. // collection of versions that define a specific set of code used to
  26. // implement the functionality of that service.
  27. message Service {
  28. // Full path to the Service resource in the API.
  29. // Example: `apps/myapp/services/default`.
  30. //
  31. // @OutputOnly
  32. string name = 1;
  33. // Relative name of the service within the application.
  34. // Example: `default`.
  35. //
  36. // @OutputOnly
  37. string id = 2;
  38. // Mapping that defines fractional HTTP traffic diversion to
  39. // different versions within the service.
  40. TrafficSplit split = 3;
  41. }
  42. // Traffic routing configuration for versions within a single service. Traffic
  43. // splits define how traffic directed to the service is assigned to versions.
  44. message TrafficSplit {
  45. // Available sharding mechanisms.
  46. enum ShardBy {
  47. // Diversion method unspecified.
  48. UNSPECIFIED = 0;
  49. // Diversion based on a specially named cookie, "GOOGAPPUID." The cookie
  50. // must be set by the application itself or no diversion will occur.
  51. COOKIE = 1;
  52. // Diversion based on applying the modulus operation to a fingerprint
  53. // of the IP address.
  54. IP = 2;
  55. }
  56. // Mechanism used to determine which version a request is sent to.
  57. // The traffic selection algorithm will
  58. // be stable for either type until allocations are changed.
  59. ShardBy shard_by = 1;
  60. // Mapping from version IDs within the service to fractional
  61. // (0.000, 1] allocations of traffic for that version. Each version can
  62. // be specified only once, but some versions in the service may not
  63. // have any traffic allocation. Services that have traffic allocated
  64. // cannot be deleted until either the service is deleted or
  65. // their traffic allocation is removed. Allocations must sum to 1.
  66. // Up to two decimal place precision is supported for IP-based splits and
  67. // up to three decimal places is supported for cookie-based splits.
  68. map<string, double> allocations = 2;
  69. }