/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include namespace Aws { namespace Utils { namespace Xml { class XmlNode; } // namespace Xml } // namespace Utils namespace EC2 { namespace Model { /** *

The number of units to request. You can choose to set the target capacity in * terms of instances or a performance characteristic that is important to your * application workload, such as vCPUs, memory, or I/O. If the request type is * maintain, you can specify a target capacity of 0 and add capacity * later.

You can use the On-Demand Instance MaxTotalPrice * parameter, the Spot Instance MaxTotalPrice, or both to ensure that * your fleet cost does not exceed your budget. If you set a maximum price per hour * for the On-Demand Instances and Spot Instances in your request, EC2 Fleet will * launch instances until it reaches the maximum amount that you're willing to pay. * When the maximum amount you're willing to pay is reached, the fleet stops * launching instances even if it hasn’t met the target capacity. The * MaxTotalPrice parameters are located in OnDemandOptions * and SpotOptions.

See * Also:

AWS * API Reference

*/ class TargetCapacitySpecification { public: AWS_EC2_API TargetCapacitySpecification(); AWS_EC2_API TargetCapacitySpecification(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_EC2_API TargetCapacitySpecification& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_EC2_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; AWS_EC2_API void OutputToStream(Aws::OStream& oStream, const char* location) const; /** *

The number of units to request, filled using * DefaultTargetCapacityType.

*/ inline int GetTotalTargetCapacity() const{ return m_totalTargetCapacity; } /** *

The number of units to request, filled using * DefaultTargetCapacityType.

*/ inline bool TotalTargetCapacityHasBeenSet() const { return m_totalTargetCapacityHasBeenSet; } /** *

The number of units to request, filled using * DefaultTargetCapacityType.

*/ inline void SetTotalTargetCapacity(int value) { m_totalTargetCapacityHasBeenSet = true; m_totalTargetCapacity = value; } /** *

The number of units to request, filled using * DefaultTargetCapacityType.

*/ inline TargetCapacitySpecification& WithTotalTargetCapacity(int value) { SetTotalTargetCapacity(value); return *this;} /** *

The number of On-Demand units to request. If you specify a target capacity * for Spot units, you cannot specify a target capacity for On-Demand units.

*/ inline int GetOnDemandTargetCapacity() const{ return m_onDemandTargetCapacity; } /** *

The number of On-Demand units to request. If you specify a target capacity * for Spot units, you cannot specify a target capacity for On-Demand units.

*/ inline bool OnDemandTargetCapacityHasBeenSet() const { return m_onDemandTargetCapacityHasBeenSet; } /** *

The number of On-Demand units to request. If you specify a target capacity * for Spot units, you cannot specify a target capacity for On-Demand units.

*/ inline void SetOnDemandTargetCapacity(int value) { m_onDemandTargetCapacityHasBeenSet = true; m_onDemandTargetCapacity = value; } /** *

The number of On-Demand units to request. If you specify a target capacity * for Spot units, you cannot specify a target capacity for On-Demand units.

*/ inline TargetCapacitySpecification& WithOnDemandTargetCapacity(int value) { SetOnDemandTargetCapacity(value); return *this;} /** *

The maximum number of Spot units to launch. If you specify a target capacity * for On-Demand units, you cannot specify a target capacity for Spot units.

*/ inline int GetSpotTargetCapacity() const{ return m_spotTargetCapacity; } /** *

The maximum number of Spot units to launch. If you specify a target capacity * for On-Demand units, you cannot specify a target capacity for Spot units.

*/ inline bool SpotTargetCapacityHasBeenSet() const { return m_spotTargetCapacityHasBeenSet; } /** *

The maximum number of Spot units to launch. If you specify a target capacity * for On-Demand units, you cannot specify a target capacity for Spot units.

*/ inline void SetSpotTargetCapacity(int value) { m_spotTargetCapacityHasBeenSet = true; m_spotTargetCapacity = value; } /** *

The maximum number of Spot units to launch. If you specify a target capacity * for On-Demand units, you cannot specify a target capacity for Spot units.

*/ inline TargetCapacitySpecification& WithSpotTargetCapacity(int value) { SetSpotTargetCapacity(value); return *this;} /** *

The default TotalTargetCapacity, which is either * Spot or On-Demand.

*/ inline const DefaultTargetCapacityType& GetDefaultTargetCapacityType() const{ return m_defaultTargetCapacityType; } /** *

The default TotalTargetCapacity, which is either * Spot or On-Demand.

*/ inline bool DefaultTargetCapacityTypeHasBeenSet() const { return m_defaultTargetCapacityTypeHasBeenSet; } /** *

The default TotalTargetCapacity, which is either * Spot or On-Demand.

*/ inline void SetDefaultTargetCapacityType(const DefaultTargetCapacityType& value) { m_defaultTargetCapacityTypeHasBeenSet = true; m_defaultTargetCapacityType = value; } /** *

The default TotalTargetCapacity, which is either * Spot or On-Demand.

*/ inline void SetDefaultTargetCapacityType(DefaultTargetCapacityType&& value) { m_defaultTargetCapacityTypeHasBeenSet = true; m_defaultTargetCapacityType = std::move(value); } /** *

The default TotalTargetCapacity, which is either * Spot or On-Demand.

*/ inline TargetCapacitySpecification& WithDefaultTargetCapacityType(const DefaultTargetCapacityType& value) { SetDefaultTargetCapacityType(value); return *this;} /** *

The default TotalTargetCapacity, which is either * Spot or On-Demand.

*/ inline TargetCapacitySpecification& WithDefaultTargetCapacityType(DefaultTargetCapacityType&& value) { SetDefaultTargetCapacityType(std::move(value)); return *this;} /** *

The unit for the target capacity. TargetCapacityUnitType can * only be specified when InstanceRequirements is specified.

*

Default: units (translates to number of instances)

*/ inline const TargetCapacityUnitType& GetTargetCapacityUnitType() const{ return m_targetCapacityUnitType; } /** *

The unit for the target capacity. TargetCapacityUnitType can * only be specified when InstanceRequirements is specified.

*

Default: units (translates to number of instances)

*/ inline bool TargetCapacityUnitTypeHasBeenSet() const { return m_targetCapacityUnitTypeHasBeenSet; } /** *

The unit for the target capacity. TargetCapacityUnitType can * only be specified when InstanceRequirements is specified.

*

Default: units (translates to number of instances)

*/ inline void SetTargetCapacityUnitType(const TargetCapacityUnitType& value) { m_targetCapacityUnitTypeHasBeenSet = true; m_targetCapacityUnitType = value; } /** *

The unit for the target capacity. TargetCapacityUnitType can * only be specified when InstanceRequirements is specified.

*

Default: units (translates to number of instances)

*/ inline void SetTargetCapacityUnitType(TargetCapacityUnitType&& value) { m_targetCapacityUnitTypeHasBeenSet = true; m_targetCapacityUnitType = std::move(value); } /** *

The unit for the target capacity. TargetCapacityUnitType can * only be specified when InstanceRequirements is specified.

*

Default: units (translates to number of instances)

*/ inline TargetCapacitySpecification& WithTargetCapacityUnitType(const TargetCapacityUnitType& value) { SetTargetCapacityUnitType(value); return *this;} /** *

The unit for the target capacity. TargetCapacityUnitType can * only be specified when InstanceRequirements is specified.

*

Default: units (translates to number of instances)

*/ inline TargetCapacitySpecification& WithTargetCapacityUnitType(TargetCapacityUnitType&& value) { SetTargetCapacityUnitType(std::move(value)); return *this;} private: int m_totalTargetCapacity; bool m_totalTargetCapacityHasBeenSet = false; int m_onDemandTargetCapacity; bool m_onDemandTargetCapacityHasBeenSet = false; int m_spotTargetCapacity; bool m_spotTargetCapacityHasBeenSet = false; DefaultTargetCapacityType m_defaultTargetCapacityType; bool m_defaultTargetCapacityTypeHasBeenSet = false; TargetCapacityUnitType m_targetCapacityUnitType; bool m_targetCapacityUnitTypeHasBeenSet = false; }; } // namespace Model } // namespace EC2 } // namespace Aws