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

The Spot Instance replacement strategy to use when Amazon EC2 emits a * rebalance notification signal that your Spot Instance is at an elevated risk of * being interrupted. For more information, see Capacity * rebalancing in the Amazon EC2 User Guide.

See Also:

* AWS * API Reference

*/ class FleetSpotCapacityRebalanceRequest { public: AWS_EC2_API FleetSpotCapacityRebalanceRequest(); AWS_EC2_API FleetSpotCapacityRebalanceRequest(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_EC2_API FleetSpotCapacityRebalanceRequest& 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 replacement strategy to use. Only available for fleets of type * maintain.

launch - EC2 Fleet launches a * replacement Spot Instance when a rebalance notification is emitted for an * existing Spot Instance in the fleet. EC2 Fleet does not terminate the instances * that receive a rebalance notification. You can terminate the old instances, or * you can leave them running. You are charged for all instances while they are * running.

launch-before-terminate - EC2 Fleet launches a * replacement Spot Instance when a rebalance notification is emitted for an * existing Spot Instance in the fleet, and then, after a delay that you specify * (in TerminationDelay), terminates the instances that received a * rebalance notification.

*/ inline const FleetReplacementStrategy& GetReplacementStrategy() const{ return m_replacementStrategy; } /** *

The replacement strategy to use. Only available for fleets of type * maintain.

launch - EC2 Fleet launches a * replacement Spot Instance when a rebalance notification is emitted for an * existing Spot Instance in the fleet. EC2 Fleet does not terminate the instances * that receive a rebalance notification. You can terminate the old instances, or * you can leave them running. You are charged for all instances while they are * running.

launch-before-terminate - EC2 Fleet launches a * replacement Spot Instance when a rebalance notification is emitted for an * existing Spot Instance in the fleet, and then, after a delay that you specify * (in TerminationDelay), terminates the instances that received a * rebalance notification.

*/ inline bool ReplacementStrategyHasBeenSet() const { return m_replacementStrategyHasBeenSet; } /** *

The replacement strategy to use. Only available for fleets of type * maintain.

launch - EC2 Fleet launches a * replacement Spot Instance when a rebalance notification is emitted for an * existing Spot Instance in the fleet. EC2 Fleet does not terminate the instances * that receive a rebalance notification. You can terminate the old instances, or * you can leave them running. You are charged for all instances while they are * running.

launch-before-terminate - EC2 Fleet launches a * replacement Spot Instance when a rebalance notification is emitted for an * existing Spot Instance in the fleet, and then, after a delay that you specify * (in TerminationDelay), terminates the instances that received a * rebalance notification.

*/ inline void SetReplacementStrategy(const FleetReplacementStrategy& value) { m_replacementStrategyHasBeenSet = true; m_replacementStrategy = value; } /** *

The replacement strategy to use. Only available for fleets of type * maintain.

launch - EC2 Fleet launches a * replacement Spot Instance when a rebalance notification is emitted for an * existing Spot Instance in the fleet. EC2 Fleet does not terminate the instances * that receive a rebalance notification. You can terminate the old instances, or * you can leave them running. You are charged for all instances while they are * running.

launch-before-terminate - EC2 Fleet launches a * replacement Spot Instance when a rebalance notification is emitted for an * existing Spot Instance in the fleet, and then, after a delay that you specify * (in TerminationDelay), terminates the instances that received a * rebalance notification.

*/ inline void SetReplacementStrategy(FleetReplacementStrategy&& value) { m_replacementStrategyHasBeenSet = true; m_replacementStrategy = std::move(value); } /** *

The replacement strategy to use. Only available for fleets of type * maintain.

launch - EC2 Fleet launches a * replacement Spot Instance when a rebalance notification is emitted for an * existing Spot Instance in the fleet. EC2 Fleet does not terminate the instances * that receive a rebalance notification. You can terminate the old instances, or * you can leave them running. You are charged for all instances while they are * running.

launch-before-terminate - EC2 Fleet launches a * replacement Spot Instance when a rebalance notification is emitted for an * existing Spot Instance in the fleet, and then, after a delay that you specify * (in TerminationDelay), terminates the instances that received a * rebalance notification.

*/ inline FleetSpotCapacityRebalanceRequest& WithReplacementStrategy(const FleetReplacementStrategy& value) { SetReplacementStrategy(value); return *this;} /** *

The replacement strategy to use. Only available for fleets of type * maintain.

launch - EC2 Fleet launches a * replacement Spot Instance when a rebalance notification is emitted for an * existing Spot Instance in the fleet. EC2 Fleet does not terminate the instances * that receive a rebalance notification. You can terminate the old instances, or * you can leave them running. You are charged for all instances while they are * running.

launch-before-terminate - EC2 Fleet launches a * replacement Spot Instance when a rebalance notification is emitted for an * existing Spot Instance in the fleet, and then, after a delay that you specify * (in TerminationDelay), terminates the instances that received a * rebalance notification.

*/ inline FleetSpotCapacityRebalanceRequest& WithReplacementStrategy(FleetReplacementStrategy&& value) { SetReplacementStrategy(std::move(value)); return *this;} /** *

The amount of time (in seconds) that Amazon EC2 waits before terminating the * old Spot Instance after launching a new replacement Spot Instance.

*

Required when ReplacementStrategy is set to * launch-before-terminate.

Not valid when * ReplacementStrategy is set to launch.

Valid * values: Minimum value of 120 seconds. Maximum value of * 7200 seconds.

*/ inline int GetTerminationDelay() const{ return m_terminationDelay; } /** *

The amount of time (in seconds) that Amazon EC2 waits before terminating the * old Spot Instance after launching a new replacement Spot Instance.

*

Required when ReplacementStrategy is set to * launch-before-terminate.

Not valid when * ReplacementStrategy is set to launch.

Valid * values: Minimum value of 120 seconds. Maximum value of * 7200 seconds.

*/ inline bool TerminationDelayHasBeenSet() const { return m_terminationDelayHasBeenSet; } /** *

The amount of time (in seconds) that Amazon EC2 waits before terminating the * old Spot Instance after launching a new replacement Spot Instance.

*

Required when ReplacementStrategy is set to * launch-before-terminate.

Not valid when * ReplacementStrategy is set to launch.

Valid * values: Minimum value of 120 seconds. Maximum value of * 7200 seconds.

*/ inline void SetTerminationDelay(int value) { m_terminationDelayHasBeenSet = true; m_terminationDelay = value; } /** *

The amount of time (in seconds) that Amazon EC2 waits before terminating the * old Spot Instance after launching a new replacement Spot Instance.

*

Required when ReplacementStrategy is set to * launch-before-terminate.

Not valid when * ReplacementStrategy is set to launch.

Valid * values: Minimum value of 120 seconds. Maximum value of * 7200 seconds.

*/ inline FleetSpotCapacityRebalanceRequest& WithTerminationDelay(int value) { SetTerminationDelay(value); return *this;} private: FleetReplacementStrategy m_replacementStrategy; bool m_replacementStrategyHasBeenSet = false; int m_terminationDelay; bool m_terminationDelayHasBeenSet = false; }; } // namespace Model } // namespace EC2 } // namespace Aws