service.proto 3.6 KB

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