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

Describes the configuration of Spot Instances in an EC2 Fleet * request.

See Also:

AWS * API Reference

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

Indicates how to allocate the target Spot Instance capacity across the Spot * Instance pools specified by the EC2 Fleet.

If the allocation strategy is * lowest-price, EC2 Fleet launches instances from the Spot Instance * pools with the lowest price. This is the default allocation strategy.

If * the allocation strategy is diversified, EC2 Fleet launches * instances from all of the Spot Instance pools that you specify.

If the * allocation strategy is capacity-optimized, EC2 Fleet launches * instances from Spot Instance pools with optimal capacity for the number of * instances that are launching.

*/ inline const SpotAllocationStrategy& GetAllocationStrategy() const{ return m_allocationStrategy; } /** *

Indicates how to allocate the target Spot Instance capacity across the Spot * Instance pools specified by the EC2 Fleet.

If the allocation strategy is * lowest-price, EC2 Fleet launches instances from the Spot Instance * pools with the lowest price. This is the default allocation strategy.

If * the allocation strategy is diversified, EC2 Fleet launches * instances from all of the Spot Instance pools that you specify.

If the * allocation strategy is capacity-optimized, EC2 Fleet launches * instances from Spot Instance pools with optimal capacity for the number of * instances that are launching.

*/ inline bool AllocationStrategyHasBeenSet() const { return m_allocationStrategyHasBeenSet; } /** *

Indicates how to allocate the target Spot Instance capacity across the Spot * Instance pools specified by the EC2 Fleet.

If the allocation strategy is * lowest-price, EC2 Fleet launches instances from the Spot Instance * pools with the lowest price. This is the default allocation strategy.

If * the allocation strategy is diversified, EC2 Fleet launches * instances from all of the Spot Instance pools that you specify.

If the * allocation strategy is capacity-optimized, EC2 Fleet launches * instances from Spot Instance pools with optimal capacity for the number of * instances that are launching.

*/ inline void SetAllocationStrategy(const SpotAllocationStrategy& value) { m_allocationStrategyHasBeenSet = true; m_allocationStrategy = value; } /** *

Indicates how to allocate the target Spot Instance capacity across the Spot * Instance pools specified by the EC2 Fleet.

If the allocation strategy is * lowest-price, EC2 Fleet launches instances from the Spot Instance * pools with the lowest price. This is the default allocation strategy.

If * the allocation strategy is diversified, EC2 Fleet launches * instances from all of the Spot Instance pools that you specify.

If the * allocation strategy is capacity-optimized, EC2 Fleet launches * instances from Spot Instance pools with optimal capacity for the number of * instances that are launching.

*/ inline void SetAllocationStrategy(SpotAllocationStrategy&& value) { m_allocationStrategyHasBeenSet = true; m_allocationStrategy = std::move(value); } /** *

Indicates how to allocate the target Spot Instance capacity across the Spot * Instance pools specified by the EC2 Fleet.

If the allocation strategy is * lowest-price, EC2 Fleet launches instances from the Spot Instance * pools with the lowest price. This is the default allocation strategy.

If * the allocation strategy is diversified, EC2 Fleet launches * instances from all of the Spot Instance pools that you specify.

If the * allocation strategy is capacity-optimized, EC2 Fleet launches * instances from Spot Instance pools with optimal capacity for the number of * instances that are launching.

*/ inline SpotOptionsRequest& WithAllocationStrategy(const SpotAllocationStrategy& value) { SetAllocationStrategy(value); return *this;} /** *

Indicates how to allocate the target Spot Instance capacity across the Spot * Instance pools specified by the EC2 Fleet.

If the allocation strategy is * lowest-price, EC2 Fleet launches instances from the Spot Instance * pools with the lowest price. This is the default allocation strategy.

If * the allocation strategy is diversified, EC2 Fleet launches * instances from all of the Spot Instance pools that you specify.

If the * allocation strategy is capacity-optimized, EC2 Fleet launches * instances from Spot Instance pools with optimal capacity for the number of * instances that are launching.

*/ inline SpotOptionsRequest& WithAllocationStrategy(SpotAllocationStrategy&& value) { SetAllocationStrategy(std::move(value)); return *this;} /** *

The behavior when a Spot Instance is interrupted. The default is * terminate.

*/ inline const SpotInstanceInterruptionBehavior& GetInstanceInterruptionBehavior() const{ return m_instanceInterruptionBehavior; } /** *

The behavior when a Spot Instance is interrupted. The default is * terminate.

*/ inline bool InstanceInterruptionBehaviorHasBeenSet() const { return m_instanceInterruptionBehaviorHasBeenSet; } /** *

The behavior when a Spot Instance is interrupted. The default is * terminate.

*/ inline void SetInstanceInterruptionBehavior(const SpotInstanceInterruptionBehavior& value) { m_instanceInterruptionBehaviorHasBeenSet = true; m_instanceInterruptionBehavior = value; } /** *

The behavior when a Spot Instance is interrupted. The default is * terminate.

*/ inline void SetInstanceInterruptionBehavior(SpotInstanceInterruptionBehavior&& value) { m_instanceInterruptionBehaviorHasBeenSet = true; m_instanceInterruptionBehavior = std::move(value); } /** *

The behavior when a Spot Instance is interrupted. The default is * terminate.

*/ inline SpotOptionsRequest& WithInstanceInterruptionBehavior(const SpotInstanceInterruptionBehavior& value) { SetInstanceInterruptionBehavior(value); return *this;} /** *

The behavior when a Spot Instance is interrupted. The default is * terminate.

*/ inline SpotOptionsRequest& WithInstanceInterruptionBehavior(SpotInstanceInterruptionBehavior&& value) { SetInstanceInterruptionBehavior(std::move(value)); return *this;} /** *

The number of Spot pools across which to allocate your target Spot capacity. * Valid only when Spot AllocationStrategy is set to * lowest-price. EC2 Fleet selects the cheapest Spot pools and evenly * allocates your target Spot capacity across the number of Spot pools that you * specify.

*/ inline int GetInstancePoolsToUseCount() const{ return m_instancePoolsToUseCount; } /** *

The number of Spot pools across which to allocate your target Spot capacity. * Valid only when Spot AllocationStrategy is set to * lowest-price. EC2 Fleet selects the cheapest Spot pools and evenly * allocates your target Spot capacity across the number of Spot pools that you * specify.

*/ inline bool InstancePoolsToUseCountHasBeenSet() const { return m_instancePoolsToUseCountHasBeenSet; } /** *

The number of Spot pools across which to allocate your target Spot capacity. * Valid only when Spot AllocationStrategy is set to * lowest-price. EC2 Fleet selects the cheapest Spot pools and evenly * allocates your target Spot capacity across the number of Spot pools that you * specify.

*/ inline void SetInstancePoolsToUseCount(int value) { m_instancePoolsToUseCountHasBeenSet = true; m_instancePoolsToUseCount = value; } /** *

The number of Spot pools across which to allocate your target Spot capacity. * Valid only when Spot AllocationStrategy is set to * lowest-price. EC2 Fleet selects the cheapest Spot pools and evenly * allocates your target Spot capacity across the number of Spot pools that you * specify.

*/ inline SpotOptionsRequest& WithInstancePoolsToUseCount(int value) { SetInstancePoolsToUseCount(value); return *this;} /** *

Indicates that the fleet uses a single instance type to launch all Spot * Instances in the fleet. Supported only for fleets of type * instant.

*/ inline bool GetSingleInstanceType() const{ return m_singleInstanceType; } /** *

Indicates that the fleet uses a single instance type to launch all Spot * Instances in the fleet. Supported only for fleets of type * instant.

*/ inline bool SingleInstanceTypeHasBeenSet() const { return m_singleInstanceTypeHasBeenSet; } /** *

Indicates that the fleet uses a single instance type to launch all Spot * Instances in the fleet. Supported only for fleets of type * instant.

*/ inline void SetSingleInstanceType(bool value) { m_singleInstanceTypeHasBeenSet = true; m_singleInstanceType = value; } /** *

Indicates that the fleet uses a single instance type to launch all Spot * Instances in the fleet. Supported only for fleets of type * instant.

*/ inline SpotOptionsRequest& WithSingleInstanceType(bool value) { SetSingleInstanceType(value); return *this;} /** *

Indicates that the fleet launches all Spot Instances into a single * Availability Zone. Supported only for fleets of type instant.

*/ inline bool GetSingleAvailabilityZone() const{ return m_singleAvailabilityZone; } /** *

Indicates that the fleet launches all Spot Instances into a single * Availability Zone. Supported only for fleets of type instant.

*/ inline bool SingleAvailabilityZoneHasBeenSet() const { return m_singleAvailabilityZoneHasBeenSet; } /** *

Indicates that the fleet launches all Spot Instances into a single * Availability Zone. Supported only for fleets of type instant.

*/ inline void SetSingleAvailabilityZone(bool value) { m_singleAvailabilityZoneHasBeenSet = true; m_singleAvailabilityZone = value; } /** *

Indicates that the fleet launches all Spot Instances into a single * Availability Zone. Supported only for fleets of type instant.

*/ inline SpotOptionsRequest& WithSingleAvailabilityZone(bool value) { SetSingleAvailabilityZone(value); return *this;} /** *

The minimum target capacity for Spot Instances in the fleet. If the minimum * target capacity is not reached, the fleet launches no instances.

*/ inline int GetMinTargetCapacity() const{ return m_minTargetCapacity; } /** *

The minimum target capacity for Spot Instances in the fleet. If the minimum * target capacity is not reached, the fleet launches no instances.

*/ inline bool MinTargetCapacityHasBeenSet() const { return m_minTargetCapacityHasBeenSet; } /** *

The minimum target capacity for Spot Instances in the fleet. If the minimum * target capacity is not reached, the fleet launches no instances.

*/ inline void SetMinTargetCapacity(int value) { m_minTargetCapacityHasBeenSet = true; m_minTargetCapacity = value; } /** *

The minimum target capacity for Spot Instances in the fleet. If the minimum * target capacity is not reached, the fleet launches no instances.

*/ inline SpotOptionsRequest& WithMinTargetCapacity(int value) { SetMinTargetCapacity(value); return *this;} /** *

The maximum amount per hour for Spot Instances that you're willing to * pay.

*/ inline const Aws::String& GetMaxTotalPrice() const{ return m_maxTotalPrice; } /** *

The maximum amount per hour for Spot Instances that you're willing to * pay.

*/ inline bool MaxTotalPriceHasBeenSet() const { return m_maxTotalPriceHasBeenSet; } /** *

The maximum amount per hour for Spot Instances that you're willing to * pay.

*/ inline void SetMaxTotalPrice(const Aws::String& value) { m_maxTotalPriceHasBeenSet = true; m_maxTotalPrice = value; } /** *

The maximum amount per hour for Spot Instances that you're willing to * pay.

*/ inline void SetMaxTotalPrice(Aws::String&& value) { m_maxTotalPriceHasBeenSet = true; m_maxTotalPrice = std::move(value); } /** *

The maximum amount per hour for Spot Instances that you're willing to * pay.

*/ inline void SetMaxTotalPrice(const char* value) { m_maxTotalPriceHasBeenSet = true; m_maxTotalPrice.assign(value); } /** *

The maximum amount per hour for Spot Instances that you're willing to * pay.

*/ inline SpotOptionsRequest& WithMaxTotalPrice(const Aws::String& value) { SetMaxTotalPrice(value); return *this;} /** *

The maximum amount per hour for Spot Instances that you're willing to * pay.

*/ inline SpotOptionsRequest& WithMaxTotalPrice(Aws::String&& value) { SetMaxTotalPrice(std::move(value)); return *this;} /** *

The maximum amount per hour for Spot Instances that you're willing to * pay.

*/ inline SpotOptionsRequest& WithMaxTotalPrice(const char* value) { SetMaxTotalPrice(value); return *this;} private: SpotAllocationStrategy m_allocationStrategy; bool m_allocationStrategyHasBeenSet; SpotInstanceInterruptionBehavior m_instanceInterruptionBehavior; bool m_instanceInterruptionBehaviorHasBeenSet; int m_instancePoolsToUseCount; bool m_instancePoolsToUseCountHasBeenSet; bool m_singleInstanceType; bool m_singleInstanceTypeHasBeenSet; bool m_singleAvailabilityZone; bool m_singleAvailabilityZoneHasBeenSet; int m_minTargetCapacity; bool m_minTargetCapacityHasBeenSet; Aws::String m_maxTotalPrice; bool m_maxTotalPriceHasBeenSet; }; } // namespace Model } // namespace EC2 } // namespace Aws