traffic_target.proto 2.6 KB

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