Class: Google::Apis::AppengineV1beta4::TrafficSplit

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable
Defined in:
generated/google/apis/appengine_v1beta4/classes.rb,
generated/google/apis/appengine_v1beta4/representations.rb,
generated/google/apis/appengine_v1beta4/representations.rb

Overview

Configuration for traffic splitting for versions within a single module. Traffic splitting allows traffic directed to the module to be assigned to one of several versions in a fractional way, enabling experiments and canarying new builds, for example.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ TrafficSplit

Returns a new instance of TrafficSplit.


1424
1425
1426
# File 'generated/google/apis/appengine_v1beta4/classes.rb', line 1424

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

Instance Attribute Details

#allocationsHash<String,Float>

Mapping from module version IDs within the module to fractional (0.000, 1] allocations of traffic for that version. Each version may only be specified once, but some versions in the module may not have any traffic allocation. Modules that have traffic allocated in this field may not be deleted until the module is deleted, or their traffic allocation is removed. Allocations must sum to 1. Supports precision up to two decimal places for IP-based splits and up to three decimal places for cookie-based splits. Corresponds to the JSON property allocations

Returns:

  • (Hash<String,Float>)

1422
1423
1424
# File 'generated/google/apis/appengine_v1beta4/classes.rb', line 1422

def allocations
  @allocations
end

#shard_byString

Which mechanism should be used as a selector when choosing a version to send a request to. The traffic selection algorithm will be stable for either type until allocations are changed. Corresponds to the JSON property shardBy

Returns:

  • (String)

1411
1412
1413
# File 'generated/google/apis/appengine_v1beta4/classes.rb', line 1411

def shard_by
  @shard_by
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object


1429
1430
1431
1432
# File 'generated/google/apis/appengine_v1beta4/classes.rb', line 1429

def update!(**args)
  @shard_by = args[:shard_by] if args.key?(:shard_by)
  @allocations = args[:allocations] if args.key?(:allocations)
end