Class: AWSCDK::Sagemaker::CfnCluster::ClusterCapacityRequirementsProperty

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

Overview

Defines the instance capacity requirements for an instance group, including configurations for both Spot and On-Demand capacity types.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(on_demand: nil, spot: nil) ⇒ ClusterCapacityRequirementsProperty

Returns a new instance of ClusterCapacityRequirementsProperty.

Parameters:

  • on_demand (Object, nil) (defaults to: nil)

    Configuration options specific to On-Demand instances.

  • spot (Object, nil) (defaults to: nil)

    Configuration options specific to Spot instances.



818
819
820
821
822
823
# File 'sagemaker/cfn_cluster.rb', line 818

def initialize(on_demand: nil, spot: nil)
  @on_demand = on_demand
  Jsii::Type.check_type(@on_demand, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "onDemand") unless @on_demand.nil?
  @spot = spot
  Jsii::Type.check_type(@spot, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "spot") unless @spot.nil?
end

Instance Attribute Details

#on_demandObject? (readonly)

Configuration options specific to On-Demand instances.



829
830
831
# File 'sagemaker/cfn_cluster.rb', line 829

def on_demand
  @on_demand
end

#spotObject? (readonly)

Configuration options specific to Spot instances.



834
835
836
# File 'sagemaker/cfn_cluster.rb', line 834

def spot
  @spot
end

Class Method Details

.jsii_propertiesObject



836
837
838
839
840
841
# File 'sagemaker/cfn_cluster.rb', line 836

def self.jsii_properties
  {
    :on_demand => "onDemand",
    :spot => "spot",
  }
end

Instance Method Details

#to_jsiiObject



843
844
845
846
847
848
849
850
# File 'sagemaker/cfn_cluster.rb', line 843

def to_jsii
  result = {}
  result.merge!({
    "onDemand" => @on_demand,
    "spot" => @spot,
  })
  result.compact
end