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