service.proto 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // Copyright 2022 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. option csharp_namespace = "Google.Cloud.AppEngine.V1";
  18. option go_package = "google.golang.org/genproto/googleapis/appengine/v1;appengine";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "ServiceProto";
  21. option java_package = "com.google.appengine.v1";
  22. option php_namespace = "Google\\Cloud\\AppEngine\\V1";
  23. option ruby_package = "Google::Cloud::AppEngine::V1";
  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. // A set of labels to apply to this service. Labels are key/value pairs that
  46. // describe the service and all resources that belong to it (e.g.,
  47. // versions). The labels can be used to search and group resources, and are
  48. // propagated to the usage and billing reports, enabling fine-grain analysis
  49. // of costs. An example of using labels is to tag resources belonging to
  50. // different environments (e.g., "env=prod", "env=qa").
  51. //
  52. // <p>Label keys and values can be no longer than 63 characters and can only
  53. // contain lowercase letters, numeric characters, underscores, dashes, and
  54. // international characters. Label keys must start with a lowercase letter
  55. // or an international character. Each service can have at most 32 labels.
  56. map<string, string> labels = 4;
  57. // Ingress settings for this service. Will apply to all versions.
  58. NetworkSettings network_settings = 6;
  59. }
  60. // Traffic routing configuration for versions within a single service. Traffic
  61. // splits define how traffic directed to the service is assigned to versions.
  62. message TrafficSplit {
  63. // Available sharding mechanisms.
  64. enum ShardBy {
  65. // Diversion method unspecified.
  66. UNSPECIFIED = 0;
  67. // Diversion based on a specially named cookie, "GOOGAPPUID." The cookie
  68. // must be set by the application itself or no diversion will occur.
  69. COOKIE = 1;
  70. // Diversion based on applying the modulus operation to a fingerprint
  71. // of the IP address.
  72. IP = 2;
  73. // Diversion based on weighted random assignment. An incoming request is
  74. // randomly routed to a version in the traffic split, with probability
  75. // proportional to the version's traffic share.
  76. RANDOM = 3;
  77. }
  78. // Mechanism used to determine which version a request is sent to.
  79. // The traffic selection algorithm will
  80. // be stable for either type until allocations are changed.
  81. ShardBy shard_by = 1;
  82. // Mapping from version IDs within the service to fractional
  83. // (0.000, 1] allocations of traffic for that version. Each version can
  84. // be specified only once, but some versions in the service may not
  85. // have any traffic allocation. Services that have traffic allocated
  86. // cannot be deleted until either the service is deleted or
  87. // their traffic allocation is removed. Allocations must sum to 1.
  88. // Up to two decimal place precision is supported for IP-based splits and
  89. // up to three decimal places is supported for cookie-based splits.
  90. map<string, double> allocations = 2;
  91. }