1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #pragma once 7 #include <aws/ec2/EC2_EXPORTS.h> 8 #include <aws/core/utils/memory/stl/AWSStreamFwd.h> 9 #include <aws/ec2/model/FleetOnDemandAllocationStrategy.h> 10 #include <aws/ec2/model/CapacityReservationOptionsRequest.h> 11 #include <aws/core/utils/memory/stl/AWSString.h> 12 #include <utility> 13 14 namespace Aws 15 { 16 namespace Utils 17 { 18 namespace Xml 19 { 20 class XmlNode; 21 } // namespace Xml 22 } // namespace Utils 23 namespace EC2 24 { 25 namespace Model 26 { 27 28 /** 29 * <p>Describes the configuration of On-Demand Instances in an EC2 30 * Fleet.</p><p><h3>See Also:</h3> <a 31 * href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/OnDemandOptionsRequest">AWS 32 * API Reference</a></p> 33 */ 34 class AWS_EC2_API OnDemandOptionsRequest 35 { 36 public: 37 OnDemandOptionsRequest(); 38 OnDemandOptionsRequest(const Aws::Utils::Xml::XmlNode& xmlNode); 39 OnDemandOptionsRequest& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); 40 41 void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; 42 void OutputToStream(Aws::OStream& oStream, const char* location) const; 43 44 45 /** 46 * <p>The order of the launch template overrides to use in fulfilling On-Demand 47 * capacity. If you specify <code>lowest-price</code>, EC2 Fleet uses price to 48 * determine the order, launching the lowest price first. If you specify 49 * <code>prioritized</code>, EC2 Fleet uses the priority that you assigned to each 50 * launch template override, launching the highest priority first. If you do not 51 * specify a value, EC2 Fleet defaults to <code>lowest-price</code>.</p> 52 */ GetAllocationStrategy()53 inline const FleetOnDemandAllocationStrategy& GetAllocationStrategy() const{ return m_allocationStrategy; } 54 55 /** 56 * <p>The order of the launch template overrides to use in fulfilling On-Demand 57 * capacity. If you specify <code>lowest-price</code>, EC2 Fleet uses price to 58 * determine the order, launching the lowest price first. If you specify 59 * <code>prioritized</code>, EC2 Fleet uses the priority that you assigned to each 60 * launch template override, launching the highest priority first. If you do not 61 * specify a value, EC2 Fleet defaults to <code>lowest-price</code>.</p> 62 */ AllocationStrategyHasBeenSet()63 inline bool AllocationStrategyHasBeenSet() const { return m_allocationStrategyHasBeenSet; } 64 65 /** 66 * <p>The order of the launch template overrides to use in fulfilling On-Demand 67 * capacity. If you specify <code>lowest-price</code>, EC2 Fleet uses price to 68 * determine the order, launching the lowest price first. If you specify 69 * <code>prioritized</code>, EC2 Fleet uses the priority that you assigned to each 70 * launch template override, launching the highest priority first. If you do not 71 * specify a value, EC2 Fleet defaults to <code>lowest-price</code>.</p> 72 */ SetAllocationStrategy(const FleetOnDemandAllocationStrategy & value)73 inline void SetAllocationStrategy(const FleetOnDemandAllocationStrategy& value) { m_allocationStrategyHasBeenSet = true; m_allocationStrategy = value; } 74 75 /** 76 * <p>The order of the launch template overrides to use in fulfilling On-Demand 77 * capacity. If you specify <code>lowest-price</code>, EC2 Fleet uses price to 78 * determine the order, launching the lowest price first. If you specify 79 * <code>prioritized</code>, EC2 Fleet uses the priority that you assigned to each 80 * launch template override, launching the highest priority first. If you do not 81 * specify a value, EC2 Fleet defaults to <code>lowest-price</code>.</p> 82 */ SetAllocationStrategy(FleetOnDemandAllocationStrategy && value)83 inline void SetAllocationStrategy(FleetOnDemandAllocationStrategy&& value) { m_allocationStrategyHasBeenSet = true; m_allocationStrategy = std::move(value); } 84 85 /** 86 * <p>The order of the launch template overrides to use in fulfilling On-Demand 87 * capacity. If you specify <code>lowest-price</code>, EC2 Fleet uses price to 88 * determine the order, launching the lowest price first. If you specify 89 * <code>prioritized</code>, EC2 Fleet uses the priority that you assigned to each 90 * launch template override, launching the highest priority first. If you do not 91 * specify a value, EC2 Fleet defaults to <code>lowest-price</code>.</p> 92 */ WithAllocationStrategy(const FleetOnDemandAllocationStrategy & value)93 inline OnDemandOptionsRequest& WithAllocationStrategy(const FleetOnDemandAllocationStrategy& value) { SetAllocationStrategy(value); return *this;} 94 95 /** 96 * <p>The order of the launch template overrides to use in fulfilling On-Demand 97 * capacity. If you specify <code>lowest-price</code>, EC2 Fleet uses price to 98 * determine the order, launching the lowest price first. If you specify 99 * <code>prioritized</code>, EC2 Fleet uses the priority that you assigned to each 100 * launch template override, launching the highest priority first. If you do not 101 * specify a value, EC2 Fleet defaults to <code>lowest-price</code>.</p> 102 */ WithAllocationStrategy(FleetOnDemandAllocationStrategy && value)103 inline OnDemandOptionsRequest& WithAllocationStrategy(FleetOnDemandAllocationStrategy&& value) { SetAllocationStrategy(std::move(value)); return *this;} 104 105 106 /** 107 * <p>The strategy for using unused Capacity Reservations for fulfilling On-Demand 108 * capacity. Supported only for fleets of type <code>instant</code>.</p> 109 */ GetCapacityReservationOptions()110 inline const CapacityReservationOptionsRequest& GetCapacityReservationOptions() const{ return m_capacityReservationOptions; } 111 112 /** 113 * <p>The strategy for using unused Capacity Reservations for fulfilling On-Demand 114 * capacity. Supported only for fleets of type <code>instant</code>.</p> 115 */ CapacityReservationOptionsHasBeenSet()116 inline bool CapacityReservationOptionsHasBeenSet() const { return m_capacityReservationOptionsHasBeenSet; } 117 118 /** 119 * <p>The strategy for using unused Capacity Reservations for fulfilling On-Demand 120 * capacity. Supported only for fleets of type <code>instant</code>.</p> 121 */ SetCapacityReservationOptions(const CapacityReservationOptionsRequest & value)122 inline void SetCapacityReservationOptions(const CapacityReservationOptionsRequest& value) { m_capacityReservationOptionsHasBeenSet = true; m_capacityReservationOptions = value; } 123 124 /** 125 * <p>The strategy for using unused Capacity Reservations for fulfilling On-Demand 126 * capacity. Supported only for fleets of type <code>instant</code>.</p> 127 */ SetCapacityReservationOptions(CapacityReservationOptionsRequest && value)128 inline void SetCapacityReservationOptions(CapacityReservationOptionsRequest&& value) { m_capacityReservationOptionsHasBeenSet = true; m_capacityReservationOptions = std::move(value); } 129 130 /** 131 * <p>The strategy for using unused Capacity Reservations for fulfilling On-Demand 132 * capacity. Supported only for fleets of type <code>instant</code>.</p> 133 */ WithCapacityReservationOptions(const CapacityReservationOptionsRequest & value)134 inline OnDemandOptionsRequest& WithCapacityReservationOptions(const CapacityReservationOptionsRequest& value) { SetCapacityReservationOptions(value); return *this;} 135 136 /** 137 * <p>The strategy for using unused Capacity Reservations for fulfilling On-Demand 138 * capacity. Supported only for fleets of type <code>instant</code>.</p> 139 */ WithCapacityReservationOptions(CapacityReservationOptionsRequest && value)140 inline OnDemandOptionsRequest& WithCapacityReservationOptions(CapacityReservationOptionsRequest&& value) { SetCapacityReservationOptions(std::move(value)); return *this;} 141 142 143 /** 144 * <p>Indicates that the fleet uses a single instance type to launch all On-Demand 145 * Instances in the fleet. Supported only for fleets of type 146 * <code>instant</code>.</p> 147 */ GetSingleInstanceType()148 inline bool GetSingleInstanceType() const{ return m_singleInstanceType; } 149 150 /** 151 * <p>Indicates that the fleet uses a single instance type to launch all On-Demand 152 * Instances in the fleet. Supported only for fleets of type 153 * <code>instant</code>.</p> 154 */ SingleInstanceTypeHasBeenSet()155 inline bool SingleInstanceTypeHasBeenSet() const { return m_singleInstanceTypeHasBeenSet; } 156 157 /** 158 * <p>Indicates that the fleet uses a single instance type to launch all On-Demand 159 * Instances in the fleet. Supported only for fleets of type 160 * <code>instant</code>.</p> 161 */ SetSingleInstanceType(bool value)162 inline void SetSingleInstanceType(bool value) { m_singleInstanceTypeHasBeenSet = true; m_singleInstanceType = value; } 163 164 /** 165 * <p>Indicates that the fleet uses a single instance type to launch all On-Demand 166 * Instances in the fleet. Supported only for fleets of type 167 * <code>instant</code>.</p> 168 */ WithSingleInstanceType(bool value)169 inline OnDemandOptionsRequest& WithSingleInstanceType(bool value) { SetSingleInstanceType(value); return *this;} 170 171 172 /** 173 * <p>Indicates that the fleet launches all On-Demand Instances into a single 174 * Availability Zone. Supported only for fleets of type <code>instant</code>.</p> 175 */ GetSingleAvailabilityZone()176 inline bool GetSingleAvailabilityZone() const{ return m_singleAvailabilityZone; } 177 178 /** 179 * <p>Indicates that the fleet launches all On-Demand Instances into a single 180 * Availability Zone. Supported only for fleets of type <code>instant</code>.</p> 181 */ SingleAvailabilityZoneHasBeenSet()182 inline bool SingleAvailabilityZoneHasBeenSet() const { return m_singleAvailabilityZoneHasBeenSet; } 183 184 /** 185 * <p>Indicates that the fleet launches all On-Demand Instances into a single 186 * Availability Zone. Supported only for fleets of type <code>instant</code>.</p> 187 */ SetSingleAvailabilityZone(bool value)188 inline void SetSingleAvailabilityZone(bool value) { m_singleAvailabilityZoneHasBeenSet = true; m_singleAvailabilityZone = value; } 189 190 /** 191 * <p>Indicates that the fleet launches all On-Demand Instances into a single 192 * Availability Zone. Supported only for fleets of type <code>instant</code>.</p> 193 */ WithSingleAvailabilityZone(bool value)194 inline OnDemandOptionsRequest& WithSingleAvailabilityZone(bool value) { SetSingleAvailabilityZone(value); return *this;} 195 196 197 /** 198 * <p>The minimum target capacity for On-Demand Instances in the fleet. If the 199 * minimum target capacity is not reached, the fleet launches no instances.</p> 200 */ GetMinTargetCapacity()201 inline int GetMinTargetCapacity() const{ return m_minTargetCapacity; } 202 203 /** 204 * <p>The minimum target capacity for On-Demand Instances in the fleet. If the 205 * minimum target capacity is not reached, the fleet launches no instances.</p> 206 */ MinTargetCapacityHasBeenSet()207 inline bool MinTargetCapacityHasBeenSet() const { return m_minTargetCapacityHasBeenSet; } 208 209 /** 210 * <p>The minimum target capacity for On-Demand Instances in the fleet. If the 211 * minimum target capacity is not reached, the fleet launches no instances.</p> 212 */ SetMinTargetCapacity(int value)213 inline void SetMinTargetCapacity(int value) { m_minTargetCapacityHasBeenSet = true; m_minTargetCapacity = value; } 214 215 /** 216 * <p>The minimum target capacity for On-Demand Instances in the fleet. If the 217 * minimum target capacity is not reached, the fleet launches no instances.</p> 218 */ WithMinTargetCapacity(int value)219 inline OnDemandOptionsRequest& WithMinTargetCapacity(int value) { SetMinTargetCapacity(value); return *this;} 220 221 222 /** 223 * <p>The maximum amount per hour for On-Demand Instances that you're willing to 224 * pay.</p> 225 */ GetMaxTotalPrice()226 inline const Aws::String& GetMaxTotalPrice() const{ return m_maxTotalPrice; } 227 228 /** 229 * <p>The maximum amount per hour for On-Demand Instances that you're willing to 230 * pay.</p> 231 */ MaxTotalPriceHasBeenSet()232 inline bool MaxTotalPriceHasBeenSet() const { return m_maxTotalPriceHasBeenSet; } 233 234 /** 235 * <p>The maximum amount per hour for On-Demand Instances that you're willing to 236 * pay.</p> 237 */ SetMaxTotalPrice(const Aws::String & value)238 inline void SetMaxTotalPrice(const Aws::String& value) { m_maxTotalPriceHasBeenSet = true; m_maxTotalPrice = value; } 239 240 /** 241 * <p>The maximum amount per hour for On-Demand Instances that you're willing to 242 * pay.</p> 243 */ SetMaxTotalPrice(Aws::String && value)244 inline void SetMaxTotalPrice(Aws::String&& value) { m_maxTotalPriceHasBeenSet = true; m_maxTotalPrice = std::move(value); } 245 246 /** 247 * <p>The maximum amount per hour for On-Demand Instances that you're willing to 248 * pay.</p> 249 */ SetMaxTotalPrice(const char * value)250 inline void SetMaxTotalPrice(const char* value) { m_maxTotalPriceHasBeenSet = true; m_maxTotalPrice.assign(value); } 251 252 /** 253 * <p>The maximum amount per hour for On-Demand Instances that you're willing to 254 * pay.</p> 255 */ WithMaxTotalPrice(const Aws::String & value)256 inline OnDemandOptionsRequest& WithMaxTotalPrice(const Aws::String& value) { SetMaxTotalPrice(value); return *this;} 257 258 /** 259 * <p>The maximum amount per hour for On-Demand Instances that you're willing to 260 * pay.</p> 261 */ WithMaxTotalPrice(Aws::String && value)262 inline OnDemandOptionsRequest& WithMaxTotalPrice(Aws::String&& value) { SetMaxTotalPrice(std::move(value)); return *this;} 263 264 /** 265 * <p>The maximum amount per hour for On-Demand Instances that you're willing to 266 * pay.</p> 267 */ WithMaxTotalPrice(const char * value)268 inline OnDemandOptionsRequest& WithMaxTotalPrice(const char* value) { SetMaxTotalPrice(value); return *this;} 269 270 private: 271 272 FleetOnDemandAllocationStrategy m_allocationStrategy; 273 bool m_allocationStrategyHasBeenSet; 274 275 CapacityReservationOptionsRequest m_capacityReservationOptions; 276 bool m_capacityReservationOptionsHasBeenSet; 277 278 bool m_singleInstanceType; 279 bool m_singleInstanceTypeHasBeenSet; 280 281 bool m_singleAvailabilityZone; 282 bool m_singleAvailabilityZoneHasBeenSet; 283 284 int m_minTargetCapacity; 285 bool m_minTargetCapacityHasBeenSet; 286 287 Aws::String m_maxTotalPrice; 288 bool m_maxTotalPriceHasBeenSet; 289 }; 290 291 } // namespace Model 292 } // namespace EC2 293 } // namespace Aws 294