1// Copyright 2023 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 15syntax = "proto3"; 16 17package google.cloud.run.v2; 18 19import "google/api/resource.proto"; 20 21option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; 22option java_multiple_files = true; 23option java_outer_classname = "TrafficTargetProto"; 24option java_package = "com.google.cloud.run.v2"; 25 26// Holds a single traffic routing entry for the Service. Allocations can be done 27// to a specific Revision name, or pointing to the latest Ready Revision. 28message TrafficTarget { 29 // The allocation type for this traffic target. 30 TrafficTargetAllocationType type = 1; 31 32 // Revision to which to send this portion of traffic, if traffic allocation is 33 // by revision. 34 string revision = 2 [ 35 (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } 36 ]; 37 38 // Specifies percent of the traffic to this Revision. 39 // This defaults to zero if unspecified. 40 int32 percent = 3; 41 42 // Indicates a string to be part of the URI to exclusively reference this 43 // target. 44 string tag = 4; 45} 46 47// Represents the observed state of a single `TrafficTarget` entry. 48message TrafficTargetStatus { 49 // The allocation type for this traffic target. 50 TrafficTargetAllocationType type = 1; 51 52 // Revision to which this traffic is sent. 53 string revision = 2 [ 54 (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } 55 ]; 56 57 // Specifies percent of the traffic to this Revision. 58 int32 percent = 3; 59 60 // Indicates the string used in the URI to exclusively reference this target. 61 string tag = 4; 62 63 // Displays the target URI. 64 string uri = 5; 65} 66 67// The type of instance allocation. 68enum TrafficTargetAllocationType { 69 // Unspecified instance allocation type. 70 TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED = 0; 71 72 // Allocates instances to the Service's latest ready Revision. 73 TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST = 1; 74 75 // Allocates instances to a Revision by name. 76 TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION = 2; 77} 78