Class: Google::Apis::RunV2::GoogleCloudRunOpV2TrafficTarget

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/run_v2/classes.rb,
lib/google/apis/run_v2/representations.rb,
lib/google/apis/run_v2/representations.rb

Overview

Holds a single traffic routing entry for the Service. Allocations can be done to a specific Revision name, or pointing to the latest Ready Revision.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRunOpV2TrafficTarget

Returns a new instance of GoogleCloudRunOpV2TrafficTarget.



1106
1107
1108
# File 'lib/google/apis/run_v2/classes.rb', line 1106

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#percentFixnum

Specifies percent of the traffic to this Revision. This defaults to zero if unspecified. Cloud Run currently requires 100 percent for a single TrafficTarget entry. Corresponds to the JSON property percent

Returns:

  • (Fixnum)


1088
1089
1090
# File 'lib/google/apis/run_v2/classes.rb', line 1088

def percent
  @percent
end

#revisionString

Revision to which to send this portion of traffic, if traffic allocation is by revision. Corresponds to the JSON property revision

Returns:

  • (String)


1094
1095
1096
# File 'lib/google/apis/run_v2/classes.rb', line 1094

def revision
  @revision
end

#tagString

Indicates a string to be part of the URI to exclusively reference this target. Corresponds to the JSON property tag

Returns:

  • (String)


1099
1100
1101
# File 'lib/google/apis/run_v2/classes.rb', line 1099

def tag
  @tag
end

#typeString

The allocation type for this traffic target. Corresponds to the JSON property type

Returns:

  • (String)


1104
1105
1106
# File 'lib/google/apis/run_v2/classes.rb', line 1104

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1111
1112
1113
1114
1115
1116
# File 'lib/google/apis/run_v2/classes.rb', line 1111

def update!(**args)
  @percent = args[:percent] if args.key?(:percent)
  @revision = args[:revision] if args.key?(:revision)
  @tag = args[:tag] if args.key?(:tag)
  @type = args[:type] if args.key?(:type)
end