/** * 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 as * the number of instances. Or you can set the target capacity to 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 parameter, or both parameters 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 OnDemandOptionsRequest * and SpotOptionsRequest.

See * Also:

AWS * API Reference

*/ class TargetCapacitySpecificationRequest { public: AWS_EC2_API TargetCapacitySpecificationRequest(); AWS_EC2_API TargetCapacitySpecificationRequest(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_EC2_API TargetCapacitySpecificationRequest& 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 TargetCapacitySpecificationRequest& WithTotalTargetCapacity(int value) { SetTotalTargetCapacity(value); return *this;} /** *

The number of On-Demand units to request.

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

The number of On-Demand units to request.

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

The number of On-Demand units to request.

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

The number of On-Demand units to request.

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

The number of Spot units to request.

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

The number of Spot units to request.

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

The number of Spot units to request.

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

The number of Spot units to request.

*/ inline TargetCapacitySpecificationRequest& 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 TargetCapacitySpecificationRequest& WithDefaultTargetCapacityType(const DefaultTargetCapacityType& value) { SetDefaultTargetCapacityType(value); return *this;} /** *

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

*/ inline TargetCapacitySpecificationRequest& 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 TargetCapacitySpecificationRequest& 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 TargetCapacitySpecificationRequest& 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