Class: AWSCDK::Sagemaker::CfnEndpoint::TrafficRoutingConfigProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
sagemaker/cfn_endpoint.rb

Overview

Defines the traffic routing strategy during an endpoint deployment to shift traffic from the old fleet to the new fleet.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, canary_size: nil, linear_step_size: nil, wait_interval_in_seconds: nil) ⇒ TrafficRoutingConfigProperty

Returns a new instance of TrafficRoutingConfigProperty.

Parameters:



916
917
918
919
920
921
922
923
924
925
# File 'sagemaker/cfn_endpoint.rb', line 916

def initialize(type:, canary_size: nil, linear_step_size: nil, wait_interval_in_seconds: nil)
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type")
  @canary_size = canary_size.is_a?(Hash) ? ::AWSCDK::Sagemaker::CfnEndpoint::CapacitySizeProperty.new(**canary_size.transform_keys(&:to_sym)) : canary_size
  Jsii::Type.check_type(@canary_size, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zYWdlbWFrZXIuQ2ZuRW5kcG9pbnQuQ2FwYWNpdHlTaXplUHJvcGVydHkifV19fQ==")), "canarySize") unless @canary_size.nil?
  @linear_step_size = linear_step_size.is_a?(Hash) ? ::AWSCDK::Sagemaker::CfnEndpoint::CapacitySizeProperty.new(**linear_step_size.transform_keys(&:to_sym)) : linear_step_size
  Jsii::Type.check_type(@linear_step_size, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zYWdlbWFrZXIuQ2ZuRW5kcG9pbnQuQ2FwYWNpdHlTaXplUHJvcGVydHkifV19fQ==")), "linearStepSize") unless @linear_step_size.nil?
  @wait_interval_in_seconds = wait_interval_in_seconds
  Jsii::Type.check_type(@wait_interval_in_seconds, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "waitIntervalInSeconds") unless @wait_interval_in_seconds.nil?
end

Instance Attribute Details

#canary_sizeAWSCDK::IResolvable, ... (readonly)

Batch size for the first step to turn on traffic on the new endpoint fleet.

Value must be less than or equal to 50% of the variant's total instance count.



942
943
944
# File 'sagemaker/cfn_endpoint.rb', line 942

def canary_size
  @canary_size
end

#linear_step_sizeAWSCDK::IResolvable, ... (readonly)

Batch size for each step to turn on traffic on the new endpoint fleet.

Value must be 10-50% of the variant's total instance count.



949
950
951
# File 'sagemaker/cfn_endpoint.rb', line 949

def linear_step_size
  @linear_step_size
end

#typeString (readonly)

Traffic routing strategy type.

  • ALL_AT_ONCE : Endpoint traffic shifts to the new fleet in a single step.
  • CANARY : Endpoint traffic shifts to the new fleet in two steps. The first step is the canary, which is a small portion of the traffic. The second step is the remainder of the traffic.
  • LINEAR : Endpoint traffic shifts to the new fleet in n steps of a configurable size.


935
936
937
# File 'sagemaker/cfn_endpoint.rb', line 935

def type
  @type
end

#wait_interval_in_secondsNumeric? (readonly)

The waiting time (in seconds) between incremental steps to turn on traffic on the new endpoint fleet.



954
955
956
# File 'sagemaker/cfn_endpoint.rb', line 954

def wait_interval_in_seconds
  @wait_interval_in_seconds
end

Class Method Details

.jsii_propertiesObject



956
957
958
959
960
961
962
963
# File 'sagemaker/cfn_endpoint.rb', line 956

def self.jsii_properties
  {
    :type => "type",
    :canary_size => "canarySize",
    :linear_step_size => "linearStepSize",
    :wait_interval_in_seconds => "waitIntervalInSeconds",
  }
end

Instance Method Details

#to_jsiiObject



965
966
967
968
969
970
971
972
973
974
# File 'sagemaker/cfn_endpoint.rb', line 965

def to_jsii
  result = {}
  result.merge!({
    "type" => @type,
    "canarySize" => @canary_size,
    "linearStepSize" => @linear_step_size,
    "waitIntervalInSeconds" => @wait_interval_in_seconds,
  })
  result.compact
end