AWS SDK for C++

AWS SDK for C++ Version 1.11.813

Loading...
Searching...
No Matches
ComputeResource.h
1
6#pragma once
7#include <aws/batch/Batch_EXPORTS.h>
8#include <aws/batch/model/CRAllocationStrategy.h>
9#include <aws/batch/model/CRType.h>
10#include <aws/batch/model/ComputeScalingPolicy.h>
11#include <aws/batch/model/Ec2Configuration.h>
12#include <aws/batch/model/LaunchTemplateSpecification.h>
13#include <aws/core/utils/memory/stl/AWSMap.h>
14#include <aws/core/utils/memory/stl/AWSString.h>
15#include <aws/core/utils/memory/stl/AWSVector.h>
16
17#include <utility>
18
19namespace Aws {
20namespace Utils {
21namespace Json {
22class JsonValue;
23class JsonView;
24} // namespace Json
25} // namespace Utils
26namespace Batch {
27namespace Model {
28
38 public:
39 AWS_BATCH_API ComputeResource() = default;
42 AWS_BATCH_API Aws::Utils::Json::JsonValue Jsonize() const;
43
45
56 inline CRType GetType() const { return m_type; }
57 inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; }
58 inline void SetType(CRType value) {
59 m_typeHasBeenSet = true;
60 m_type = value;
61 }
63 SetType(value);
64 return *this;
65 }
67
69
115 inline CRAllocationStrategy GetAllocationStrategy() const { return m_allocationStrategy; }
116 inline bool AllocationStrategyHasBeenSet() const { return m_allocationStrategyHasBeenSet; }
118 m_allocationStrategyHasBeenSet = true;
119 m_allocationStrategy = value;
120 }
123 return *this;
124 }
126
128
134 inline int GetMinvCpus() const { return m_minvCpus; }
135 inline bool MinvCpusHasBeenSet() const { return m_minvCpusHasBeenSet; }
136 inline void SetMinvCpus(int value) {
137 m_minvCpusHasBeenSet = true;
138 m_minvCpus = value;
139 }
140 inline ComputeResource& WithMinvCpus(int value) {
141 SetMinvCpus(value);
142 return *this;
143 }
145
147
157 inline int GetMaxvCpus() const { return m_maxvCpus; }
158 inline bool MaxvCpusHasBeenSet() const { return m_maxvCpusHasBeenSet; }
159 inline void SetMaxvCpus(int value) {
160 m_maxvCpusHasBeenSet = true;
161 m_maxvCpus = value;
162 }
163 inline ComputeResource& WithMaxvCpus(int value) {
164 SetMaxvCpus(value);
165 return *this;
166 }
168
170
176 inline int GetDesiredvCpus() const { return m_desiredvCpus; }
177 inline bool DesiredvCpusHasBeenSet() const { return m_desiredvCpusHasBeenSet; }
178 inline void SetDesiredvCpus(int value) {
179 m_desiredvCpusHasBeenSet = true;
180 m_desiredvCpus = value;
181 }
183 SetDesiredvCpus(value);
184 return *this;
185 }
187
189
228 inline const Aws::Vector<Aws::String>& GetInstanceTypes() const { return m_instanceTypes; }
229 inline bool InstanceTypesHasBeenSet() const { return m_instanceTypesHasBeenSet; }
230 template <typename InstanceTypesT = Aws::Vector<Aws::String>>
231 void SetInstanceTypes(InstanceTypesT&& value) {
232 m_instanceTypesHasBeenSet = true;
233 m_instanceTypes = std::forward<InstanceTypesT>(value);
234 }
235 template <typename InstanceTypesT = Aws::Vector<Aws::String>>
236 ComputeResource& WithInstanceTypes(InstanceTypesT&& value) {
237 SetInstanceTypes(std::forward<InstanceTypesT>(value));
238 return *this;
239 }
240 template <typename InstanceTypesT = Aws::String>
241 ComputeResource& AddInstanceTypes(InstanceTypesT&& value) {
242 m_instanceTypesHasBeenSet = true;
243 m_instanceTypes.emplace_back(std::forward<InstanceTypesT>(value));
244 return *this;
245 }
247
249
267 inline const Aws::Vector<Aws::String>& GetSubnets() const { return m_subnets; }
268 inline bool SubnetsHasBeenSet() const { return m_subnetsHasBeenSet; }
269 template <typename SubnetsT = Aws::Vector<Aws::String>>
270 void SetSubnets(SubnetsT&& value) {
271 m_subnetsHasBeenSet = true;
272 m_subnets = std::forward<SubnetsT>(value);
273 }
274 template <typename SubnetsT = Aws::Vector<Aws::String>>
275 ComputeResource& WithSubnets(SubnetsT&& value) {
276 SetSubnets(std::forward<SubnetsT>(value));
277 return *this;
278 }
279 template <typename SubnetsT = Aws::String>
280 ComputeResource& AddSubnets(SubnetsT&& value) {
281 m_subnetsHasBeenSet = true;
282 m_subnets.emplace_back(std::forward<SubnetsT>(value));
283 return *this;
284 }
286
288
298 inline const Aws::Vector<Aws::String>& GetSecurityGroupIds() const { return m_securityGroupIds; }
299 inline bool SecurityGroupIdsHasBeenSet() const { return m_securityGroupIdsHasBeenSet; }
300 template <typename SecurityGroupIdsT = Aws::Vector<Aws::String>>
301 void SetSecurityGroupIds(SecurityGroupIdsT&& value) {
302 m_securityGroupIdsHasBeenSet = true;
303 m_securityGroupIds = std::forward<SecurityGroupIdsT>(value);
304 }
305 template <typename SecurityGroupIdsT = Aws::Vector<Aws::String>>
306 ComputeResource& WithSecurityGroupIds(SecurityGroupIdsT&& value) {
307 SetSecurityGroupIds(std::forward<SecurityGroupIdsT>(value));
308 return *this;
309 }
310 template <typename SecurityGroupIdsT = Aws::String>
311 ComputeResource& AddSecurityGroupIds(SecurityGroupIdsT&& value) {
312 m_securityGroupIdsHasBeenSet = true;
313 m_securityGroupIds.emplace_back(std::forward<SecurityGroupIdsT>(value));
314 return *this;
315 }
317
319
325 inline const Aws::String& GetEc2KeyPair() const { return m_ec2KeyPair; }
326 inline bool Ec2KeyPairHasBeenSet() const { return m_ec2KeyPairHasBeenSet; }
327 template <typename Ec2KeyPairT = Aws::String>
328 void SetEc2KeyPair(Ec2KeyPairT&& value) {
329 m_ec2KeyPairHasBeenSet = true;
330 m_ec2KeyPair = std::forward<Ec2KeyPairT>(value);
331 }
332 template <typename Ec2KeyPairT = Aws::String>
333 ComputeResource& WithEc2KeyPair(Ec2KeyPairT&& value) {
334 SetEc2KeyPair(std::forward<Ec2KeyPairT>(value));
335 return *this;
336 }
338
340
352 inline const Aws::String& GetInstanceRole() const { return m_instanceRole; }
353 inline bool InstanceRoleHasBeenSet() const { return m_instanceRoleHasBeenSet; }
354 template <typename InstanceRoleT = Aws::String>
355 void SetInstanceRole(InstanceRoleT&& value) {
356 m_instanceRoleHasBeenSet = true;
357 m_instanceRole = std::forward<InstanceRoleT>(value);
358 }
359 template <typename InstanceRoleT = Aws::String>
360 ComputeResource& WithInstanceRole(InstanceRoleT&& value) {
361 SetInstanceRole(std::forward<InstanceRoleT>(value));
362 return *this;
363 }
365
367
381 inline const Aws::Map<Aws::String, Aws::String>& GetTags() const { return m_tags; }
382 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
383 template <typename TagsT = Aws::Map<Aws::String, Aws::String>>
384 void SetTags(TagsT&& value) {
385 m_tagsHasBeenSet = true;
386 m_tags = std::forward<TagsT>(value);
387 }
388 template <typename TagsT = Aws::Map<Aws::String, Aws::String>>
389 ComputeResource& WithTags(TagsT&& value) {
390 SetTags(std::forward<TagsT>(value));
391 return *this;
392 }
393 template <typename TagsKeyT = Aws::String, typename TagsValueT = Aws::String>
394 ComputeResource& AddTags(TagsKeyT&& key, TagsValueT&& value) {
395 m_tagsHasBeenSet = true;
396 m_tags.emplace(std::forward<TagsKeyT>(key), std::forward<TagsValueT>(value));
397 return *this;
398 }
400
402
414 inline const Aws::String& GetPlacementGroup() const { return m_placementGroup; }
415 inline bool PlacementGroupHasBeenSet() const { return m_placementGroupHasBeenSet; }
416 template <typename PlacementGroupT = Aws::String>
417 void SetPlacementGroup(PlacementGroupT&& value) {
418 m_placementGroupHasBeenSet = true;
419 m_placementGroup = std::forward<PlacementGroupT>(value);
420 }
421 template <typename PlacementGroupT = Aws::String>
422 ComputeResource& WithPlacementGroup(PlacementGroupT&& value) {
423 SetPlacementGroup(std::forward<PlacementGroupT>(value));
424 return *this;
425 }
427
429
440 inline int GetBidPercentage() const { return m_bidPercentage; }
441 inline bool BidPercentageHasBeenSet() const { return m_bidPercentageHasBeenSet; }
442 inline void SetBidPercentage(int value) {
443 m_bidPercentageHasBeenSet = true;
444 m_bidPercentage = value;
445 }
447 SetBidPercentage(value);
448 return *this;
449 }
451
453
470 inline const Aws::String& GetSpotIamFleetRole() const { return m_spotIamFleetRole; }
471 inline bool SpotIamFleetRoleHasBeenSet() const { return m_spotIamFleetRoleHasBeenSet; }
472 template <typename SpotIamFleetRoleT = Aws::String>
473 void SetSpotIamFleetRole(SpotIamFleetRoleT&& value) {
474 m_spotIamFleetRoleHasBeenSet = true;
475 m_spotIamFleetRole = std::forward<SpotIamFleetRoleT>(value);
476 }
477 template <typename SpotIamFleetRoleT = Aws::String>
478 ComputeResource& WithSpotIamFleetRole(SpotIamFleetRoleT&& value) {
479 SetSpotIamFleetRole(std::forward<SpotIamFleetRoleT>(value));
480 return *this;
481 }
483
485
497 inline const LaunchTemplateSpecification& GetLaunchTemplate() const { return m_launchTemplate; }
498 inline bool LaunchTemplateHasBeenSet() const { return m_launchTemplateHasBeenSet; }
499 template <typename LaunchTemplateT = LaunchTemplateSpecification>
500 void SetLaunchTemplate(LaunchTemplateT&& value) {
501 m_launchTemplateHasBeenSet = true;
502 m_launchTemplate = std::forward<LaunchTemplateT>(value);
503 }
504 template <typename LaunchTemplateT = LaunchTemplateSpecification>
505 ComputeResource& WithLaunchTemplate(LaunchTemplateT&& value) {
506 SetLaunchTemplate(std::forward<LaunchTemplateT>(value));
507 return *this;
508 }
510
512
521 inline const Aws::Vector<Ec2Configuration>& GetEc2Configuration() const { return m_ec2Configuration; }
522 inline bool Ec2ConfigurationHasBeenSet() const { return m_ec2ConfigurationHasBeenSet; }
523 template <typename Ec2ConfigurationT = Aws::Vector<Ec2Configuration>>
524 void SetEc2Configuration(Ec2ConfigurationT&& value) {
525 m_ec2ConfigurationHasBeenSet = true;
526 m_ec2Configuration = std::forward<Ec2ConfigurationT>(value);
527 }
528 template <typename Ec2ConfigurationT = Aws::Vector<Ec2Configuration>>
529 ComputeResource& WithEc2Configuration(Ec2ConfigurationT&& value) {
530 SetEc2Configuration(std::forward<Ec2ConfigurationT>(value));
531 return *this;
532 }
533 template <typename Ec2ConfigurationT = Ec2Configuration>
534 ComputeResource& AddEc2Configuration(Ec2ConfigurationT&& value) {
535 m_ec2ConfigurationHasBeenSet = true;
536 m_ec2Configuration.emplace_back(std::forward<Ec2ConfigurationT>(value));
537 return *this;
538 }
540
542
547 inline const ComputeScalingPolicy& GetScalingPolicy() const { return m_scalingPolicy; }
548 inline bool ScalingPolicyHasBeenSet() const { return m_scalingPolicyHasBeenSet; }
549 template <typename ScalingPolicyT = ComputeScalingPolicy>
550 void SetScalingPolicy(ScalingPolicyT&& value) {
551 m_scalingPolicyHasBeenSet = true;
552 m_scalingPolicy = std::forward<ScalingPolicyT>(value);
553 }
554 template <typename ScalingPolicyT = ComputeScalingPolicy>
555 ComputeResource& WithScalingPolicy(ScalingPolicyT&& value) {
556 SetScalingPolicy(std::forward<ScalingPolicyT>(value));
557 return *this;
558 }
560 private:
561 CRType m_type{CRType::NOT_SET};
562
564
565 int m_minvCpus{0};
566
567 int m_maxvCpus{0};
568
569 int m_desiredvCpus{0};
570
571 Aws::Vector<Aws::String> m_instanceTypes;
572
573 Aws::Vector<Aws::String> m_subnets;
574
575 Aws::Vector<Aws::String> m_securityGroupIds;
576
577 Aws::String m_ec2KeyPair;
578
579 Aws::String m_instanceRole;
580
582
583 Aws::String m_placementGroup;
584
585 int m_bidPercentage{0};
586
587 Aws::String m_spotIamFleetRole;
588
589 LaunchTemplateSpecification m_launchTemplate;
590
591 Aws::Vector<Ec2Configuration> m_ec2Configuration;
592
593 ComputeScalingPolicy m_scalingPolicy;
594 bool m_typeHasBeenSet = false;
595 bool m_allocationStrategyHasBeenSet = false;
596 bool m_minvCpusHasBeenSet = false;
597 bool m_maxvCpusHasBeenSet = false;
598 bool m_desiredvCpusHasBeenSet = false;
599 bool m_instanceTypesHasBeenSet = false;
600 bool m_subnetsHasBeenSet = false;
601 bool m_securityGroupIdsHasBeenSet = false;
602 bool m_ec2KeyPairHasBeenSet = false;
603 bool m_instanceRoleHasBeenSet = false;
604 bool m_tagsHasBeenSet = false;
605 bool m_placementGroupHasBeenSet = false;
606 bool m_bidPercentageHasBeenSet = false;
607 bool m_spotIamFleetRoleHasBeenSet = false;
608 bool m_launchTemplateHasBeenSet = false;
609 bool m_ec2ConfigurationHasBeenSet = false;
610 bool m_scalingPolicyHasBeenSet = false;
611};
612
613} // namespace Model
614} // namespace Batch
615} // namespace Aws
ComputeResource & AddSubnets(SubnetsT &&value)
void SetInstanceTypes(InstanceTypesT &&value)
AWS_BATCH_API Aws::Utils::Json::JsonValue Jsonize() const
ComputeResource & WithMaxvCpus(int value)
void SetPlacementGroup(PlacementGroupT &&value)
ComputeResource & AddEc2Configuration(Ec2ConfigurationT &&value)
ComputeResource & WithScalingPolicy(ScalingPolicyT &&value)
ComputeResource & WithSecurityGroupIds(SecurityGroupIdsT &&value)
ComputeResource & WithSpotIamFleetRole(SpotIamFleetRoleT &&value)
AWS_BATCH_API ComputeResource(Aws::Utils::Json::JsonView jsonValue)
ComputeResource & AddTags(TagsKeyT &&key, TagsValueT &&value)
CRAllocationStrategy GetAllocationStrategy() const
const Aws::String & GetInstanceRole() const
void SetSpotIamFleetRole(SpotIamFleetRoleT &&value)
void SetInstanceRole(InstanceRoleT &&value)
void SetEc2Configuration(Ec2ConfigurationT &&value)
const LaunchTemplateSpecification & GetLaunchTemplate() const
ComputeResource & AddSecurityGroupIds(SecurityGroupIdsT &&value)
ComputeResource & WithMinvCpus(int value)
ComputeResource & WithInstanceRole(InstanceRoleT &&value)
void SetSecurityGroupIds(SecurityGroupIdsT &&value)
ComputeResource & WithBidPercentage(int value)
void SetAllocationStrategy(CRAllocationStrategy value)
ComputeResource & AddInstanceTypes(InstanceTypesT &&value)
ComputeResource & WithDesiredvCpus(int value)
void SetEc2KeyPair(Ec2KeyPairT &&value)
ComputeResource & WithEc2KeyPair(Ec2KeyPairT &&value)
void SetScalingPolicy(ScalingPolicyT &&value)
ComputeResource & WithType(CRType value)
ComputeResource & WithAllocationStrategy(CRAllocationStrategy value)
AWS_BATCH_API ComputeResource()=default
void SetLaunchTemplate(LaunchTemplateT &&value)
const Aws::String & GetEc2KeyPair() const
const ComputeScalingPolicy & GetScalingPolicy() const
const Aws::Vector< Aws::String > & GetSecurityGroupIds() const
ComputeResource & WithTags(TagsT &&value)
const Aws::Map< Aws::String, Aws::String > & GetTags() const
AWS_BATCH_API ComputeResource & operator=(Aws::Utils::Json::JsonView jsonValue)
const Aws::Vector< Ec2Configuration > & GetEc2Configuration() const
ComputeResource & WithPlacementGroup(PlacementGroupT &&value)
const Aws::String & GetSpotIamFleetRole() const
ComputeResource & WithSubnets(SubnetsT &&value)
const Aws::Vector< Aws::String > & GetSubnets() const
const Aws::Vector< Aws::String > & GetInstanceTypes() const
const Aws::String & GetPlacementGroup() const
ComputeResource & WithInstanceTypes(InstanceTypesT &&value)
ComputeResource & WithEc2Configuration(Ec2ConfigurationT &&value)
ComputeResource & WithLaunchTemplate(LaunchTemplateT &&value)
std::map< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > > Map
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue