/** * 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 On-Demand Instances in an EC2 * Fleet.

See Also:

AWS * API Reference

*/ class OnDemandOptions { public: AWS_EC2_API OnDemandOptions(); AWS_EC2_API OnDemandOptions(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_EC2_API OnDemandOptions& 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 strategy that determines the order of the launch template overrides to * use in fulfilling On-Demand capacity.

lowest-price - EC2 * Fleet uses price to determine the order, launching the lowest price first.

*

prioritized - EC2 Fleet uses the priority that you assigned to * each launch template override, launching the highest priority first.

*

Default: lowest-price

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

The strategy that determines the order of the launch template overrides to * use in fulfilling On-Demand capacity.

lowest-price - EC2 * Fleet uses price to determine the order, launching the lowest price first.

*

prioritized - EC2 Fleet uses the priority that you assigned to * each launch template override, launching the highest priority first.

*

Default: lowest-price

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

The strategy that determines the order of the launch template overrides to * use in fulfilling On-Demand capacity.

lowest-price - EC2 * Fleet uses price to determine the order, launching the lowest price first.

*

prioritized - EC2 Fleet uses the priority that you assigned to * each launch template override, launching the highest priority first.

*

Default: lowest-price

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

The strategy that determines the order of the launch template overrides to * use in fulfilling On-Demand capacity.

lowest-price - EC2 * Fleet uses price to determine the order, launching the lowest price first.

*

prioritized - EC2 Fleet uses the priority that you assigned to * each launch template override, launching the highest priority first.

*

Default: lowest-price

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

The strategy that determines the order of the launch template overrides to * use in fulfilling On-Demand capacity.

lowest-price - EC2 * Fleet uses price to determine the order, launching the lowest price first.

*

prioritized - EC2 Fleet uses the priority that you assigned to * each launch template override, launching the highest priority first.

*

Default: lowest-price

*/ inline OnDemandOptions& WithAllocationStrategy(const FleetOnDemandAllocationStrategy& value) { SetAllocationStrategy(value); return *this;} /** *

The strategy that determines the order of the launch template overrides to * use in fulfilling On-Demand capacity.

lowest-price - EC2 * Fleet uses price to determine the order, launching the lowest price first.

*

prioritized - EC2 Fleet uses the priority that you assigned to * each launch template override, launching the highest priority first.

*

Default: lowest-price

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

The strategy for using unused Capacity Reservations for fulfilling On-Demand * capacity.

Supported only for fleets of type instant.

*/ inline const CapacityReservationOptions& GetCapacityReservationOptions() const{ return m_capacityReservationOptions; } /** *

The strategy for using unused Capacity Reservations for fulfilling On-Demand * capacity.

Supported only for fleets of type instant.

*/ inline bool CapacityReservationOptionsHasBeenSet() const { return m_capacityReservationOptionsHasBeenSet; } /** *

The strategy for using unused Capacity Reservations for fulfilling On-Demand * capacity.

Supported only for fleets of type instant.

*/ inline void SetCapacityReservationOptions(const CapacityReservationOptions& value) { m_capacityReservationOptionsHasBeenSet = true; m_capacityReservationOptions = value; } /** *

The strategy for using unused Capacity Reservations for fulfilling On-Demand * capacity.

Supported only for fleets of type instant.

*/ inline void SetCapacityReservationOptions(CapacityReservationOptions&& value) { m_capacityReservationOptionsHasBeenSet = true; m_capacityReservationOptions = std::move(value); } /** *

The strategy for using unused Capacity Reservations for fulfilling On-Demand * capacity.

Supported only for fleets of type instant.

*/ inline OnDemandOptions& WithCapacityReservationOptions(const CapacityReservationOptions& value) { SetCapacityReservationOptions(value); return *this;} /** *

The strategy for using unused Capacity Reservations for fulfilling On-Demand * capacity.

Supported only for fleets of type instant.

*/ inline OnDemandOptions& WithCapacityReservationOptions(CapacityReservationOptions&& value) { SetCapacityReservationOptions(std::move(value)); return *this;} /** *

Indicates that the fleet uses a single instance type to launch all On-Demand * 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 On-Demand * 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 On-Demand * 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 On-Demand * Instances in the fleet.

Supported only for fleets of type * instant.

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

Indicates that the fleet launches all On-Demand 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 On-Demand 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 On-Demand 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 On-Demand Instances into a single * Availability Zone.

Supported only for fleets of type * instant.

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

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

*

Supported only for fleets of type instant.

At least one * of the following must be specified: SingleAvailabilityZone | * SingleInstanceType

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

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

*

Supported only for fleets of type instant.

At least one * of the following must be specified: SingleAvailabilityZone | * SingleInstanceType

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

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

*

Supported only for fleets of type instant.

At least one * of the following must be specified: SingleAvailabilityZone | * SingleInstanceType

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

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

*

Supported only for fleets of type instant.

At least one * of the following must be specified: SingleAvailabilityZone | * SingleInstanceType

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

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

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

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

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

The maximum amount per hour for On-Demand 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 On-Demand 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 On-Demand 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 On-Demand Instances that you're willing to * pay.

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

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

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

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

*/ inline OnDemandOptions& WithMaxTotalPrice(const char* value) { SetMaxTotalPrice(value); return *this;} private: FleetOnDemandAllocationStrategy m_allocationStrategy; bool m_allocationStrategyHasBeenSet = false; CapacityReservationOptions m_capacityReservationOptions; bool m_capacityReservationOptionsHasBeenSet = false; bool m_singleInstanceType; bool m_singleInstanceTypeHasBeenSet = false; bool m_singleAvailabilityZone; bool m_singleAvailabilityZoneHasBeenSet = false; int m_minTargetCapacity; bool m_minTargetCapacityHasBeenSet = false; Aws::String m_maxTotalPrice; bool m_maxTotalPriceHasBeenSet = false; }; } // namespace Model } // namespace EC2 } // namespace Aws