1*d5c09012SAndroid Build Coastguard Worker// Copyright 2021 Google LLC 2*d5c09012SAndroid Build Coastguard Worker// 3*d5c09012SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License"); 4*d5c09012SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License. 5*d5c09012SAndroid Build Coastguard Worker// You may obtain a copy of the License at 6*d5c09012SAndroid Build Coastguard Worker// 7*d5c09012SAndroid Build Coastguard Worker// http://www.apache.org/licenses/LICENSE-2.0 8*d5c09012SAndroid Build Coastguard Worker// 9*d5c09012SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software 10*d5c09012SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS, 11*d5c09012SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12*d5c09012SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and 13*d5c09012SAndroid Build Coastguard Worker// limitations under the License. 14*d5c09012SAndroid Build Coastguard Worker 15*d5c09012SAndroid Build Coastguard Workersyntax = "proto3"; 16*d5c09012SAndroid Build Coastguard Worker 17*d5c09012SAndroid Build Coastguard Workerpackage google.appengine.v1beta; 18*d5c09012SAndroid Build Coastguard Worker 19*d5c09012SAndroid Build Coastguard Workerimport "google/appengine/v1beta/network_settings.proto"; 20*d5c09012SAndroid Build Coastguard Worker 21*d5c09012SAndroid Build Coastguard Workeroption csharp_namespace = "Google.Cloud.AppEngine.V1Beta"; 22*d5c09012SAndroid Build Coastguard Workeroption go_package = "google.golang.org/genproto/googleapis/appengine/v1beta;appengine"; 23*d5c09012SAndroid Build Coastguard Workeroption java_multiple_files = true; 24*d5c09012SAndroid Build Coastguard Workeroption java_outer_classname = "ServiceProto"; 25*d5c09012SAndroid Build Coastguard Workeroption java_package = "com.google.appengine.v1beta"; 26*d5c09012SAndroid Build Coastguard Workeroption php_namespace = "Google\\Cloud\\AppEngine\\V1beta"; 27*d5c09012SAndroid Build Coastguard Workeroption ruby_package = "Google::Cloud::AppEngine::V1beta"; 28*d5c09012SAndroid Build Coastguard Worker 29*d5c09012SAndroid Build Coastguard Worker// A Service resource is a logical component of an application that can share 30*d5c09012SAndroid Build Coastguard Worker// state and communicate in a secure fashion with other services. 31*d5c09012SAndroid Build Coastguard Worker// For example, an application that handles customer requests might 32*d5c09012SAndroid Build Coastguard Worker// include separate services to handle tasks such as backend data 33*d5c09012SAndroid Build Coastguard Worker// analysis or API requests from mobile devices. Each service has a 34*d5c09012SAndroid Build Coastguard Worker// collection of versions that define a specific set of code used to 35*d5c09012SAndroid Build Coastguard Worker// implement the functionality of that service. 36*d5c09012SAndroid Build Coastguard Workermessage Service { 37*d5c09012SAndroid Build Coastguard Worker // Full path to the Service resource in the API. 38*d5c09012SAndroid Build Coastguard Worker // Example: `apps/myapp/services/default`. 39*d5c09012SAndroid Build Coastguard Worker // 40*d5c09012SAndroid Build Coastguard Worker // @OutputOnly 41*d5c09012SAndroid Build Coastguard Worker string name = 1; 42*d5c09012SAndroid Build Coastguard Worker 43*d5c09012SAndroid Build Coastguard Worker // Relative name of the service within the application. 44*d5c09012SAndroid Build Coastguard Worker // Example: `default`. 45*d5c09012SAndroid Build Coastguard Worker // 46*d5c09012SAndroid Build Coastguard Worker // @OutputOnly 47*d5c09012SAndroid Build Coastguard Worker string id = 2; 48*d5c09012SAndroid Build Coastguard Worker 49*d5c09012SAndroid Build Coastguard Worker // Mapping that defines fractional HTTP traffic diversion to 50*d5c09012SAndroid Build Coastguard Worker // different versions within the service. 51*d5c09012SAndroid Build Coastguard Worker TrafficSplit split = 3; 52*d5c09012SAndroid Build Coastguard Worker 53*d5c09012SAndroid Build Coastguard Worker // Ingress settings for this service. Will apply to all versions. 54*d5c09012SAndroid Build Coastguard Worker NetworkSettings network_settings = 6; 55*d5c09012SAndroid Build Coastguard Worker} 56*d5c09012SAndroid Build Coastguard Worker 57*d5c09012SAndroid Build Coastguard Worker// Traffic routing configuration for versions within a single service. Traffic 58*d5c09012SAndroid Build Coastguard Worker// splits define how traffic directed to the service is assigned to versions. 59*d5c09012SAndroid Build Coastguard Workermessage TrafficSplit { 60*d5c09012SAndroid Build Coastguard Worker // Available sharding mechanisms. 61*d5c09012SAndroid Build Coastguard Worker enum ShardBy { 62*d5c09012SAndroid Build Coastguard Worker // Diversion method unspecified. 63*d5c09012SAndroid Build Coastguard Worker UNSPECIFIED = 0; 64*d5c09012SAndroid Build Coastguard Worker 65*d5c09012SAndroid Build Coastguard Worker // Diversion based on a specially named cookie, "GOOGAPPUID." The cookie 66*d5c09012SAndroid Build Coastguard Worker // must be set by the application itself or no diversion will occur. 67*d5c09012SAndroid Build Coastguard Worker COOKIE = 1; 68*d5c09012SAndroid Build Coastguard Worker 69*d5c09012SAndroid Build Coastguard Worker // Diversion based on applying the modulus operation to a fingerprint 70*d5c09012SAndroid Build Coastguard Worker // of the IP address. 71*d5c09012SAndroid Build Coastguard Worker IP = 2; 72*d5c09012SAndroid Build Coastguard Worker 73*d5c09012SAndroid Build Coastguard Worker // Diversion based on weighted random assignment. An incoming request is 74*d5c09012SAndroid Build Coastguard Worker // randomly routed to a version in the traffic split, with probability 75*d5c09012SAndroid Build Coastguard Worker // proportional to the version's traffic share. 76*d5c09012SAndroid Build Coastguard Worker RANDOM = 3; 77*d5c09012SAndroid Build Coastguard Worker } 78*d5c09012SAndroid Build Coastguard Worker 79*d5c09012SAndroid Build Coastguard Worker // Mechanism used to determine which version a request is sent to. 80*d5c09012SAndroid Build Coastguard Worker // The traffic selection algorithm will 81*d5c09012SAndroid Build Coastguard Worker // be stable for either type until allocations are changed. 82*d5c09012SAndroid Build Coastguard Worker ShardBy shard_by = 1; 83*d5c09012SAndroid Build Coastguard Worker 84*d5c09012SAndroid Build Coastguard Worker // Mapping from version IDs within the service to fractional 85*d5c09012SAndroid Build Coastguard Worker // (0.000, 1] allocations of traffic for that version. Each version can 86*d5c09012SAndroid Build Coastguard Worker // be specified only once, but some versions in the service may not 87*d5c09012SAndroid Build Coastguard Worker // have any traffic allocation. Services that have traffic allocated 88*d5c09012SAndroid Build Coastguard Worker // cannot be deleted until either the service is deleted or 89*d5c09012SAndroid Build Coastguard Worker // their traffic allocation is removed. Allocations must sum to 1. 90*d5c09012SAndroid Build Coastguard Worker // Up to two decimal place precision is supported for IP-based splits and 91*d5c09012SAndroid Build Coastguard Worker // up to three decimal places is supported for cookie-based splits. 92*d5c09012SAndroid Build Coastguard Worker map<string, double> allocations = 2; 93*d5c09012SAndroid Build Coastguard Worker} 94