Class: Google::Apis::ServicemanagementV1::TrafficPercentStrategy
- Inherits:
-
Object
- Object
- Google::Apis::ServicemanagementV1::TrafficPercentStrategy
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/servicemanagement_v1/classes.rb,
generated/google/apis/servicemanagement_v1/representations.rb,
generated/google/apis/servicemanagement_v1/representations.rb
Overview
Strategy that specifies how Google Service Control should select
different
versions of service configurations based on traffic percentage.
One example of how to gradually rollout a new service configuration using
this
strategy:
Day 1
Rollout
id: "example.googleapis.com/rollout_20160206"
traffic_percent_strategy
percentages:
"example.googleapis.com/20160201": 70.00
"example.googleapis.com/20160206": 30.00
Day 2
Rollout
id: "example.googleapis.com/rollout_20160207"
traffic_percent_strategy:
percentages:
"example.googleapis.com/20160206": 100.00
Instance Attribute Summary collapse
-
#percentages ⇒ Hash<String,Float>
Maps service configuration IDs to their corresponding traffic percentage.
Instance Method Summary collapse
-
#initialize(**args) ⇒ TrafficPercentStrategy
constructor
A new instance of TrafficPercentStrategy.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ TrafficPercentStrategy
Returns a new instance of TrafficPercentStrategy
153 154 155 |
# File 'generated/google/apis/servicemanagement_v1/classes.rb', line 153 def initialize(**args) update!(**args) end |
Instance Attribute Details
#percentages ⇒ Hash<String,Float>
Maps service configuration IDs to their corresponding traffic percentage.
Key is the service configuration ID, Value is the traffic percentage
which must be greater than 0.0 and the sum must equal to 100.0.
Corresponds to the JSON property percentages
151 152 153 |
# File 'generated/google/apis/servicemanagement_v1/classes.rb', line 151 def percentages @percentages end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
158 159 160 |
# File 'generated/google/apis/servicemanagement_v1/classes.rb', line 158 def update!(**args) @percentages = args[:percentages] if args.key?(:percentages) end |