AWS SDK for C++

AWS SDK for C++ Version 1.11.849

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
147 inline CRAllocationStrategy GetAllocationStrategy() const { return m_allocationStrategy; }
148 inline bool AllocationStrategyHasBeenSet() const { return m_allocationStrategyHasBeenSet; }
150 m_allocationStrategyHasBeenSet = true;
151 m_allocationStrategy = value;
152 }
155 return *this;
156 }
158
160
166 inline int GetMinvCpus() const { return m_minvCpus; }
167 inline bool MinvCpusHasBeenSet() const { return m_minvCpusHasBeenSet; }
168 inline void SetMinvCpus(int value) {
169 m_minvCpusHasBeenSet = true;
170 m_minvCpus = value;
171 }
172 inline ComputeResource& WithMinvCpus(int value) {
173 SetMinvCpus(value);
174 return *this;
175 }
177
179
186 inline int GetMaxvCpus() const { return m_maxvCpus; }
187 inline bool MaxvCpusHasBeenSet() const { return m_maxvCpusHasBeenSet; }
188 inline void SetMaxvCpus(int value) {
189 m_maxvCpusHasBeenSet = true;
190 m_maxvCpus = value;
191 }
192 inline ComputeResource& WithMaxvCpus(int value) {
193 SetMaxvCpus(value);
194 return *this;
195 }
197
199
205 inline int GetDesiredvCpus() const { return m_desiredvCpus; }
206 inline bool DesiredvCpusHasBeenSet() const { return m_desiredvCpusHasBeenSet; }
207 inline void SetDesiredvCpus(int value) {
208 m_desiredvCpusHasBeenSet = true;
209 m_desiredvCpus = value;
210 }
212 SetDesiredvCpus(value);
213 return *this;
214 }
216
218
257 inline const Aws::Vector<Aws::String>& GetInstanceTypes() const { return m_instanceTypes; }
258 inline bool InstanceTypesHasBeenSet() const { return m_instanceTypesHasBeenSet; }
259 template <typename InstanceTypesT = Aws::Vector<Aws::String>>
260 void SetInstanceTypes(InstanceTypesT&& value) {
261 m_instanceTypesHasBeenSet = true;
262 m_instanceTypes = std::forward<InstanceTypesT>(value);
263 }
264 template <typename InstanceTypesT = Aws::Vector<Aws::String>>
265 ComputeResource& WithInstanceTypes(InstanceTypesT&& value) {
266 SetInstanceTypes(std::forward<InstanceTypesT>(value));
267 return *this;
268 }
269 template <typename InstanceTypesT = Aws::String>
270 ComputeResource& AddInstanceTypes(InstanceTypesT&& value) {
271 m_instanceTypesHasBeenSet = true;
272 m_instanceTypes.emplace_back(std::forward<InstanceTypesT>(value));
273 return *this;
274 }
276
278
298 inline const Aws::Vector<Aws::String>& GetSubnets() const { return m_subnets; }
299 inline bool SubnetsHasBeenSet() const { return m_subnetsHasBeenSet; }
300 template <typename SubnetsT = Aws::Vector<Aws::String>>
301 void SetSubnets(SubnetsT&& value) {
302 m_subnetsHasBeenSet = true;
303 m_subnets = std::forward<SubnetsT>(value);
304 }
305 template <typename SubnetsT = Aws::Vector<Aws::String>>
306 ComputeResource& WithSubnets(SubnetsT&& value) {
307 SetSubnets(std::forward<SubnetsT>(value));
308 return *this;
309 }
310 template <typename SubnetsT = Aws::String>
311 ComputeResource& AddSubnets(SubnetsT&& value) {
312 m_subnetsHasBeenSet = true;
313 m_subnets.emplace_back(std::forward<SubnetsT>(value));
314 return *this;
315 }
317
319
329 inline const Aws::Vector<Aws::String>& GetSecurityGroupIds() const { return m_securityGroupIds; }
330 inline bool SecurityGroupIdsHasBeenSet() const { return m_securityGroupIdsHasBeenSet; }
331 template <typename SecurityGroupIdsT = Aws::Vector<Aws::String>>
332 void SetSecurityGroupIds(SecurityGroupIdsT&& value) {
333 m_securityGroupIdsHasBeenSet = true;
334 m_securityGroupIds = std::forward<SecurityGroupIdsT>(value);
335 }
336 template <typename SecurityGroupIdsT = Aws::Vector<Aws::String>>
337 ComputeResource& WithSecurityGroupIds(SecurityGroupIdsT&& value) {
338 SetSecurityGroupIds(std::forward<SecurityGroupIdsT>(value));
339 return *this;
340 }
341 template <typename SecurityGroupIdsT = Aws::String>
342 ComputeResource& AddSecurityGroupIds(SecurityGroupIdsT&& value) {
343 m_securityGroupIdsHasBeenSet = true;
344 m_securityGroupIds.emplace_back(std::forward<SecurityGroupIdsT>(value));
345 return *this;
346 }
348
350
356 inline const Aws::String& GetEc2KeyPair() const { return m_ec2KeyPair; }
357 inline bool Ec2KeyPairHasBeenSet() const { return m_ec2KeyPairHasBeenSet; }
358 template <typename Ec2KeyPairT = Aws::String>
359 void SetEc2KeyPair(Ec2KeyPairT&& value) {
360 m_ec2KeyPairHasBeenSet = true;
361 m_ec2KeyPair = std::forward<Ec2KeyPairT>(value);
362 }
363 template <typename Ec2KeyPairT = Aws::String>
364 ComputeResource& WithEc2KeyPair(Ec2KeyPairT&& value) {
365 SetEc2KeyPair(std::forward<Ec2KeyPairT>(value));
366 return *this;
367 }
369
371
383 inline const Aws::String& GetInstanceRole() const { return m_instanceRole; }
384 inline bool InstanceRoleHasBeenSet() const { return m_instanceRoleHasBeenSet; }
385 template <typename InstanceRoleT = Aws::String>
386 void SetInstanceRole(InstanceRoleT&& value) {
387 m_instanceRoleHasBeenSet = true;
388 m_instanceRole = std::forward<InstanceRoleT>(value);
389 }
390 template <typename InstanceRoleT = Aws::String>
391 ComputeResource& WithInstanceRole(InstanceRoleT&& value) {
392 SetInstanceRole(std::forward<InstanceRoleT>(value));
393 return *this;
394 }
396
398
412 inline const Aws::Map<Aws::String, Aws::String>& GetTags() const { return m_tags; }
413 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
414 template <typename TagsT = Aws::Map<Aws::String, Aws::String>>
415 void SetTags(TagsT&& value) {
416 m_tagsHasBeenSet = true;
417 m_tags = std::forward<TagsT>(value);
418 }
419 template <typename TagsT = Aws::Map<Aws::String, Aws::String>>
420 ComputeResource& WithTags(TagsT&& value) {
421 SetTags(std::forward<TagsT>(value));
422 return *this;
423 }
424 template <typename TagsKeyT = Aws::String, typename TagsValueT = Aws::String>
425 ComputeResource& AddTags(TagsKeyT&& key, TagsValueT&& value) {
426 m_tagsHasBeenSet = true;
427 m_tags.emplace(std::forward<TagsKeyT>(key), std::forward<TagsValueT>(value));
428 return *this;
429 }
431
433
445 inline const Aws::String& GetPlacementGroup() const { return m_placementGroup; }
446 inline bool PlacementGroupHasBeenSet() const { return m_placementGroupHasBeenSet; }
447 template <typename PlacementGroupT = Aws::String>
448 void SetPlacementGroup(PlacementGroupT&& value) {
449 m_placementGroupHasBeenSet = true;
450 m_placementGroup = std::forward<PlacementGroupT>(value);
451 }
452 template <typename PlacementGroupT = Aws::String>
453 ComputeResource& WithPlacementGroup(PlacementGroupT&& value) {
454 SetPlacementGroup(std::forward<PlacementGroupT>(value));
455 return *this;
456 }
458
460
471 inline int GetBidPercentage() const { return m_bidPercentage; }
472 inline bool BidPercentageHasBeenSet() const { return m_bidPercentageHasBeenSet; }
473 inline void SetBidPercentage(int value) {
474 m_bidPercentageHasBeenSet = true;
475 m_bidPercentage = value;
476 }
478 SetBidPercentage(value);
479 return *this;
480 }
482
484
501 inline const Aws::String& GetSpotIamFleetRole() const { return m_spotIamFleetRole; }
502 inline bool SpotIamFleetRoleHasBeenSet() const { return m_spotIamFleetRoleHasBeenSet; }
503 template <typename SpotIamFleetRoleT = Aws::String>
504 void SetSpotIamFleetRole(SpotIamFleetRoleT&& value) {
505 m_spotIamFleetRoleHasBeenSet = true;
506 m_spotIamFleetRole = std::forward<SpotIamFleetRoleT>(value);
507 }
508 template <typename SpotIamFleetRoleT = Aws::String>
509 ComputeResource& WithSpotIamFleetRole(SpotIamFleetRoleT&& value) {
510 SetSpotIamFleetRole(std::forward<SpotIamFleetRoleT>(value));
511 return *this;
512 }
514
516
528 inline const LaunchTemplateSpecification& GetLaunchTemplate() const { return m_launchTemplate; }
529 inline bool LaunchTemplateHasBeenSet() const { return m_launchTemplateHasBeenSet; }
530 template <typename LaunchTemplateT = LaunchTemplateSpecification>
531 void SetLaunchTemplate(LaunchTemplateT&& value) {
532 m_launchTemplateHasBeenSet = true;
533 m_launchTemplate = std::forward<LaunchTemplateT>(value);
534 }
535 template <typename LaunchTemplateT = LaunchTemplateSpecification>
536 ComputeResource& WithLaunchTemplate(LaunchTemplateT&& value) {
537 SetLaunchTemplate(std::forward<LaunchTemplateT>(value));
538 return *this;
539 }
541
543
552 inline const Aws::Vector<Ec2Configuration>& GetEc2Configuration() const { return m_ec2Configuration; }
553 inline bool Ec2ConfigurationHasBeenSet() const { return m_ec2ConfigurationHasBeenSet; }
554 template <typename Ec2ConfigurationT = Aws::Vector<Ec2Configuration>>
555 void SetEc2Configuration(Ec2ConfigurationT&& value) {
556 m_ec2ConfigurationHasBeenSet = true;
557 m_ec2Configuration = std::forward<Ec2ConfigurationT>(value);
558 }
559 template <typename Ec2ConfigurationT = Aws::Vector<Ec2Configuration>>
560 ComputeResource& WithEc2Configuration(Ec2ConfigurationT&& value) {
561 SetEc2Configuration(std::forward<Ec2ConfigurationT>(value));
562 return *this;
563 }
564 template <typename Ec2ConfigurationT = Ec2Configuration>
565 ComputeResource& AddEc2Configuration(Ec2ConfigurationT&& value) {
566 m_ec2ConfigurationHasBeenSet = true;
567 m_ec2Configuration.emplace_back(std::forward<Ec2ConfigurationT>(value));
568 return *this;
569 }
571
573
578 inline const ComputeScalingPolicy& GetScalingPolicy() const { return m_scalingPolicy; }
579 inline bool ScalingPolicyHasBeenSet() const { return m_scalingPolicyHasBeenSet; }
580 template <typename ScalingPolicyT = ComputeScalingPolicy>
581 void SetScalingPolicy(ScalingPolicyT&& value) {
582 m_scalingPolicyHasBeenSet = true;
583 m_scalingPolicy = std::forward<ScalingPolicyT>(value);
584 }
585 template <typename ScalingPolicyT = ComputeScalingPolicy>
586 ComputeResource& WithScalingPolicy(ScalingPolicyT&& value) {
587 SetScalingPolicy(std::forward<ScalingPolicyT>(value));
588 return *this;
589 }
591 private:
592 CRType m_type{CRType::NOT_SET};
593
595
596 int m_minvCpus{0};
597
598 int m_maxvCpus{0};
599
600 int m_desiredvCpus{0};
601
602 Aws::Vector<Aws::String> m_instanceTypes;
603
604 Aws::Vector<Aws::String> m_subnets;
605
606 Aws::Vector<Aws::String> m_securityGroupIds;
607
608 Aws::String m_ec2KeyPair;
609
610 Aws::String m_instanceRole;
611
613
614 Aws::String m_placementGroup;
615
616 int m_bidPercentage{0};
617
618 Aws::String m_spotIamFleetRole;
619
620 LaunchTemplateSpecification m_launchTemplate;
621
622 Aws::Vector<Ec2Configuration> m_ec2Configuration;
623
624 ComputeScalingPolicy m_scalingPolicy;
625 bool m_typeHasBeenSet = false;
626 bool m_allocationStrategyHasBeenSet = false;
627 bool m_minvCpusHasBeenSet = false;
628 bool m_maxvCpusHasBeenSet = false;
629 bool m_desiredvCpusHasBeenSet = false;
630 bool m_instanceTypesHasBeenSet = false;
631 bool m_subnetsHasBeenSet = false;
632 bool m_securityGroupIdsHasBeenSet = false;
633 bool m_ec2KeyPairHasBeenSet = false;
634 bool m_instanceRoleHasBeenSet = false;
635 bool m_tagsHasBeenSet = false;
636 bool m_placementGroupHasBeenSet = false;
637 bool m_bidPercentageHasBeenSet = false;
638 bool m_spotIamFleetRoleHasBeenSet = false;
639 bool m_launchTemplateHasBeenSet = false;
640 bool m_ec2ConfigurationHasBeenSet = false;
641 bool m_scalingPolicyHasBeenSet = false;
642};
643
644} // namespace Model
645} // namespace Batch
646} // 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