service.proto 3.6 KB

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