AWS SDK for C++

AWS SDK for C++ Version 1.11.876

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/batch/model/ManagedInstancesProvider.h>
14#include <aws/core/utils/memory/stl/AWSMap.h>
15#include <aws/core/utils/memory/stl/AWSString.h>
16#include <aws/core/utils/memory/stl/AWSVector.h>
17
18#include <utility>
19
20namespace Aws {
21namespace Utils {
22namespace Json {
23class JsonValue;
24class JsonView;
25} // namespace Json
26} // namespace Utils
27namespace Batch {
28namespace Model {
29
39 public:
40 AWS_BATCH_API ComputeResource() = default;
43 AWS_BATCH_API Aws::Utils::Json::JsonValue Jsonize() const;
44
46
66 inline CRType GetType() const { return m_type; }
67 inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; }
68 inline void SetType(CRType value) {
69 m_typeHasBeenSet = true;
70 m_type = value;
71 }
73 SetType(value);
74 return *this;
75 }
77
79
157 inline CRAllocationStrategy GetAllocationStrategy() const { return m_allocationStrategy; }
158 inline bool AllocationStrategyHasBeenSet() const { return m_allocationStrategyHasBeenSet; }
160 m_allocationStrategyHasBeenSet = true;
161 m_allocationStrategy = value;
162 }
165 return *this;
166 }
168
170
176 inline int GetMinvCpus() const { return m_minvCpus; }
177 inline bool MinvCpusHasBeenSet() const { return m_minvCpusHasBeenSet; }
178 inline void SetMinvCpus(int value) {
179 m_minvCpusHasBeenSet = true;
180 m_minvCpus = value;
181 }
182 inline ComputeResource& WithMinvCpus(int value) {
183 SetMinvCpus(value);
184 return *this;
185 }
187
189
196 inline int GetMaxvCpus() const { return m_maxvCpus; }
197 inline bool MaxvCpusHasBeenSet() const { return m_maxvCpusHasBeenSet; }
198 inline void SetMaxvCpus(int value) {
199 m_maxvCpusHasBeenSet = true;
200 m_maxvCpus = value;
201 }
202 inline ComputeResource& WithMaxvCpus(int value) {
203 SetMaxvCpus(value);
204 return *this;
205 }
207
209
215 inline int GetDesiredvCpus() const { return m_desiredvCpus; }
216 inline bool DesiredvCpusHasBeenSet() const { return m_desiredvCpusHasBeenSet; }
217 inline void SetDesiredvCpus(int value) {
218 m_desiredvCpusHasBeenSet = true;
219 m_desiredvCpus = value;
220 }
222 SetDesiredvCpus(value);
223 return *this;
224 }
226
228
267 inline const Aws::Vector<Aws::String>& GetInstanceTypes() const { return m_instanceTypes; }
268 inline bool InstanceTypesHasBeenSet() const { return m_instanceTypesHasBeenSet; }
269 template <typename InstanceTypesT = Aws::Vector<Aws::String>>
270 void SetInstanceTypes(InstanceTypesT&& value) {
271 m_instanceTypesHasBeenSet = true;
272 m_instanceTypes = std::forward<InstanceTypesT>(value);
273 }
274 template <typename InstanceTypesT = Aws::Vector<Aws::String>>
275 ComputeResource& WithInstanceTypes(InstanceTypesT&& value) {
276 SetInstanceTypes(std::forward<InstanceTypesT>(value));
277 return *this;
278 }
279 template <typename InstanceTypesT = Aws::String>
280 ComputeResource& AddInstanceTypes(InstanceTypesT&& value) {
281 m_instanceTypesHasBeenSet = true;
282 m_instanceTypes.emplace_back(std::forward<InstanceTypesT>(value));
283 return *this;
284 }
286
288
308 inline const Aws::Vector<Aws::String>& GetSubnets() const { return m_subnets; }
309 inline bool SubnetsHasBeenSet() const { return m_subnetsHasBeenSet; }
310 template <typename SubnetsT = Aws::Vector<Aws::String>>
311 void SetSubnets(SubnetsT&& value) {
312 m_subnetsHasBeenSet = true;
313 m_subnets = std::forward<SubnetsT>(value);
314 }
315 template <typename SubnetsT = Aws::Vector<Aws::String>>
316 ComputeResource& WithSubnets(SubnetsT&& value) {
317 SetSubnets(std::forward<SubnetsT>(value));
318 return *this;
319 }
320 template <typename SubnetsT = Aws::String>
321 ComputeResource& AddSubnets(SubnetsT&& value) {
322 m_subnetsHasBeenSet = true;
323 m_subnets.emplace_back(std::forward<SubnetsT>(value));
324 return *this;
325 }
327
329
339 inline const Aws::Vector<Aws::String>& GetSecurityGroupIds() const { return m_securityGroupIds; }
340 inline bool SecurityGroupIdsHasBeenSet() const { return m_securityGroupIdsHasBeenSet; }
341 template <typename SecurityGroupIdsT = Aws::Vector<Aws::String>>
342 void SetSecurityGroupIds(SecurityGroupIdsT&& value) {
343 m_securityGroupIdsHasBeenSet = true;
344 m_securityGroupIds = std::forward<SecurityGroupIdsT>(value);
345 }
346 template <typename SecurityGroupIdsT = Aws::Vector<Aws::String>>
347 ComputeResource& WithSecurityGroupIds(SecurityGroupIdsT&& value) {
348 SetSecurityGroupIds(std::forward<SecurityGroupIdsT>(value));
349 return *this;
350 }
351 template <typename SecurityGroupIdsT = Aws::String>
352 ComputeResource& AddSecurityGroupIds(SecurityGroupIdsT&& value) {
353 m_securityGroupIdsHasBeenSet = true;
354 m_securityGroupIds.emplace_back(std::forward<SecurityGroupIdsT>(value));
355 return *this;
356 }
358
360
366 inline const Aws::String& GetEc2KeyPair() const { return m_ec2KeyPair; }
367 inline bool Ec2KeyPairHasBeenSet() const { return m_ec2KeyPairHasBeenSet; }
368 template <typename Ec2KeyPairT = Aws::String>
369 void SetEc2KeyPair(Ec2KeyPairT&& value) {
370 m_ec2KeyPairHasBeenSet = true;
371 m_ec2KeyPair = std::forward<Ec2KeyPairT>(value);
372 }
373 template <typename Ec2KeyPairT = Aws::String>
374 ComputeResource& WithEc2KeyPair(Ec2KeyPairT&& value) {
375 SetEc2KeyPair(std::forward<Ec2KeyPairT>(value));
376 return *this;
377 }
379
381
393 inline const Aws::String& GetInstanceRole() const { return m_instanceRole; }
394 inline bool InstanceRoleHasBeenSet() const { return m_instanceRoleHasBeenSet; }
395 template <typename InstanceRoleT = Aws::String>
396 void SetInstanceRole(InstanceRoleT&& value) {
397 m_instanceRoleHasBeenSet = true;
398 m_instanceRole = std::forward<InstanceRoleT>(value);
399 }
400 template <typename InstanceRoleT = Aws::String>
401 ComputeResource& WithInstanceRole(InstanceRoleT&& value) {
402 SetInstanceRole(std::forward<InstanceRoleT>(value));
403 return *this;
404 }
406
408
422 inline const Aws::Map<Aws::String, Aws::String>& GetTags() const { return m_tags; }
423 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
424 template <typename TagsT = Aws::Map<Aws::String, Aws::String>>
425 void SetTags(TagsT&& value) {
426 m_tagsHasBeenSet = true;
427 m_tags = std::forward<TagsT>(value);
428 }
429 template <typename TagsT = Aws::Map<Aws::String, Aws::String>>
430 ComputeResource& WithTags(TagsT&& value) {
431 SetTags(std::forward<TagsT>(value));
432 return *this;
433 }
434 template <typename TagsKeyT = Aws::String, typename TagsValueT = Aws::String>
435 ComputeResource& AddTags(TagsKeyT&& key, TagsValueT&& value) {
436 m_tagsHasBeenSet = true;
437 m_tags.emplace(std::forward<TagsKeyT>(key), std::forward<TagsValueT>(value));
438 return *this;
439 }
441
443
455 inline const Aws::String& GetPlacementGroup() const { return m_placementGroup; }
456 inline bool PlacementGroupHasBeenSet() const { return m_placementGroupHasBeenSet; }
457 template <typename PlacementGroupT = Aws::String>
458 void SetPlacementGroup(PlacementGroupT&& value) {
459 m_placementGroupHasBeenSet = true;
460 m_placementGroup = std::forward<PlacementGroupT>(value);
461 }
462 template <typename PlacementGroupT = Aws::String>
463 ComputeResource& WithPlacementGroup(PlacementGroupT&& value) {
464 SetPlacementGroup(std::forward<PlacementGroupT>(value));
465 return *this;
466 }
468
470
481 inline int GetBidPercentage() const { return m_bidPercentage; }
482 inline bool BidPercentageHasBeenSet() const { return m_bidPercentageHasBeenSet; }
483 inline void SetBidPercentage(int value) {
484 m_bidPercentageHasBeenSet = true;
485 m_bidPercentage = value;
486 }
488 SetBidPercentage(value);
489 return *this;
490 }
492
494
511 inline const Aws::String& GetSpotIamFleetRole() const { return m_spotIamFleetRole; }
512 inline bool SpotIamFleetRoleHasBeenSet() const { return m_spotIamFleetRoleHasBeenSet; }
513 template <typename SpotIamFleetRoleT = Aws::String>
514 void SetSpotIamFleetRole(SpotIamFleetRoleT&& value) {
515 m_spotIamFleetRoleHasBeenSet = true;
516 m_spotIamFleetRole = std::forward<SpotIamFleetRoleT>(value);
517 }
518 template <typename SpotIamFleetRoleT = Aws::String>
519 ComputeResource& WithSpotIamFleetRole(SpotIamFleetRoleT&& value) {
520 SetSpotIamFleetRole(std::forward<SpotIamFleetRoleT>(value));
521 return *this;
522 }
524
526
538 inline const LaunchTemplateSpecification& GetLaunchTemplate() const { return m_launchTemplate; }
539 inline bool LaunchTemplateHasBeenSet() const { return m_launchTemplateHasBeenSet; }
540 template <typename LaunchTemplateT = LaunchTemplateSpecification>
541 void SetLaunchTemplate(LaunchTemplateT&& value) {
542 m_launchTemplateHasBeenSet = true;
543 m_launchTemplate = std::forward<LaunchTemplateT>(value);
544 }
545 template <typename LaunchTemplateT = LaunchTemplateSpecification>
546 ComputeResource& WithLaunchTemplate(LaunchTemplateT&& value) {
547 SetLaunchTemplate(std::forward<LaunchTemplateT>(value));
548 return *this;
549 }
551
553
562 inline const Aws::Vector<Ec2Configuration>& GetEc2Configuration() const { return m_ec2Configuration; }
563 inline bool Ec2ConfigurationHasBeenSet() const { return m_ec2ConfigurationHasBeenSet; }
564 template <typename Ec2ConfigurationT = Aws::Vector<Ec2Configuration>>
565 void SetEc2Configuration(Ec2ConfigurationT&& value) {
566 m_ec2ConfigurationHasBeenSet = true;
567 m_ec2Configuration = std::forward<Ec2ConfigurationT>(value);
568 }
569 template <typename Ec2ConfigurationT = Aws::Vector<Ec2Configuration>>
570 ComputeResource& WithEc2Configuration(Ec2ConfigurationT&& value) {
571 SetEc2Configuration(std::forward<Ec2ConfigurationT>(value));
572 return *this;
573 }
574 template <typename Ec2ConfigurationT = Ec2Configuration>
575 ComputeResource& AddEc2Configuration(Ec2ConfigurationT&& value) {
576 m_ec2ConfigurationHasBeenSet = true;
577 m_ec2Configuration.emplace_back(std::forward<Ec2ConfigurationT>(value));
578 return *this;
579 }
581
583
588 inline const ComputeScalingPolicy& GetScalingPolicy() const { return m_scalingPolicy; }
589 inline bool ScalingPolicyHasBeenSet() const { return m_scalingPolicyHasBeenSet; }
590 template <typename ScalingPolicyT = ComputeScalingPolicy>
591 void SetScalingPolicy(ScalingPolicyT&& value) {
592 m_scalingPolicyHasBeenSet = true;
593 m_scalingPolicy = std::forward<ScalingPolicyT>(value);
594 }
595 template <typename ScalingPolicyT = ComputeScalingPolicy>
596 ComputeResource& WithScalingPolicy(ScalingPolicyT&& value) {
597 SetScalingPolicy(std::forward<ScalingPolicyT>(value));
598 return *this;
599 }
601
603
612 inline const ManagedInstancesProvider& GetManagedInstancesProvider() const { return m_managedInstancesProvider; }
613 inline bool ManagedInstancesProviderHasBeenSet() const { return m_managedInstancesProviderHasBeenSet; }
614 template <typename ManagedInstancesProviderT = ManagedInstancesProvider>
615 void SetManagedInstancesProvider(ManagedInstancesProviderT&& value) {
616 m_managedInstancesProviderHasBeenSet = true;
617 m_managedInstancesProvider = std::forward<ManagedInstancesProviderT>(value);
618 }
619 template <typename ManagedInstancesProviderT = ManagedInstancesProvider>
620 ComputeResource& WithManagedInstancesProvider(ManagedInstancesProviderT&& value) {
621 SetManagedInstancesProvider(std::forward<ManagedInstancesProviderT>(value));
622 return *this;
623 }
625
627
637 inline const Aws::Map<Aws::String, Aws::String>& GetCapacityTags() const { return m_capacityTags; }
638 inline bool CapacityTagsHasBeenSet() const { return m_capacityTagsHasBeenSet; }
639 template <typename CapacityTagsT = Aws::Map<Aws::String, Aws::String>>
640 void SetCapacityTags(CapacityTagsT&& value) {
641 m_capacityTagsHasBeenSet = true;
642 m_capacityTags = std::forward<CapacityTagsT>(value);
643 }
644 template <typename CapacityTagsT = Aws::Map<Aws::String, Aws::String>>
645 ComputeResource& WithCapacityTags(CapacityTagsT&& value) {
646 SetCapacityTags(std::forward<CapacityTagsT>(value));
647 return *this;
648 }
649 template <typename CapacityTagsKeyT = Aws::String, typename CapacityTagsValueT = Aws::String>
650 ComputeResource& AddCapacityTags(CapacityTagsKeyT&& key, CapacityTagsValueT&& value) {
651 m_capacityTagsHasBeenSet = true;
652 m_capacityTags.emplace(std::forward<CapacityTagsKeyT>(key), std::forward<CapacityTagsValueT>(value));
653 return *this;
654 }
656 private:
657 CRType m_type{CRType::NOT_SET};
658
660
661 int m_minvCpus{0};
662
663 int m_maxvCpus{0};
664
665 int m_desiredvCpus{0};
666
667 Aws::Vector<Aws::String> m_instanceTypes;
668
669 Aws::Vector<Aws::String> m_subnets;
670
671 Aws::Vector<Aws::String> m_securityGroupIds;
672
673 Aws::String m_ec2KeyPair;
674
675 Aws::String m_instanceRole;
676
678
679 Aws::String m_placementGroup;
680
681 int m_bidPercentage{0};
682
683 Aws::String m_spotIamFleetRole;
684
685 LaunchTemplateSpecification m_launchTemplate;
686
687 Aws::Vector<Ec2Configuration> m_ec2Configuration;
688
689 ComputeScalingPolicy m_scalingPolicy;
690
691 ManagedInstancesProvider m_managedInstancesProvider;
692
694 bool m_typeHasBeenSet = false;
695 bool m_allocationStrategyHasBeenSet = false;
696 bool m_minvCpusHasBeenSet = false;
697 bool m_maxvCpusHasBeenSet = false;
698 bool m_desiredvCpusHasBeenSet = false;
699 bool m_instanceTypesHasBeenSet = false;
700 bool m_subnetsHasBeenSet = false;
701 bool m_securityGroupIdsHasBeenSet = false;
702 bool m_ec2KeyPairHasBeenSet = false;
703 bool m_instanceRoleHasBeenSet = false;
704 bool m_tagsHasBeenSet = false;
705 bool m_placementGroupHasBeenSet = false;
706 bool m_bidPercentageHasBeenSet = false;
707 bool m_spotIamFleetRoleHasBeenSet = false;
708 bool m_launchTemplateHasBeenSet = false;
709 bool m_ec2ConfigurationHasBeenSet = false;
710 bool m_scalingPolicyHasBeenSet = false;
711 bool m_managedInstancesProviderHasBeenSet = false;
712 bool m_capacityTagsHasBeenSet = false;
713};
714
715} // namespace Model
716} // namespace Batch
717} // namespace Aws
const Aws::Map< Aws::String, Aws::String > & GetCapacityTags() const
ComputeResource & AddSubnets(SubnetsT &&value)
void SetInstanceTypes(InstanceTypesT &&value)
ComputeResource & WithManagedInstancesProvider(ManagedInstancesProviderT &&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)
ComputeResource & WithCapacityTags(CapacityTagsT &&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)
void SetManagedInstancesProvider(ManagedInstancesProviderT &&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 SetCapacityTags(CapacityTagsT &&value)
void SetLaunchTemplate(LaunchTemplateT &&value)
const Aws::String & GetEc2KeyPair() const
const ComputeScalingPolicy & GetScalingPolicy() const
ComputeResource & AddCapacityTags(CapacityTagsKeyT &&key, CapacityTagsValueT &&value)
const Aws::Vector< Aws::String > & GetSecurityGroupIds() const
ComputeResource & WithTags(TagsT &&value)
const Aws::Map< Aws::String, Aws::String > & GetTags() const
const ManagedInstancesProvider & GetManagedInstancesProvider() 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