AWS SDK for C++

AWS SDK for C++ Version 1.11.778

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
112 inline CRAllocationStrategy GetAllocationStrategy() const { return m_allocationStrategy; }
113 inline bool AllocationStrategyHasBeenSet() const { return m_allocationStrategyHasBeenSet; }
115 m_allocationStrategyHasBeenSet = true;
116 m_allocationStrategy = value;
117 }
120 return *this;
121 }
123
125
131 inline int GetMinvCpus() const { return m_minvCpus; }
132 inline bool MinvCpusHasBeenSet() const { return m_minvCpusHasBeenSet; }
133 inline void SetMinvCpus(int value) {
134 m_minvCpusHasBeenSet = true;
135 m_minvCpus = value;
136 }
137 inline ComputeResource& WithMinvCpus(int value) {
138 SetMinvCpus(value);
139 return *this;
140 }
142
144
154 inline int GetMaxvCpus() const { return m_maxvCpus; }
155 inline bool MaxvCpusHasBeenSet() const { return m_maxvCpusHasBeenSet; }
156 inline void SetMaxvCpus(int value) {
157 m_maxvCpusHasBeenSet = true;
158 m_maxvCpus = value;
159 }
160 inline ComputeResource& WithMaxvCpus(int value) {
161 SetMaxvCpus(value);
162 return *this;
163 }
165
167
173 inline int GetDesiredvCpus() const { return m_desiredvCpus; }
174 inline bool DesiredvCpusHasBeenSet() const { return m_desiredvCpusHasBeenSet; }
175 inline void SetDesiredvCpus(int value) {
176 m_desiredvCpusHasBeenSet = true;
177 m_desiredvCpus = value;
178 }
180 SetDesiredvCpus(value);
181 return *this;
182 }
184
186
232 inline const Aws::Vector<Aws::String>& GetInstanceTypes() const { return m_instanceTypes; }
233 inline bool InstanceTypesHasBeenSet() const { return m_instanceTypesHasBeenSet; }
234 template <typename InstanceTypesT = Aws::Vector<Aws::String>>
235 void SetInstanceTypes(InstanceTypesT&& value) {
236 m_instanceTypesHasBeenSet = true;
237 m_instanceTypes = std::forward<InstanceTypesT>(value);
238 }
239 template <typename InstanceTypesT = Aws::Vector<Aws::String>>
240 ComputeResource& WithInstanceTypes(InstanceTypesT&& value) {
241 SetInstanceTypes(std::forward<InstanceTypesT>(value));
242 return *this;
243 }
244 template <typename InstanceTypesT = Aws::String>
245 ComputeResource& AddInstanceTypes(InstanceTypesT&& value) {
246 m_instanceTypesHasBeenSet = true;
247 m_instanceTypes.emplace_back(std::forward<InstanceTypesT>(value));
248 return *this;
249 }
251
253
271 inline const Aws::Vector<Aws::String>& GetSubnets() const { return m_subnets; }
272 inline bool SubnetsHasBeenSet() const { return m_subnetsHasBeenSet; }
273 template <typename SubnetsT = Aws::Vector<Aws::String>>
274 void SetSubnets(SubnetsT&& value) {
275 m_subnetsHasBeenSet = true;
276 m_subnets = std::forward<SubnetsT>(value);
277 }
278 template <typename SubnetsT = Aws::Vector<Aws::String>>
279 ComputeResource& WithSubnets(SubnetsT&& value) {
280 SetSubnets(std::forward<SubnetsT>(value));
281 return *this;
282 }
283 template <typename SubnetsT = Aws::String>
284 ComputeResource& AddSubnets(SubnetsT&& value) {
285 m_subnetsHasBeenSet = true;
286 m_subnets.emplace_back(std::forward<SubnetsT>(value));
287 return *this;
288 }
290
292
302 inline const Aws::Vector<Aws::String>& GetSecurityGroupIds() const { return m_securityGroupIds; }
303 inline bool SecurityGroupIdsHasBeenSet() const { return m_securityGroupIdsHasBeenSet; }
304 template <typename SecurityGroupIdsT = Aws::Vector<Aws::String>>
305 void SetSecurityGroupIds(SecurityGroupIdsT&& value) {
306 m_securityGroupIdsHasBeenSet = true;
307 m_securityGroupIds = std::forward<SecurityGroupIdsT>(value);
308 }
309 template <typename SecurityGroupIdsT = Aws::Vector<Aws::String>>
310 ComputeResource& WithSecurityGroupIds(SecurityGroupIdsT&& value) {
311 SetSecurityGroupIds(std::forward<SecurityGroupIdsT>(value));
312 return *this;
313 }
314 template <typename SecurityGroupIdsT = Aws::String>
315 ComputeResource& AddSecurityGroupIds(SecurityGroupIdsT&& value) {
316 m_securityGroupIdsHasBeenSet = true;
317 m_securityGroupIds.emplace_back(std::forward<SecurityGroupIdsT>(value));
318 return *this;
319 }
321
323
329 inline const Aws::String& GetEc2KeyPair() const { return m_ec2KeyPair; }
330 inline bool Ec2KeyPairHasBeenSet() const { return m_ec2KeyPairHasBeenSet; }
331 template <typename Ec2KeyPairT = Aws::String>
332 void SetEc2KeyPair(Ec2KeyPairT&& value) {
333 m_ec2KeyPairHasBeenSet = true;
334 m_ec2KeyPair = std::forward<Ec2KeyPairT>(value);
335 }
336 template <typename Ec2KeyPairT = Aws::String>
337 ComputeResource& WithEc2KeyPair(Ec2KeyPairT&& value) {
338 SetEc2KeyPair(std::forward<Ec2KeyPairT>(value));
339 return *this;
340 }
342
344
356 inline const Aws::String& GetInstanceRole() const { return m_instanceRole; }
357 inline bool InstanceRoleHasBeenSet() const { return m_instanceRoleHasBeenSet; }
358 template <typename InstanceRoleT = Aws::String>
359 void SetInstanceRole(InstanceRoleT&& value) {
360 m_instanceRoleHasBeenSet = true;
361 m_instanceRole = std::forward<InstanceRoleT>(value);
362 }
363 template <typename InstanceRoleT = Aws::String>
364 ComputeResource& WithInstanceRole(InstanceRoleT&& value) {
365 SetInstanceRole(std::forward<InstanceRoleT>(value));
366 return *this;
367 }
369
371
385 inline const Aws::Map<Aws::String, Aws::String>& GetTags() const { return m_tags; }
386 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
387 template <typename TagsT = Aws::Map<Aws::String, Aws::String>>
388 void SetTags(TagsT&& value) {
389 m_tagsHasBeenSet = true;
390 m_tags = std::forward<TagsT>(value);
391 }
392 template <typename TagsT = Aws::Map<Aws::String, Aws::String>>
393 ComputeResource& WithTags(TagsT&& value) {
394 SetTags(std::forward<TagsT>(value));
395 return *this;
396 }
397 template <typename TagsKeyT = Aws::String, typename TagsValueT = Aws::String>
398 ComputeResource& AddTags(TagsKeyT&& key, TagsValueT&& value) {
399 m_tagsHasBeenSet = true;
400 m_tags.emplace(std::forward<TagsKeyT>(key), std::forward<TagsValueT>(value));
401 return *this;
402 }
404
406
418 inline const Aws::String& GetPlacementGroup() const { return m_placementGroup; }
419 inline bool PlacementGroupHasBeenSet() const { return m_placementGroupHasBeenSet; }
420 template <typename PlacementGroupT = Aws::String>
421 void SetPlacementGroup(PlacementGroupT&& value) {
422 m_placementGroupHasBeenSet = true;
423 m_placementGroup = std::forward<PlacementGroupT>(value);
424 }
425 template <typename PlacementGroupT = Aws::String>
426 ComputeResource& WithPlacementGroup(PlacementGroupT&& value) {
427 SetPlacementGroup(std::forward<PlacementGroupT>(value));
428 return *this;
429 }
431
433
444 inline int GetBidPercentage() const { return m_bidPercentage; }
445 inline bool BidPercentageHasBeenSet() const { return m_bidPercentageHasBeenSet; }
446 inline void SetBidPercentage(int value) {
447 m_bidPercentageHasBeenSet = true;
448 m_bidPercentage = value;
449 }
451 SetBidPercentage(value);
452 return *this;
453 }
455
457
474 inline const Aws::String& GetSpotIamFleetRole() const { return m_spotIamFleetRole; }
475 inline bool SpotIamFleetRoleHasBeenSet() const { return m_spotIamFleetRoleHasBeenSet; }
476 template <typename SpotIamFleetRoleT = Aws::String>
477 void SetSpotIamFleetRole(SpotIamFleetRoleT&& value) {
478 m_spotIamFleetRoleHasBeenSet = true;
479 m_spotIamFleetRole = std::forward<SpotIamFleetRoleT>(value);
480 }
481 template <typename SpotIamFleetRoleT = Aws::String>
482 ComputeResource& WithSpotIamFleetRole(SpotIamFleetRoleT&& value) {
483 SetSpotIamFleetRole(std::forward<SpotIamFleetRoleT>(value));
484 return *this;
485 }
487
489
501 inline const LaunchTemplateSpecification& GetLaunchTemplate() const { return m_launchTemplate; }
502 inline bool LaunchTemplateHasBeenSet() const { return m_launchTemplateHasBeenSet; }
503 template <typename LaunchTemplateT = LaunchTemplateSpecification>
504 void SetLaunchTemplate(LaunchTemplateT&& value) {
505 m_launchTemplateHasBeenSet = true;
506 m_launchTemplate = std::forward<LaunchTemplateT>(value);
507 }
508 template <typename LaunchTemplateT = LaunchTemplateSpecification>
509 ComputeResource& WithLaunchTemplate(LaunchTemplateT&& value) {
510 SetLaunchTemplate(std::forward<LaunchTemplateT>(value));
511 return *this;
512 }
514
516
525 inline const Aws::Vector<Ec2Configuration>& GetEc2Configuration() const { return m_ec2Configuration; }
526 inline bool Ec2ConfigurationHasBeenSet() const { return m_ec2ConfigurationHasBeenSet; }
527 template <typename Ec2ConfigurationT = Aws::Vector<Ec2Configuration>>
528 void SetEc2Configuration(Ec2ConfigurationT&& value) {
529 m_ec2ConfigurationHasBeenSet = true;
530 m_ec2Configuration = std::forward<Ec2ConfigurationT>(value);
531 }
532 template <typename Ec2ConfigurationT = Aws::Vector<Ec2Configuration>>
533 ComputeResource& WithEc2Configuration(Ec2ConfigurationT&& value) {
534 SetEc2Configuration(std::forward<Ec2ConfigurationT>(value));
535 return *this;
536 }
537 template <typename Ec2ConfigurationT = Ec2Configuration>
538 ComputeResource& AddEc2Configuration(Ec2ConfigurationT&& value) {
539 m_ec2ConfigurationHasBeenSet = true;
540 m_ec2Configuration.emplace_back(std::forward<Ec2ConfigurationT>(value));
541 return *this;
542 }
544
546
551 inline const ComputeScalingPolicy& GetScalingPolicy() const { return m_scalingPolicy; }
552 inline bool ScalingPolicyHasBeenSet() const { return m_scalingPolicyHasBeenSet; }
553 template <typename ScalingPolicyT = ComputeScalingPolicy>
554 void SetScalingPolicy(ScalingPolicyT&& value) {
555 m_scalingPolicyHasBeenSet = true;
556 m_scalingPolicy = std::forward<ScalingPolicyT>(value);
557 }
558 template <typename ScalingPolicyT = ComputeScalingPolicy>
559 ComputeResource& WithScalingPolicy(ScalingPolicyT&& value) {
560 SetScalingPolicy(std::forward<ScalingPolicyT>(value));
561 return *this;
562 }
564 private:
565 CRType m_type{CRType::NOT_SET};
566
568
569 int m_minvCpus{0};
570
571 int m_maxvCpus{0};
572
573 int m_desiredvCpus{0};
574
575 Aws::Vector<Aws::String> m_instanceTypes;
576
577 Aws::Vector<Aws::String> m_subnets;
578
579 Aws::Vector<Aws::String> m_securityGroupIds;
580
581 Aws::String m_ec2KeyPair;
582
583 Aws::String m_instanceRole;
584
586
587 Aws::String m_placementGroup;
588
589 int m_bidPercentage{0};
590
591 Aws::String m_spotIamFleetRole;
592
593 LaunchTemplateSpecification m_launchTemplate;
594
595 Aws::Vector<Ec2Configuration> m_ec2Configuration;
596
597 ComputeScalingPolicy m_scalingPolicy;
598 bool m_typeHasBeenSet = false;
599 bool m_allocationStrategyHasBeenSet = false;
600 bool m_minvCpusHasBeenSet = false;
601 bool m_maxvCpusHasBeenSet = false;
602 bool m_desiredvCpusHasBeenSet = false;
603 bool m_instanceTypesHasBeenSet = false;
604 bool m_subnetsHasBeenSet = false;
605 bool m_securityGroupIdsHasBeenSet = false;
606 bool m_ec2KeyPairHasBeenSet = false;
607 bool m_instanceRoleHasBeenSet = false;
608 bool m_tagsHasBeenSet = false;
609 bool m_placementGroupHasBeenSet = false;
610 bool m_bidPercentageHasBeenSet = false;
611 bool m_spotIamFleetRoleHasBeenSet = false;
612 bool m_launchTemplateHasBeenSet = false;
613 bool m_ec2ConfigurationHasBeenSet = false;
614 bool m_scalingPolicyHasBeenSet = false;
615};
616
617} // namespace Model
618} // namespace Batch
619} // 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