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/ec2/EC2Request.h>
9 #include <aws/core/utils/memory/stl/AWSString.h>
10 #include <aws/ec2/model/SpotOptionsRequest.h>
11 #include <aws/ec2/model/OnDemandOptionsRequest.h>
12 #include <aws/ec2/model/FleetExcessCapacityTerminationPolicy.h>
13 #include <aws/core/utils/memory/stl/AWSVector.h>
14 #include <aws/ec2/model/TargetCapacitySpecificationRequest.h>
15 #include <aws/ec2/model/FleetType.h>
16 #include <aws/core/utils/DateTime.h>
17 #include <aws/ec2/model/FleetLaunchTemplateConfigRequest.h>
18 #include <aws/ec2/model/TagSpecification.h>
19 #include <utility>
20 
21 namespace Aws
22 {
23 namespace EC2
24 {
25 namespace Model
26 {
27 
28   /**
29    */
30   class AWS_EC2_API CreateFleetRequest : public EC2Request
31   {
32   public:
33     CreateFleetRequest();
34 
35     // Service request name is the Operation name which will send this request out,
36     // each operation should has unique request name, so that we can get operation's name from this request.
37     // Note: this is not true for response, multiple operations may have the same response name,
38     // so we can not get operation's name from response.
GetServiceRequestName()39     inline virtual const char* GetServiceRequestName() const override { return "CreateFleet"; }
40 
41     Aws::String SerializePayload() const override;
42 
43   protected:
44     void DumpBodyToUrl(Aws::Http::URI& uri ) const override;
45 
46   public:
47 
48     /**
49      * <p>Checks whether you have the required permissions for the action, without
50      * actually making the request, and provides an error response. If you have the
51      * required permissions, the error response is <code>DryRunOperation</code>.
52      * Otherwise, it is <code>UnauthorizedOperation</code>.</p>
53      */
GetDryRun()54     inline bool GetDryRun() const{ return m_dryRun; }
55 
56     /**
57      * <p>Checks whether you have the required permissions for the action, without
58      * actually making the request, and provides an error response. If you have the
59      * required permissions, the error response is <code>DryRunOperation</code>.
60      * Otherwise, it is <code>UnauthorizedOperation</code>.</p>
61      */
DryRunHasBeenSet()62     inline bool DryRunHasBeenSet() const { return m_dryRunHasBeenSet; }
63 
64     /**
65      * <p>Checks whether you have the required permissions for the action, without
66      * actually making the request, and provides an error response. If you have the
67      * required permissions, the error response is <code>DryRunOperation</code>.
68      * Otherwise, it is <code>UnauthorizedOperation</code>.</p>
69      */
SetDryRun(bool value)70     inline void SetDryRun(bool value) { m_dryRunHasBeenSet = true; m_dryRun = value; }
71 
72     /**
73      * <p>Checks whether you have the required permissions for the action, without
74      * actually making the request, and provides an error response. If you have the
75      * required permissions, the error response is <code>DryRunOperation</code>.
76      * Otherwise, it is <code>UnauthorizedOperation</code>.</p>
77      */
WithDryRun(bool value)78     inline CreateFleetRequest& WithDryRun(bool value) { SetDryRun(value); return *this;}
79 
80 
81     /**
82      * <p>Unique, case-sensitive identifier that you provide to ensure the idempotency
83      * of the request. For more information, see <a
84      * href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring
85      * Idempotency</a>.</p>
86      */
GetClientToken()87     inline const Aws::String& GetClientToken() const{ return m_clientToken; }
88 
89     /**
90      * <p>Unique, case-sensitive identifier that you provide to ensure the idempotency
91      * of the request. For more information, see <a
92      * href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring
93      * Idempotency</a>.</p>
94      */
ClientTokenHasBeenSet()95     inline bool ClientTokenHasBeenSet() const { return m_clientTokenHasBeenSet; }
96 
97     /**
98      * <p>Unique, case-sensitive identifier that you provide to ensure the idempotency
99      * of the request. For more information, see <a
100      * href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring
101      * Idempotency</a>.</p>
102      */
SetClientToken(const Aws::String & value)103     inline void SetClientToken(const Aws::String& value) { m_clientTokenHasBeenSet = true; m_clientToken = value; }
104 
105     /**
106      * <p>Unique, case-sensitive identifier that you provide to ensure the idempotency
107      * of the request. For more information, see <a
108      * href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring
109      * Idempotency</a>.</p>
110      */
SetClientToken(Aws::String && value)111     inline void SetClientToken(Aws::String&& value) { m_clientTokenHasBeenSet = true; m_clientToken = std::move(value); }
112 
113     /**
114      * <p>Unique, case-sensitive identifier that you provide to ensure the idempotency
115      * of the request. For more information, see <a
116      * href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring
117      * Idempotency</a>.</p>
118      */
SetClientToken(const char * value)119     inline void SetClientToken(const char* value) { m_clientTokenHasBeenSet = true; m_clientToken.assign(value); }
120 
121     /**
122      * <p>Unique, case-sensitive identifier that you provide to ensure the idempotency
123      * of the request. For more information, see <a
124      * href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring
125      * Idempotency</a>.</p>
126      */
WithClientToken(const Aws::String & value)127     inline CreateFleetRequest& WithClientToken(const Aws::String& value) { SetClientToken(value); return *this;}
128 
129     /**
130      * <p>Unique, case-sensitive identifier that you provide to ensure the idempotency
131      * of the request. For more information, see <a
132      * href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring
133      * Idempotency</a>.</p>
134      */
WithClientToken(Aws::String && value)135     inline CreateFleetRequest& WithClientToken(Aws::String&& value) { SetClientToken(std::move(value)); return *this;}
136 
137     /**
138      * <p>Unique, case-sensitive identifier that you provide to ensure the idempotency
139      * of the request. For more information, see <a
140      * href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring
141      * Idempotency</a>.</p>
142      */
WithClientToken(const char * value)143     inline CreateFleetRequest& WithClientToken(const char* value) { SetClientToken(value); return *this;}
144 
145 
146     /**
147      * <p>Describes the configuration of Spot Instances in an EC2 Fleet.</p>
148      */
GetSpotOptions()149     inline const SpotOptionsRequest& GetSpotOptions() const{ return m_spotOptions; }
150 
151     /**
152      * <p>Describes the configuration of Spot Instances in an EC2 Fleet.</p>
153      */
SpotOptionsHasBeenSet()154     inline bool SpotOptionsHasBeenSet() const { return m_spotOptionsHasBeenSet; }
155 
156     /**
157      * <p>Describes the configuration of Spot Instances in an EC2 Fleet.</p>
158      */
SetSpotOptions(const SpotOptionsRequest & value)159     inline void SetSpotOptions(const SpotOptionsRequest& value) { m_spotOptionsHasBeenSet = true; m_spotOptions = value; }
160 
161     /**
162      * <p>Describes the configuration of Spot Instances in an EC2 Fleet.</p>
163      */
SetSpotOptions(SpotOptionsRequest && value)164     inline void SetSpotOptions(SpotOptionsRequest&& value) { m_spotOptionsHasBeenSet = true; m_spotOptions = std::move(value); }
165 
166     /**
167      * <p>Describes the configuration of Spot Instances in an EC2 Fleet.</p>
168      */
WithSpotOptions(const SpotOptionsRequest & value)169     inline CreateFleetRequest& WithSpotOptions(const SpotOptionsRequest& value) { SetSpotOptions(value); return *this;}
170 
171     /**
172      * <p>Describes the configuration of Spot Instances in an EC2 Fleet.</p>
173      */
WithSpotOptions(SpotOptionsRequest && value)174     inline CreateFleetRequest& WithSpotOptions(SpotOptionsRequest&& value) { SetSpotOptions(std::move(value)); return *this;}
175 
176 
177     /**
178      * <p>Describes the configuration of On-Demand Instances in an EC2 Fleet.</p>
179      */
GetOnDemandOptions()180     inline const OnDemandOptionsRequest& GetOnDemandOptions() const{ return m_onDemandOptions; }
181 
182     /**
183      * <p>Describes the configuration of On-Demand Instances in an EC2 Fleet.</p>
184      */
OnDemandOptionsHasBeenSet()185     inline bool OnDemandOptionsHasBeenSet() const { return m_onDemandOptionsHasBeenSet; }
186 
187     /**
188      * <p>Describes the configuration of On-Demand Instances in an EC2 Fleet.</p>
189      */
SetOnDemandOptions(const OnDemandOptionsRequest & value)190     inline void SetOnDemandOptions(const OnDemandOptionsRequest& value) { m_onDemandOptionsHasBeenSet = true; m_onDemandOptions = value; }
191 
192     /**
193      * <p>Describes the configuration of On-Demand Instances in an EC2 Fleet.</p>
194      */
SetOnDemandOptions(OnDemandOptionsRequest && value)195     inline void SetOnDemandOptions(OnDemandOptionsRequest&& value) { m_onDemandOptionsHasBeenSet = true; m_onDemandOptions = std::move(value); }
196 
197     /**
198      * <p>Describes the configuration of On-Demand Instances in an EC2 Fleet.</p>
199      */
WithOnDemandOptions(const OnDemandOptionsRequest & value)200     inline CreateFleetRequest& WithOnDemandOptions(const OnDemandOptionsRequest& value) { SetOnDemandOptions(value); return *this;}
201 
202     /**
203      * <p>Describes the configuration of On-Demand Instances in an EC2 Fleet.</p>
204      */
WithOnDemandOptions(OnDemandOptionsRequest && value)205     inline CreateFleetRequest& WithOnDemandOptions(OnDemandOptionsRequest&& value) { SetOnDemandOptions(std::move(value)); return *this;}
206 
207 
208     /**
209      * <p>Indicates whether running instances should be terminated if the total target
210      * capacity of the EC2 Fleet is decreased below the current size of the EC2
211      * Fleet.</p>
212      */
GetExcessCapacityTerminationPolicy()213     inline const FleetExcessCapacityTerminationPolicy& GetExcessCapacityTerminationPolicy() const{ return m_excessCapacityTerminationPolicy; }
214 
215     /**
216      * <p>Indicates whether running instances should be terminated if the total target
217      * capacity of the EC2 Fleet is decreased below the current size of the EC2
218      * Fleet.</p>
219      */
ExcessCapacityTerminationPolicyHasBeenSet()220     inline bool ExcessCapacityTerminationPolicyHasBeenSet() const { return m_excessCapacityTerminationPolicyHasBeenSet; }
221 
222     /**
223      * <p>Indicates whether running instances should be terminated if the total target
224      * capacity of the EC2 Fleet is decreased below the current size of the EC2
225      * Fleet.</p>
226      */
SetExcessCapacityTerminationPolicy(const FleetExcessCapacityTerminationPolicy & value)227     inline void SetExcessCapacityTerminationPolicy(const FleetExcessCapacityTerminationPolicy& value) { m_excessCapacityTerminationPolicyHasBeenSet = true; m_excessCapacityTerminationPolicy = value; }
228 
229     /**
230      * <p>Indicates whether running instances should be terminated if the total target
231      * capacity of the EC2 Fleet is decreased below the current size of the EC2
232      * Fleet.</p>
233      */
SetExcessCapacityTerminationPolicy(FleetExcessCapacityTerminationPolicy && value)234     inline void SetExcessCapacityTerminationPolicy(FleetExcessCapacityTerminationPolicy&& value) { m_excessCapacityTerminationPolicyHasBeenSet = true; m_excessCapacityTerminationPolicy = std::move(value); }
235 
236     /**
237      * <p>Indicates whether running instances should be terminated if the total target
238      * capacity of the EC2 Fleet is decreased below the current size of the EC2
239      * Fleet.</p>
240      */
WithExcessCapacityTerminationPolicy(const FleetExcessCapacityTerminationPolicy & value)241     inline CreateFleetRequest& WithExcessCapacityTerminationPolicy(const FleetExcessCapacityTerminationPolicy& value) { SetExcessCapacityTerminationPolicy(value); return *this;}
242 
243     /**
244      * <p>Indicates whether running instances should be terminated if the total target
245      * capacity of the EC2 Fleet is decreased below the current size of the EC2
246      * Fleet.</p>
247      */
WithExcessCapacityTerminationPolicy(FleetExcessCapacityTerminationPolicy && value)248     inline CreateFleetRequest& WithExcessCapacityTerminationPolicy(FleetExcessCapacityTerminationPolicy&& value) { SetExcessCapacityTerminationPolicy(std::move(value)); return *this;}
249 
250 
251     /**
252      * <p>The configuration for the EC2 Fleet.</p>
253      */
GetLaunchTemplateConfigs()254     inline const Aws::Vector<FleetLaunchTemplateConfigRequest>& GetLaunchTemplateConfigs() const{ return m_launchTemplateConfigs; }
255 
256     /**
257      * <p>The configuration for the EC2 Fleet.</p>
258      */
LaunchTemplateConfigsHasBeenSet()259     inline bool LaunchTemplateConfigsHasBeenSet() const { return m_launchTemplateConfigsHasBeenSet; }
260 
261     /**
262      * <p>The configuration for the EC2 Fleet.</p>
263      */
SetLaunchTemplateConfigs(const Aws::Vector<FleetLaunchTemplateConfigRequest> & value)264     inline void SetLaunchTemplateConfigs(const Aws::Vector<FleetLaunchTemplateConfigRequest>& value) { m_launchTemplateConfigsHasBeenSet = true; m_launchTemplateConfigs = value; }
265 
266     /**
267      * <p>The configuration for the EC2 Fleet.</p>
268      */
SetLaunchTemplateConfigs(Aws::Vector<FleetLaunchTemplateConfigRequest> && value)269     inline void SetLaunchTemplateConfigs(Aws::Vector<FleetLaunchTemplateConfigRequest>&& value) { m_launchTemplateConfigsHasBeenSet = true; m_launchTemplateConfigs = std::move(value); }
270 
271     /**
272      * <p>The configuration for the EC2 Fleet.</p>
273      */
WithLaunchTemplateConfigs(const Aws::Vector<FleetLaunchTemplateConfigRequest> & value)274     inline CreateFleetRequest& WithLaunchTemplateConfigs(const Aws::Vector<FleetLaunchTemplateConfigRequest>& value) { SetLaunchTemplateConfigs(value); return *this;}
275 
276     /**
277      * <p>The configuration for the EC2 Fleet.</p>
278      */
WithLaunchTemplateConfigs(Aws::Vector<FleetLaunchTemplateConfigRequest> && value)279     inline CreateFleetRequest& WithLaunchTemplateConfigs(Aws::Vector<FleetLaunchTemplateConfigRequest>&& value) { SetLaunchTemplateConfigs(std::move(value)); return *this;}
280 
281     /**
282      * <p>The configuration for the EC2 Fleet.</p>
283      */
AddLaunchTemplateConfigs(const FleetLaunchTemplateConfigRequest & value)284     inline CreateFleetRequest& AddLaunchTemplateConfigs(const FleetLaunchTemplateConfigRequest& value) { m_launchTemplateConfigsHasBeenSet = true; m_launchTemplateConfigs.push_back(value); return *this; }
285 
286     /**
287      * <p>The configuration for the EC2 Fleet.</p>
288      */
AddLaunchTemplateConfigs(FleetLaunchTemplateConfigRequest && value)289     inline CreateFleetRequest& AddLaunchTemplateConfigs(FleetLaunchTemplateConfigRequest&& value) { m_launchTemplateConfigsHasBeenSet = true; m_launchTemplateConfigs.push_back(std::move(value)); return *this; }
290 
291 
292     /**
293      * <p>The number of units to request.</p>
294      */
GetTargetCapacitySpecification()295     inline const TargetCapacitySpecificationRequest& GetTargetCapacitySpecification() const{ return m_targetCapacitySpecification; }
296 
297     /**
298      * <p>The number of units to request.</p>
299      */
TargetCapacitySpecificationHasBeenSet()300     inline bool TargetCapacitySpecificationHasBeenSet() const { return m_targetCapacitySpecificationHasBeenSet; }
301 
302     /**
303      * <p>The number of units to request.</p>
304      */
SetTargetCapacitySpecification(const TargetCapacitySpecificationRequest & value)305     inline void SetTargetCapacitySpecification(const TargetCapacitySpecificationRequest& value) { m_targetCapacitySpecificationHasBeenSet = true; m_targetCapacitySpecification = value; }
306 
307     /**
308      * <p>The number of units to request.</p>
309      */
SetTargetCapacitySpecification(TargetCapacitySpecificationRequest && value)310     inline void SetTargetCapacitySpecification(TargetCapacitySpecificationRequest&& value) { m_targetCapacitySpecificationHasBeenSet = true; m_targetCapacitySpecification = std::move(value); }
311 
312     /**
313      * <p>The number of units to request.</p>
314      */
WithTargetCapacitySpecification(const TargetCapacitySpecificationRequest & value)315     inline CreateFleetRequest& WithTargetCapacitySpecification(const TargetCapacitySpecificationRequest& value) { SetTargetCapacitySpecification(value); return *this;}
316 
317     /**
318      * <p>The number of units to request.</p>
319      */
WithTargetCapacitySpecification(TargetCapacitySpecificationRequest && value)320     inline CreateFleetRequest& WithTargetCapacitySpecification(TargetCapacitySpecificationRequest&& value) { SetTargetCapacitySpecification(std::move(value)); return *this;}
321 
322 
323     /**
324      * <p>Indicates whether running instances should be terminated when the EC2 Fleet
325      * expires.</p>
326      */
GetTerminateInstancesWithExpiration()327     inline bool GetTerminateInstancesWithExpiration() const{ return m_terminateInstancesWithExpiration; }
328 
329     /**
330      * <p>Indicates whether running instances should be terminated when the EC2 Fleet
331      * expires.</p>
332      */
TerminateInstancesWithExpirationHasBeenSet()333     inline bool TerminateInstancesWithExpirationHasBeenSet() const { return m_terminateInstancesWithExpirationHasBeenSet; }
334 
335     /**
336      * <p>Indicates whether running instances should be terminated when the EC2 Fleet
337      * expires.</p>
338      */
SetTerminateInstancesWithExpiration(bool value)339     inline void SetTerminateInstancesWithExpiration(bool value) { m_terminateInstancesWithExpirationHasBeenSet = true; m_terminateInstancesWithExpiration = value; }
340 
341     /**
342      * <p>Indicates whether running instances should be terminated when the EC2 Fleet
343      * expires.</p>
344      */
WithTerminateInstancesWithExpiration(bool value)345     inline CreateFleetRequest& WithTerminateInstancesWithExpiration(bool value) { SetTerminateInstancesWithExpiration(value); return *this;}
346 
347 
348     /**
349      * <p>The fleet type. The default value is <code>maintain</code>.</p> <ul> <li> <p>
350      * <code>maintain</code> - The EC2 Fleet places an asynchronous request for your
351      * desired capacity, and continues to maintain your desired Spot capacity by
352      * replenishing interrupted Spot Instances.</p> </li> <li> <p> <code>request</code>
353      * - The EC2 Fleet places an asynchronous one-time request for your desired
354      * capacity, but does submit Spot requests in alternative capacity pools if Spot
355      * capacity is unavailable, and does not maintain Spot capacity if Spot Instances
356      * are interrupted.</p> </li> <li> <p> <code>instant</code> - The EC2 Fleet places
357      * a synchronous one-time request for your desired capacity, and returns errors for
358      * any instances that could not be launched.</p> </li> </ul> <p>For more
359      * information, see <a
360      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-configuration-strategies.html#ec2-fleet-request-type">EC2
361      * Fleet request types</a> in the <i>Amazon EC2 User Guide</i>.</p>
362      */
GetType()363     inline const FleetType& GetType() const{ return m_type; }
364 
365     /**
366      * <p>The fleet type. The default value is <code>maintain</code>.</p> <ul> <li> <p>
367      * <code>maintain</code> - The EC2 Fleet places an asynchronous request for your
368      * desired capacity, and continues to maintain your desired Spot capacity by
369      * replenishing interrupted Spot Instances.</p> </li> <li> <p> <code>request</code>
370      * - The EC2 Fleet places an asynchronous one-time request for your desired
371      * capacity, but does submit Spot requests in alternative capacity pools if Spot
372      * capacity is unavailable, and does not maintain Spot capacity if Spot Instances
373      * are interrupted.</p> </li> <li> <p> <code>instant</code> - The EC2 Fleet places
374      * a synchronous one-time request for your desired capacity, and returns errors for
375      * any instances that could not be launched.</p> </li> </ul> <p>For more
376      * information, see <a
377      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-configuration-strategies.html#ec2-fleet-request-type">EC2
378      * Fleet request types</a> in the <i>Amazon EC2 User Guide</i>.</p>
379      */
TypeHasBeenSet()380     inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; }
381 
382     /**
383      * <p>The fleet type. The default value is <code>maintain</code>.</p> <ul> <li> <p>
384      * <code>maintain</code> - The EC2 Fleet places an asynchronous request for your
385      * desired capacity, and continues to maintain your desired Spot capacity by
386      * replenishing interrupted Spot Instances.</p> </li> <li> <p> <code>request</code>
387      * - The EC2 Fleet places an asynchronous one-time request for your desired
388      * capacity, but does submit Spot requests in alternative capacity pools if Spot
389      * capacity is unavailable, and does not maintain Spot capacity if Spot Instances
390      * are interrupted.</p> </li> <li> <p> <code>instant</code> - The EC2 Fleet places
391      * a synchronous one-time request for your desired capacity, and returns errors for
392      * any instances that could not be launched.</p> </li> </ul> <p>For more
393      * information, see <a
394      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-configuration-strategies.html#ec2-fleet-request-type">EC2
395      * Fleet request types</a> in the <i>Amazon EC2 User Guide</i>.</p>
396      */
SetType(const FleetType & value)397     inline void SetType(const FleetType& value) { m_typeHasBeenSet = true; m_type = value; }
398 
399     /**
400      * <p>The fleet type. The default value is <code>maintain</code>.</p> <ul> <li> <p>
401      * <code>maintain</code> - The EC2 Fleet places an asynchronous request for your
402      * desired capacity, and continues to maintain your desired Spot capacity by
403      * replenishing interrupted Spot Instances.</p> </li> <li> <p> <code>request</code>
404      * - The EC2 Fleet places an asynchronous one-time request for your desired
405      * capacity, but does submit Spot requests in alternative capacity pools if Spot
406      * capacity is unavailable, and does not maintain Spot capacity if Spot Instances
407      * are interrupted.</p> </li> <li> <p> <code>instant</code> - The EC2 Fleet places
408      * a synchronous one-time request for your desired capacity, and returns errors for
409      * any instances that could not be launched.</p> </li> </ul> <p>For more
410      * information, see <a
411      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-configuration-strategies.html#ec2-fleet-request-type">EC2
412      * Fleet request types</a> in the <i>Amazon EC2 User Guide</i>.</p>
413      */
SetType(FleetType && value)414     inline void SetType(FleetType&& value) { m_typeHasBeenSet = true; m_type = std::move(value); }
415 
416     /**
417      * <p>The fleet type. The default value is <code>maintain</code>.</p> <ul> <li> <p>
418      * <code>maintain</code> - The EC2 Fleet places an asynchronous request for your
419      * desired capacity, and continues to maintain your desired Spot capacity by
420      * replenishing interrupted Spot Instances.</p> </li> <li> <p> <code>request</code>
421      * - The EC2 Fleet places an asynchronous one-time request for your desired
422      * capacity, but does submit Spot requests in alternative capacity pools if Spot
423      * capacity is unavailable, and does not maintain Spot capacity if Spot Instances
424      * are interrupted.</p> </li> <li> <p> <code>instant</code> - The EC2 Fleet places
425      * a synchronous one-time request for your desired capacity, and returns errors for
426      * any instances that could not be launched.</p> </li> </ul> <p>For more
427      * information, see <a
428      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-configuration-strategies.html#ec2-fleet-request-type">EC2
429      * Fleet request types</a> in the <i>Amazon EC2 User Guide</i>.</p>
430      */
WithType(const FleetType & value)431     inline CreateFleetRequest& WithType(const FleetType& value) { SetType(value); return *this;}
432 
433     /**
434      * <p>The fleet type. The default value is <code>maintain</code>.</p> <ul> <li> <p>
435      * <code>maintain</code> - The EC2 Fleet places an asynchronous request for your
436      * desired capacity, and continues to maintain your desired Spot capacity by
437      * replenishing interrupted Spot Instances.</p> </li> <li> <p> <code>request</code>
438      * - The EC2 Fleet places an asynchronous one-time request for your desired
439      * capacity, but does submit Spot requests in alternative capacity pools if Spot
440      * capacity is unavailable, and does not maintain Spot capacity if Spot Instances
441      * are interrupted.</p> </li> <li> <p> <code>instant</code> - The EC2 Fleet places
442      * a synchronous one-time request for your desired capacity, and returns errors for
443      * any instances that could not be launched.</p> </li> </ul> <p>For more
444      * information, see <a
445      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-configuration-strategies.html#ec2-fleet-request-type">EC2
446      * Fleet request types</a> in the <i>Amazon EC2 User Guide</i>.</p>
447      */
WithType(FleetType && value)448     inline CreateFleetRequest& WithType(FleetType&& value) { SetType(std::move(value)); return *this;}
449 
450 
451     /**
452      * <p>The start date and time of the request, in UTC format (for example,
453      * <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). The default is
454      * to start fulfilling the request immediately.</p>
455      */
GetValidFrom()456     inline const Aws::Utils::DateTime& GetValidFrom() const{ return m_validFrom; }
457 
458     /**
459      * <p>The start date and time of the request, in UTC format (for example,
460      * <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). The default is
461      * to start fulfilling the request immediately.</p>
462      */
ValidFromHasBeenSet()463     inline bool ValidFromHasBeenSet() const { return m_validFromHasBeenSet; }
464 
465     /**
466      * <p>The start date and time of the request, in UTC format (for example,
467      * <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). The default is
468      * to start fulfilling the request immediately.</p>
469      */
SetValidFrom(const Aws::Utils::DateTime & value)470     inline void SetValidFrom(const Aws::Utils::DateTime& value) { m_validFromHasBeenSet = true; m_validFrom = value; }
471 
472     /**
473      * <p>The start date and time of the request, in UTC format (for example,
474      * <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). The default is
475      * to start fulfilling the request immediately.</p>
476      */
SetValidFrom(Aws::Utils::DateTime && value)477     inline void SetValidFrom(Aws::Utils::DateTime&& value) { m_validFromHasBeenSet = true; m_validFrom = std::move(value); }
478 
479     /**
480      * <p>The start date and time of the request, in UTC format (for example,
481      * <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). The default is
482      * to start fulfilling the request immediately.</p>
483      */
WithValidFrom(const Aws::Utils::DateTime & value)484     inline CreateFleetRequest& WithValidFrom(const Aws::Utils::DateTime& value) { SetValidFrom(value); return *this;}
485 
486     /**
487      * <p>The start date and time of the request, in UTC format (for example,
488      * <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). The default is
489      * to start fulfilling the request immediately.</p>
490      */
WithValidFrom(Aws::Utils::DateTime && value)491     inline CreateFleetRequest& WithValidFrom(Aws::Utils::DateTime&& value) { SetValidFrom(std::move(value)); return *this;}
492 
493 
494     /**
495      * <p>The end date and time of the request, in UTC format (for example,
496      * <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). At this point,
497      * no new EC2 Fleet requests are placed or able to fulfill the request. If no value
498      * is specified, the request remains until you cancel it.</p>
499      */
GetValidUntil()500     inline const Aws::Utils::DateTime& GetValidUntil() const{ return m_validUntil; }
501 
502     /**
503      * <p>The end date and time of the request, in UTC format (for example,
504      * <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). At this point,
505      * no new EC2 Fleet requests are placed or able to fulfill the request. If no value
506      * is specified, the request remains until you cancel it.</p>
507      */
ValidUntilHasBeenSet()508     inline bool ValidUntilHasBeenSet() const { return m_validUntilHasBeenSet; }
509 
510     /**
511      * <p>The end date and time of the request, in UTC format (for example,
512      * <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). At this point,
513      * no new EC2 Fleet requests are placed or able to fulfill the request. If no value
514      * is specified, the request remains until you cancel it.</p>
515      */
SetValidUntil(const Aws::Utils::DateTime & value)516     inline void SetValidUntil(const Aws::Utils::DateTime& value) { m_validUntilHasBeenSet = true; m_validUntil = value; }
517 
518     /**
519      * <p>The end date and time of the request, in UTC format (for example,
520      * <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). At this point,
521      * no new EC2 Fleet requests are placed or able to fulfill the request. If no value
522      * is specified, the request remains until you cancel it.</p>
523      */
SetValidUntil(Aws::Utils::DateTime && value)524     inline void SetValidUntil(Aws::Utils::DateTime&& value) { m_validUntilHasBeenSet = true; m_validUntil = std::move(value); }
525 
526     /**
527      * <p>The end date and time of the request, in UTC format (for example,
528      * <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). At this point,
529      * no new EC2 Fleet requests are placed or able to fulfill the request. If no value
530      * is specified, the request remains until you cancel it.</p>
531      */
WithValidUntil(const Aws::Utils::DateTime & value)532     inline CreateFleetRequest& WithValidUntil(const Aws::Utils::DateTime& value) { SetValidUntil(value); return *this;}
533 
534     /**
535      * <p>The end date and time of the request, in UTC format (for example,
536      * <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z). At this point,
537      * no new EC2 Fleet requests are placed or able to fulfill the request. If no value
538      * is specified, the request remains until you cancel it.</p>
539      */
WithValidUntil(Aws::Utils::DateTime && value)540     inline CreateFleetRequest& WithValidUntil(Aws::Utils::DateTime&& value) { SetValidUntil(std::move(value)); return *this;}
541 
542 
543     /**
544      * <p>Indicates whether EC2 Fleet should replace unhealthy Spot Instances.
545      * Supported only for fleets of type <code>maintain</code>. For more information,
546      * see <a
547      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#ec2-fleet-health-checks">EC2
548      * Fleet health checks</a> in the <i>Amazon EC2 User Guide</i>.</p>
549      */
GetReplaceUnhealthyInstances()550     inline bool GetReplaceUnhealthyInstances() const{ return m_replaceUnhealthyInstances; }
551 
552     /**
553      * <p>Indicates whether EC2 Fleet should replace unhealthy Spot Instances.
554      * Supported only for fleets of type <code>maintain</code>. For more information,
555      * see <a
556      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#ec2-fleet-health-checks">EC2
557      * Fleet health checks</a> in the <i>Amazon EC2 User Guide</i>.</p>
558      */
ReplaceUnhealthyInstancesHasBeenSet()559     inline bool ReplaceUnhealthyInstancesHasBeenSet() const { return m_replaceUnhealthyInstancesHasBeenSet; }
560 
561     /**
562      * <p>Indicates whether EC2 Fleet should replace unhealthy Spot Instances.
563      * Supported only for fleets of type <code>maintain</code>. For more information,
564      * see <a
565      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#ec2-fleet-health-checks">EC2
566      * Fleet health checks</a> in the <i>Amazon EC2 User Guide</i>.</p>
567      */
SetReplaceUnhealthyInstances(bool value)568     inline void SetReplaceUnhealthyInstances(bool value) { m_replaceUnhealthyInstancesHasBeenSet = true; m_replaceUnhealthyInstances = value; }
569 
570     /**
571      * <p>Indicates whether EC2 Fleet should replace unhealthy Spot Instances.
572      * Supported only for fleets of type <code>maintain</code>. For more information,
573      * see <a
574      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-ec2-fleet.html#ec2-fleet-health-checks">EC2
575      * Fleet health checks</a> in the <i>Amazon EC2 User Guide</i>.</p>
576      */
WithReplaceUnhealthyInstances(bool value)577     inline CreateFleetRequest& WithReplaceUnhealthyInstances(bool value) { SetReplaceUnhealthyInstances(value); return *this;}
578 
579 
580     /**
581      * <p>The key-value pair for tagging the EC2 Fleet request on creation. For more
582      * information, see <a
583      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources">Tagging
584      * your resources</a>.</p> <p>If the fleet type is <code>instant</code>, specify a
585      * resource type of <code>fleet</code> to tag the fleet or <code>instance</code> to
586      * tag the instances at launch.</p> <p>If the fleet type is <code>maintain</code>
587      * or <code>request</code>, specify a resource type of <code>fleet</code> to tag
588      * the fleet. You cannot specify a resource type of <code>instance</code>. To tag
589      * instances at launch, specify the tags in a <a
590      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template">launch
591      * template</a>.</p>
592      */
GetTagSpecifications()593     inline const Aws::Vector<TagSpecification>& GetTagSpecifications() const{ return m_tagSpecifications; }
594 
595     /**
596      * <p>The key-value pair for tagging the EC2 Fleet request on creation. For more
597      * information, see <a
598      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources">Tagging
599      * your resources</a>.</p> <p>If the fleet type is <code>instant</code>, specify a
600      * resource type of <code>fleet</code> to tag the fleet or <code>instance</code> to
601      * tag the instances at launch.</p> <p>If the fleet type is <code>maintain</code>
602      * or <code>request</code>, specify a resource type of <code>fleet</code> to tag
603      * the fleet. You cannot specify a resource type of <code>instance</code>. To tag
604      * instances at launch, specify the tags in a <a
605      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template">launch
606      * template</a>.</p>
607      */
TagSpecificationsHasBeenSet()608     inline bool TagSpecificationsHasBeenSet() const { return m_tagSpecificationsHasBeenSet; }
609 
610     /**
611      * <p>The key-value pair for tagging the EC2 Fleet request on creation. For more
612      * information, see <a
613      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources">Tagging
614      * your resources</a>.</p> <p>If the fleet type is <code>instant</code>, specify a
615      * resource type of <code>fleet</code> to tag the fleet or <code>instance</code> to
616      * tag the instances at launch.</p> <p>If the fleet type is <code>maintain</code>
617      * or <code>request</code>, specify a resource type of <code>fleet</code> to tag
618      * the fleet. You cannot specify a resource type of <code>instance</code>. To tag
619      * instances at launch, specify the tags in a <a
620      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template">launch
621      * template</a>.</p>
622      */
SetTagSpecifications(const Aws::Vector<TagSpecification> & value)623     inline void SetTagSpecifications(const Aws::Vector<TagSpecification>& value) { m_tagSpecificationsHasBeenSet = true; m_tagSpecifications = value; }
624 
625     /**
626      * <p>The key-value pair for tagging the EC2 Fleet request on creation. For more
627      * information, see <a
628      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources">Tagging
629      * your resources</a>.</p> <p>If the fleet type is <code>instant</code>, specify a
630      * resource type of <code>fleet</code> to tag the fleet or <code>instance</code> to
631      * tag the instances at launch.</p> <p>If the fleet type is <code>maintain</code>
632      * or <code>request</code>, specify a resource type of <code>fleet</code> to tag
633      * the fleet. You cannot specify a resource type of <code>instance</code>. To tag
634      * instances at launch, specify the tags in a <a
635      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template">launch
636      * template</a>.</p>
637      */
SetTagSpecifications(Aws::Vector<TagSpecification> && value)638     inline void SetTagSpecifications(Aws::Vector<TagSpecification>&& value) { m_tagSpecificationsHasBeenSet = true; m_tagSpecifications = std::move(value); }
639 
640     /**
641      * <p>The key-value pair for tagging the EC2 Fleet request on creation. For more
642      * information, see <a
643      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources">Tagging
644      * your resources</a>.</p> <p>If the fleet type is <code>instant</code>, specify a
645      * resource type of <code>fleet</code> to tag the fleet or <code>instance</code> to
646      * tag the instances at launch.</p> <p>If the fleet type is <code>maintain</code>
647      * or <code>request</code>, specify a resource type of <code>fleet</code> to tag
648      * the fleet. You cannot specify a resource type of <code>instance</code>. To tag
649      * instances at launch, specify the tags in a <a
650      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template">launch
651      * template</a>.</p>
652      */
WithTagSpecifications(const Aws::Vector<TagSpecification> & value)653     inline CreateFleetRequest& WithTagSpecifications(const Aws::Vector<TagSpecification>& value) { SetTagSpecifications(value); return *this;}
654 
655     /**
656      * <p>The key-value pair for tagging the EC2 Fleet request on creation. For more
657      * information, see <a
658      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources">Tagging
659      * your resources</a>.</p> <p>If the fleet type is <code>instant</code>, specify a
660      * resource type of <code>fleet</code> to tag the fleet or <code>instance</code> to
661      * tag the instances at launch.</p> <p>If the fleet type is <code>maintain</code>
662      * or <code>request</code>, specify a resource type of <code>fleet</code> to tag
663      * the fleet. You cannot specify a resource type of <code>instance</code>. To tag
664      * instances at launch, specify the tags in a <a
665      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template">launch
666      * template</a>.</p>
667      */
WithTagSpecifications(Aws::Vector<TagSpecification> && value)668     inline CreateFleetRequest& WithTagSpecifications(Aws::Vector<TagSpecification>&& value) { SetTagSpecifications(std::move(value)); return *this;}
669 
670     /**
671      * <p>The key-value pair for tagging the EC2 Fleet request on creation. For more
672      * information, see <a
673      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources">Tagging
674      * your resources</a>.</p> <p>If the fleet type is <code>instant</code>, specify a
675      * resource type of <code>fleet</code> to tag the fleet or <code>instance</code> to
676      * tag the instances at launch.</p> <p>If the fleet type is <code>maintain</code>
677      * or <code>request</code>, specify a resource type of <code>fleet</code> to tag
678      * the fleet. You cannot specify a resource type of <code>instance</code>. To tag
679      * instances at launch, specify the tags in a <a
680      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template">launch
681      * template</a>.</p>
682      */
AddTagSpecifications(const TagSpecification & value)683     inline CreateFleetRequest& AddTagSpecifications(const TagSpecification& value) { m_tagSpecificationsHasBeenSet = true; m_tagSpecifications.push_back(value); return *this; }
684 
685     /**
686      * <p>The key-value pair for tagging the EC2 Fleet request on creation. For more
687      * information, see <a
688      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources">Tagging
689      * your resources</a>.</p> <p>If the fleet type is <code>instant</code>, specify a
690      * resource type of <code>fleet</code> to tag the fleet or <code>instance</code> to
691      * tag the instances at launch.</p> <p>If the fleet type is <code>maintain</code>
692      * or <code>request</code>, specify a resource type of <code>fleet</code> to tag
693      * the fleet. You cannot specify a resource type of <code>instance</code>. To tag
694      * instances at launch, specify the tags in a <a
695      * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template">launch
696      * template</a>.</p>
697      */
AddTagSpecifications(TagSpecification && value)698     inline CreateFleetRequest& AddTagSpecifications(TagSpecification&& value) { m_tagSpecificationsHasBeenSet = true; m_tagSpecifications.push_back(std::move(value)); return *this; }
699 
700 
701     /**
702      * <p>Reserved.</p>
703      */
GetContext()704     inline const Aws::String& GetContext() const{ return m_context; }
705 
706     /**
707      * <p>Reserved.</p>
708      */
ContextHasBeenSet()709     inline bool ContextHasBeenSet() const { return m_contextHasBeenSet; }
710 
711     /**
712      * <p>Reserved.</p>
713      */
SetContext(const Aws::String & value)714     inline void SetContext(const Aws::String& value) { m_contextHasBeenSet = true; m_context = value; }
715 
716     /**
717      * <p>Reserved.</p>
718      */
SetContext(Aws::String && value)719     inline void SetContext(Aws::String&& value) { m_contextHasBeenSet = true; m_context = std::move(value); }
720 
721     /**
722      * <p>Reserved.</p>
723      */
SetContext(const char * value)724     inline void SetContext(const char* value) { m_contextHasBeenSet = true; m_context.assign(value); }
725 
726     /**
727      * <p>Reserved.</p>
728      */
WithContext(const Aws::String & value)729     inline CreateFleetRequest& WithContext(const Aws::String& value) { SetContext(value); return *this;}
730 
731     /**
732      * <p>Reserved.</p>
733      */
WithContext(Aws::String && value)734     inline CreateFleetRequest& WithContext(Aws::String&& value) { SetContext(std::move(value)); return *this;}
735 
736     /**
737      * <p>Reserved.</p>
738      */
WithContext(const char * value)739     inline CreateFleetRequest& WithContext(const char* value) { SetContext(value); return *this;}
740 
741   private:
742 
743     bool m_dryRun;
744     bool m_dryRunHasBeenSet;
745 
746     Aws::String m_clientToken;
747     bool m_clientTokenHasBeenSet;
748 
749     SpotOptionsRequest m_spotOptions;
750     bool m_spotOptionsHasBeenSet;
751 
752     OnDemandOptionsRequest m_onDemandOptions;
753     bool m_onDemandOptionsHasBeenSet;
754 
755     FleetExcessCapacityTerminationPolicy m_excessCapacityTerminationPolicy;
756     bool m_excessCapacityTerminationPolicyHasBeenSet;
757 
758     Aws::Vector<FleetLaunchTemplateConfigRequest> m_launchTemplateConfigs;
759     bool m_launchTemplateConfigsHasBeenSet;
760 
761     TargetCapacitySpecificationRequest m_targetCapacitySpecification;
762     bool m_targetCapacitySpecificationHasBeenSet;
763 
764     bool m_terminateInstancesWithExpiration;
765     bool m_terminateInstancesWithExpirationHasBeenSet;
766 
767     FleetType m_type;
768     bool m_typeHasBeenSet;
769 
770     Aws::Utils::DateTime m_validFrom;
771     bool m_validFromHasBeenSet;
772 
773     Aws::Utils::DateTime m_validUntil;
774     bool m_validUntilHasBeenSet;
775 
776     bool m_replaceUnhealthyInstances;
777     bool m_replaceUnhealthyInstancesHasBeenSet;
778 
779     Aws::Vector<TagSpecification> m_tagSpecifications;
780     bool m_tagSpecificationsHasBeenSet;
781 
782     Aws::String m_context;
783     bool m_contextHasBeenSet;
784   };
785 
786 } // namespace Model
787 } // namespace EC2
788 } // namespace Aws
789