AWS SDK for C++

AWS SDK for C++ Version 1.11.717

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/Ec2Configuration.h>
11#include <aws/batch/model/LaunchTemplateSpecification.h>
12#include <aws/core/utils/memory/stl/AWSMap.h>
13#include <aws/core/utils/memory/stl/AWSString.h>
14#include <aws/core/utils/memory/stl/AWSVector.h>
15
16#include <utility>
17
18namespace Aws {
19namespace Utils {
20namespace Json {
21class JsonValue;
22class JsonView;
23} // namespace Json
24} // namespace Utils
25namespace Batch {
26namespace Model {
27
37 public:
38 AWS_BATCH_API ComputeResource() = default;
41 AWS_BATCH_API Aws::Utils::Json::JsonValue Jsonize() const;
42
44
55 inline CRType GetType() const { return m_type; }
56 inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; }
57 inline void SetType(CRType value) {
58 m_typeHasBeenSet = true;
59 m_type = value;
60 }
62 SetType(value);
63 return *this;
64 }
66
68
111 inline CRAllocationStrategy GetAllocationStrategy() const { return m_allocationStrategy; }
112 inline bool AllocationStrategyHasBeenSet() const { return m_allocationStrategyHasBeenSet; }
114 m_allocationStrategyHasBeenSet = true;
115 m_allocationStrategy = value;
116 }
119 return *this;
120 }
122
124
130 inline int GetMinvCpus() const { return m_minvCpus; }
131 inline bool MinvCpusHasBeenSet() const { return m_minvCpusHasBeenSet; }
132 inline void SetMinvCpus(int value) {
133 m_minvCpusHasBeenSet = true;
134 m_minvCpus = value;
135 }
136 inline ComputeResource& WithMinvCpus(int value) {
137 SetMinvCpus(value);
138 return *this;
139 }
141
143
153 inline int GetMaxvCpus() const { return m_maxvCpus; }
154 inline bool MaxvCpusHasBeenSet() const { return m_maxvCpusHasBeenSet; }
155 inline void SetMaxvCpus(int value) {
156 m_maxvCpusHasBeenSet = true;
157 m_maxvCpus = value;
158 }
159 inline ComputeResource& WithMaxvCpus(int value) {
160 SetMaxvCpus(value);
161 return *this;
162 }
164
166
172 inline int GetDesiredvCpus() const { return m_desiredvCpus; }
173 inline bool DesiredvCpusHasBeenSet() const { return m_desiredvCpusHasBeenSet; }
174 inline void SetDesiredvCpus(int value) {
175 m_desiredvCpusHasBeenSet = true;
176 m_desiredvCpus = value;
177 }
179 SetDesiredvCpus(value);
180 return *this;
181 }
183
185
231 inline const Aws::Vector<Aws::String>& GetInstanceTypes() const { return m_instanceTypes; }
232 inline bool InstanceTypesHasBeenSet() const { return m_instanceTypesHasBeenSet; }
233 template <typename InstanceTypesT = Aws::Vector<Aws::String>>
234 void SetInstanceTypes(InstanceTypesT&& value) {
235 m_instanceTypesHasBeenSet = true;
236 m_instanceTypes = std::forward<InstanceTypesT>(value);
237 }
238 template <typename InstanceTypesT = Aws::Vector<Aws::String>>
239 ComputeResource& WithInstanceTypes(InstanceTypesT&& value) {
240 SetInstanceTypes(std::forward<InstanceTypesT>(value));
241 return *this;
242 }
243 template <typename InstanceTypesT = Aws::String>
244 ComputeResource& AddInstanceTypes(InstanceTypesT&& value) {
245 m_instanceTypesHasBeenSet = true;
246 m_instanceTypes.emplace_back(std::forward<InstanceTypesT>(value));
247 return *this;
248 }
250
252
270 inline const Aws::Vector<Aws::String>& GetSubnets() const { return m_subnets; }
271 inline bool SubnetsHasBeenSet() const { return m_subnetsHasBeenSet; }
272 template <typename SubnetsT = Aws::Vector<Aws::String>>
273 void SetSubnets(SubnetsT&& value) {
274 m_subnetsHasBeenSet = true;
275 m_subnets = std::forward<SubnetsT>(value);
276 }
277 template <typename SubnetsT = Aws::Vector<Aws::String>>
278 ComputeResource& WithSubnets(SubnetsT&& value) {
279 SetSubnets(std::forward<SubnetsT>(value));
280 return *this;
281 }
282 template <typename SubnetsT = Aws::String>
283 ComputeResource& AddSubnets(SubnetsT&& value) {
284 m_subnetsHasBeenSet = true;
285 m_subnets.emplace_back(std::forward<SubnetsT>(value));
286 return *this;
287 }
289
291
301 inline const Aws::Vector<Aws::String>& GetSecurityGroupIds() const { return m_securityGroupIds; }
302 inline bool SecurityGroupIdsHasBeenSet() const { return m_securityGroupIdsHasBeenSet; }
303 template <typename SecurityGroupIdsT = Aws::Vector<Aws::String>>
304 void SetSecurityGroupIds(SecurityGroupIdsT&& value) {
305 m_securityGroupIdsHasBeenSet = true;
306 m_securityGroupIds = std::forward<SecurityGroupIdsT>(value);
307 }
308 template <typename SecurityGroupIdsT = Aws::Vector<Aws::String>>
309 ComputeResource& WithSecurityGroupIds(SecurityGroupIdsT&& value) {
310 SetSecurityGroupIds(std::forward<SecurityGroupIdsT>(value));
311 return *this;
312 }
313 template <typename SecurityGroupIdsT = Aws::String>
314 ComputeResource& AddSecurityGroupIds(SecurityGroupIdsT&& value) {
315 m_securityGroupIdsHasBeenSet = true;
316 m_securityGroupIds.emplace_back(std::forward<SecurityGroupIdsT>(value));
317 return *this;
318 }
320
322
328 inline const Aws::String& GetEc2KeyPair() const { return m_ec2KeyPair; }
329 inline bool Ec2KeyPairHasBeenSet() const { return m_ec2KeyPairHasBeenSet; }
330 template <typename Ec2KeyPairT = Aws::String>
331 void SetEc2KeyPair(Ec2KeyPairT&& value) {
332 m_ec2KeyPairHasBeenSet = true;
333 m_ec2KeyPair = std::forward<Ec2KeyPairT>(value);
334 }
335 template <typename Ec2KeyPairT = Aws::String>
336 ComputeResource& WithEc2KeyPair(Ec2KeyPairT&& value) {
337 SetEc2KeyPair(std::forward<Ec2KeyPairT>(value));
338 return *this;
339 }
341
343
355 inline const Aws::String& GetInstanceRole() const { return m_instanceRole; }
356 inline bool InstanceRoleHasBeenSet() const { return m_instanceRoleHasBeenSet; }
357 template <typename InstanceRoleT = Aws::String>
358 void SetInstanceRole(InstanceRoleT&& value) {
359 m_instanceRoleHasBeenSet = true;
360 m_instanceRole = std::forward<InstanceRoleT>(value);
361 }
362 template <typename InstanceRoleT = Aws::String>
363 ComputeResource& WithInstanceRole(InstanceRoleT&& value) {
364 SetInstanceRole(std::forward<InstanceRoleT>(value));
365 return *this;
366 }
368
370
384 inline const Aws::Map<Aws::String, Aws::String>& GetTags() const { return m_tags; }
385 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
386 template <typename TagsT = Aws::Map<Aws::String, Aws::String>>
387 void SetTags(TagsT&& value) {
388 m_tagsHasBeenSet = true;
389 m_tags = std::forward<TagsT>(value);
390 }
391 template <typename TagsT = Aws::Map<Aws::String, Aws::String>>
392 ComputeResource& WithTags(TagsT&& value) {
393 SetTags(std::forward<TagsT>(value));
394 return *this;
395 }
396 template <typename TagsKeyT = Aws::String, typename TagsValueT = Aws::String>
397 ComputeResource& AddTags(TagsKeyT&& key, TagsValueT&& value) {
398 m_tagsHasBeenSet = true;
399 m_tags.emplace(std::forward<TagsKeyT>(key), std::forward<TagsValueT>(value));
400 return *this;
401 }
403
405
417 inline const Aws::String& GetPlacementGroup() const { return m_placementGroup; }
418 inline bool PlacementGroupHasBeenSet() const { return m_placementGroupHasBeenSet; }
419 template <typename PlacementGroupT = Aws::String>
420 void SetPlacementGroup(PlacementGroupT&& value) {
421 m_placementGroupHasBeenSet = true;
422 m_placementGroup = std::forward<PlacementGroupT>(value);
423 }
424 template <typename PlacementGroupT = Aws::String>
425 ComputeResource& WithPlacementGroup(PlacementGroupT&& value) {
426 SetPlacementGroup(std::forward<PlacementGroupT>(value));
427 return *this;
428 }
430
432
443 inline int GetBidPercentage() const { return m_bidPercentage; }
444 inline bool BidPercentageHasBeenSet() const { return m_bidPercentageHasBeenSet; }
445 inline void SetBidPercentage(int value) {
446 m_bidPercentageHasBeenSet = true;
447 m_bidPercentage = value;
448 }
450 SetBidPercentage(value);
451 return *this;
452 }
454
456
473 inline const Aws::String& GetSpotIamFleetRole() const { return m_spotIamFleetRole; }
474 inline bool SpotIamFleetRoleHasBeenSet() const { return m_spotIamFleetRoleHasBeenSet; }
475 template <typename SpotIamFleetRoleT = Aws::String>
476 void SetSpotIamFleetRole(SpotIamFleetRoleT&& value) {
477 m_spotIamFleetRoleHasBeenSet = true;
478 m_spotIamFleetRole = std::forward<SpotIamFleetRoleT>(value);
479 }
480 template <typename SpotIamFleetRoleT = Aws::String>
481 ComputeResource& WithSpotIamFleetRole(SpotIamFleetRoleT&& value) {
482 SetSpotIamFleetRole(std::forward<SpotIamFleetRoleT>(value));
483 return *this;
484 }
486
488
500 inline const LaunchTemplateSpecification& GetLaunchTemplate() const { return m_launchTemplate; }
501 inline bool LaunchTemplateHasBeenSet() const { return m_launchTemplateHasBeenSet; }
502 template <typename LaunchTemplateT = LaunchTemplateSpecification>
503 void SetLaunchTemplate(LaunchTemplateT&& value) {
504 m_launchTemplateHasBeenSet = true;
505 m_launchTemplate = std::forward<LaunchTemplateT>(value);
506 }
507 template <typename LaunchTemplateT = LaunchTemplateSpecification>
508 ComputeResource& WithLaunchTemplate(LaunchTemplateT&& value) {
509 SetLaunchTemplate(std::forward<LaunchTemplateT>(value));
510 return *this;
511 }
513
515
523 inline const Aws::Vector<Ec2Configuration>& GetEc2Configuration() const { return m_ec2Configuration; }
524 inline bool Ec2ConfigurationHasBeenSet() const { return m_ec2ConfigurationHasBeenSet; }
525 template <typename Ec2ConfigurationT = Aws::Vector<Ec2Configuration>>
526 void SetEc2Configuration(Ec2ConfigurationT&& value) {
527 m_ec2ConfigurationHasBeenSet = true;
528 m_ec2Configuration = std::forward<Ec2ConfigurationT>(value);
529 }
530 template <typename Ec2ConfigurationT = Aws::Vector<Ec2Configuration>>
531 ComputeResource& WithEc2Configuration(Ec2ConfigurationT&& value) {
532 SetEc2Configuration(std::forward<Ec2ConfigurationT>(value));
533 return *this;
534 }
535 template <typename Ec2ConfigurationT = Ec2Configuration>
536 ComputeResource& AddEc2Configuration(Ec2ConfigurationT&& value) {
537 m_ec2ConfigurationHasBeenSet = true;
538 m_ec2Configuration.emplace_back(std::forward<Ec2ConfigurationT>(value));
539 return *this;
540 }
542 private:
543 CRType m_type{CRType::NOT_SET};
544
546
547 int m_minvCpus{0};
548
549 int m_maxvCpus{0};
550
551 int m_desiredvCpus{0};
552
553 Aws::Vector<Aws::String> m_instanceTypes;
554
555 Aws::Vector<Aws::String> m_subnets;
556
557 Aws::Vector<Aws::String> m_securityGroupIds;
558
559 Aws::String m_ec2KeyPair;
560
561 Aws::String m_instanceRole;
562
564
565 Aws::String m_placementGroup;
566
567 int m_bidPercentage{0};
568
569 Aws::String m_spotIamFleetRole;
570
571 LaunchTemplateSpecification m_launchTemplate;
572
573 Aws::Vector<Ec2Configuration> m_ec2Configuration;
574 bool m_typeHasBeenSet = false;
575 bool m_allocationStrategyHasBeenSet = false;
576 bool m_minvCpusHasBeenSet = false;
577 bool m_maxvCpusHasBeenSet = false;
578 bool m_desiredvCpusHasBeenSet = false;
579 bool m_instanceTypesHasBeenSet = false;
580 bool m_subnetsHasBeenSet = false;
581 bool m_securityGroupIdsHasBeenSet = false;
582 bool m_ec2KeyPairHasBeenSet = false;
583 bool m_instanceRoleHasBeenSet = false;
584 bool m_tagsHasBeenSet = false;
585 bool m_placementGroupHasBeenSet = false;
586 bool m_bidPercentageHasBeenSet = false;
587 bool m_spotIamFleetRoleHasBeenSet = false;
588 bool m_launchTemplateHasBeenSet = false;
589 bool m_ec2ConfigurationHasBeenSet = false;
590};
591
592} // namespace Model
593} // namespace Batch
594} // 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 & 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)
ComputeResource & WithType(CRType value)
ComputeResource & WithAllocationStrategy(CRAllocationStrategy value)
AWS_BATCH_API ComputeResource()=default
void SetLaunchTemplate(LaunchTemplateT &&value)
const Aws::String & GetEc2KeyPair() 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