|
| 1 | +// Copyright 2025 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 | + |
| 15 | +syntax = "proto3"; |
| 16 | + |
| 17 | +package google.cloud.run.v2; |
| 18 | + |
| 19 | +import "google/api/resource.proto"; |
| 20 | + |
| 21 | +option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb"; |
| 22 | +option java_multiple_files = true; |
| 23 | +option java_outer_classname = "InstanceSplitProto"; |
| 24 | +option java_package = "com.google.cloud.run.v2"; |
| 25 | + |
| 26 | +// Holds a single instance split entry for the Worker. Allocations can be done |
| 27 | +// to a specific Revision name, or pointing to the latest Ready Revision. |
| 28 | +message InstanceSplit { |
| 29 | + // The allocation type for this instance split. |
| 30 | + InstanceSplitAllocationType type = 1; |
| 31 | + |
| 32 | + // Revision to which to assign this portion of instances, if split allocation |
| 33 | + // is by revision. |
| 34 | + string revision = 2 [ |
| 35 | + (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } |
| 36 | + ]; |
| 37 | + |
| 38 | + // Specifies percent of the instance split to this Revision. |
| 39 | + // This defaults to zero if unspecified. |
| 40 | + int32 percent = 3; |
| 41 | +} |
| 42 | + |
| 43 | +// Represents the observed state of a single `InstanceSplit` entry. |
| 44 | +message InstanceSplitStatus { |
| 45 | + // The allocation type for this instance split. |
| 46 | + InstanceSplitAllocationType type = 1; |
| 47 | + |
| 48 | + // Revision to which this instance split is assigned. |
| 49 | + string revision = 2 [ |
| 50 | + (google.api.resource_reference) = { type: "run.googleapis.com/Revision" } |
| 51 | + ]; |
| 52 | + |
| 53 | + // Specifies percent of the instance split to this Revision. |
| 54 | + int32 percent = 3; |
| 55 | +} |
| 56 | + |
| 57 | +// The type of instance split allocation. |
| 58 | +enum InstanceSplitAllocationType { |
| 59 | + // Unspecified instance allocation type. |
| 60 | + INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED = 0; |
| 61 | + |
| 62 | + // Allocates instances to the Service's latest ready Revision. |
| 63 | + INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST = 1; |
| 64 | + |
| 65 | + // Allocates instances to a Revision by name. |
| 66 | + INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION = 2; |
| 67 | +} |
0 commit comments