AWS SDK for C++

AWS SDK for C++ Version 1.11.606

Loading...
Searching...
No Matches
ComputeResource.h
1
6#pragma once
7#include <aws/batch/Batch_EXPORTS.h>
8#include <aws/batch/model/CRType.h>
9#include <aws/batch/model/CRAllocationStrategy.h>
10#include <aws/core/utils/memory/stl/AWSVector.h>
11#include <aws/core/utils/memory/stl/AWSString.h>
12#include <aws/core/utils/memory/stl/AWSMap.h>
13#include <aws/batch/model/LaunchTemplateSpecification.h>
14#include <aws/batch/model/Ec2Configuration.h>
15#include <utility>
16
17namespace Aws
18{
19namespace Utils
20{
21namespace Json
22{
23 class JsonValue;
24 class JsonView;
25} // namespace Json
26} // namespace Utils
27namespace Batch
28{
29namespace Model
30{
31
41 {
42 public:
43 AWS_BATCH_API ComputeResource() = default;
46 AWS_BATCH_API Aws::Utils::Json::JsonValue Jsonize() const;
47
48
50
60 inline CRType GetType() const { return m_type; }
61 inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; }
62 inline void SetType(CRType value) { m_typeHasBeenSet = true; m_type = value; }
63 inline ComputeResource& WithType(CRType value) { SetType(value); return *this;}
65
67
110 inline CRAllocationStrategy GetAllocationStrategy() const { return m_allocationStrategy; }
111 inline bool AllocationStrategyHasBeenSet() const { return m_allocationStrategyHasBeenSet; }
112 inline void SetAllocationStrategy(CRAllocationStrategy value) { m_allocationStrategyHasBeenSet = true; m_allocationStrategy = value; }
115
117
123 inline int GetMinvCpus() const { return m_minvCpus; }
124 inline bool MinvCpusHasBeenSet() const { return m_minvCpusHasBeenSet; }
125 inline void SetMinvCpus(int value) { m_minvCpusHasBeenSet = true; m_minvCpus = value; }
126 inline ComputeResource& WithMinvCpus(int value) { SetMinvCpus(value); return *this;}
128
130
140 inline int GetMaxvCpus() const { return m_maxvCpus; }
141 inline bool MaxvCpusHasBeenSet() const { return m_maxvCpusHasBeenSet; }
142 inline void SetMaxvCpus(int value) { m_maxvCpusHasBeenSet = true; m_maxvCpus = value; }
143 inline ComputeResource& WithMaxvCpus(int value) { SetMaxvCpus(value); return *this;}
145
147
153 inline int GetDesiredvCpus() const { return m_desiredvCpus; }
154 inline bool DesiredvCpusHasBeenSet() const { return m_desiredvCpusHasBeenSet; }
155 inline void SetDesiredvCpus(int value) { m_desiredvCpusHasBeenSet = true; m_desiredvCpus = value; }
156 inline ComputeResource& WithDesiredvCpus(int value) { SetDesiredvCpus(value); return *this;}
158
160
176 inline const Aws::Vector<Aws::String>& GetInstanceTypes() const { return m_instanceTypes; }
177 inline bool InstanceTypesHasBeenSet() const { return m_instanceTypesHasBeenSet; }
178 template<typename InstanceTypesT = Aws::Vector<Aws::String>>
179 void SetInstanceTypes(InstanceTypesT&& value) { m_instanceTypesHasBeenSet = true; m_instanceTypes = std::forward<InstanceTypesT>(value); }
180 template<typename InstanceTypesT = Aws::Vector<Aws::String>>
181 ComputeResource& WithInstanceTypes(InstanceTypesT&& value) { SetInstanceTypes(std::forward<InstanceTypesT>(value)); return *this;}
182 template<typename InstanceTypesT = Aws::String>
183 ComputeResource& AddInstanceTypes(InstanceTypesT&& value) { m_instanceTypesHasBeenSet = true; m_instanceTypes.emplace_back(std::forward<InstanceTypesT>(value)); return *this; }
185
187
205 inline const Aws::Vector<Aws::String>& GetSubnets() const { return m_subnets; }
206 inline bool SubnetsHasBeenSet() const { return m_subnetsHasBeenSet; }
207 template<typename SubnetsT = Aws::Vector<Aws::String>>
208 void SetSubnets(SubnetsT&& value) { m_subnetsHasBeenSet = true; m_subnets = std::forward<SubnetsT>(value); }
209 template<typename SubnetsT = Aws::Vector<Aws::String>>
210 ComputeResource& WithSubnets(SubnetsT&& value) { SetSubnets(std::forward<SubnetsT>(value)); return *this;}
211 template<typename SubnetsT = Aws::String>
212 ComputeResource& AddSubnets(SubnetsT&& value) { m_subnetsHasBeenSet = true; m_subnets.emplace_back(std::forward<SubnetsT>(value)); return *this; }
214
216
226 inline const Aws::Vector<Aws::String>& GetSecurityGroupIds() const { return m_securityGroupIds; }
227 inline bool SecurityGroupIdsHasBeenSet() const { return m_securityGroupIdsHasBeenSet; }
228 template<typename SecurityGroupIdsT = Aws::Vector<Aws::String>>
229 void SetSecurityGroupIds(SecurityGroupIdsT&& value) { m_securityGroupIdsHasBeenSet = true; m_securityGroupIds = std::forward<SecurityGroupIdsT>(value); }
230 template<typename SecurityGroupIdsT = Aws::Vector<Aws::String>>
231 ComputeResource& WithSecurityGroupIds(SecurityGroupIdsT&& value) { SetSecurityGroupIds(std::forward<SecurityGroupIdsT>(value)); return *this;}
232 template<typename SecurityGroupIdsT = Aws::String>
233 ComputeResource& AddSecurityGroupIds(SecurityGroupIdsT&& value) { m_securityGroupIdsHasBeenSet = true; m_securityGroupIds.emplace_back(std::forward<SecurityGroupIdsT>(value)); return *this; }
235
237
243 inline const Aws::String& GetEc2KeyPair() const { return m_ec2KeyPair; }
244 inline bool Ec2KeyPairHasBeenSet() const { return m_ec2KeyPairHasBeenSet; }
245 template<typename Ec2KeyPairT = Aws::String>
246 void SetEc2KeyPair(Ec2KeyPairT&& value) { m_ec2KeyPairHasBeenSet = true; m_ec2KeyPair = std::forward<Ec2KeyPairT>(value); }
247 template<typename Ec2KeyPairT = Aws::String>
248 ComputeResource& WithEc2KeyPair(Ec2KeyPairT&& value) { SetEc2KeyPair(std::forward<Ec2KeyPairT>(value)); return *this;}
250
252
264 inline const Aws::String& GetInstanceRole() const { return m_instanceRole; }
265 inline bool InstanceRoleHasBeenSet() const { return m_instanceRoleHasBeenSet; }
266 template<typename InstanceRoleT = Aws::String>
267 void SetInstanceRole(InstanceRoleT&& value) { m_instanceRoleHasBeenSet = true; m_instanceRole = std::forward<InstanceRoleT>(value); }
268 template<typename InstanceRoleT = Aws::String>
269 ComputeResource& WithInstanceRole(InstanceRoleT&& value) { SetInstanceRole(std::forward<InstanceRoleT>(value)); return *this;}
271
273
287 inline const Aws::Map<Aws::String, Aws::String>& GetTags() const { return m_tags; }
288 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
289 template<typename TagsT = Aws::Map<Aws::String, Aws::String>>
290 void SetTags(TagsT&& value) { m_tagsHasBeenSet = true; m_tags = std::forward<TagsT>(value); }
291 template<typename TagsT = Aws::Map<Aws::String, Aws::String>>
292 ComputeResource& WithTags(TagsT&& value) { SetTags(std::forward<TagsT>(value)); return *this;}
293 template<typename TagsKeyT = Aws::String, typename TagsValueT = Aws::String>
294 ComputeResource& AddTags(TagsKeyT&& key, TagsValueT&& value) {
295 m_tagsHasBeenSet = true; m_tags.emplace(std::forward<TagsKeyT>(key), std::forward<TagsValueT>(value)); return *this;
296 }
298
300
312 inline const Aws::String& GetPlacementGroup() const { return m_placementGroup; }
313 inline bool PlacementGroupHasBeenSet() const { return m_placementGroupHasBeenSet; }
314 template<typename PlacementGroupT = Aws::String>
315 void SetPlacementGroup(PlacementGroupT&& value) { m_placementGroupHasBeenSet = true; m_placementGroup = std::forward<PlacementGroupT>(value); }
316 template<typename PlacementGroupT = Aws::String>
317 ComputeResource& WithPlacementGroup(PlacementGroupT&& value) { SetPlacementGroup(std::forward<PlacementGroupT>(value)); return *this;}
319
321
332 inline int GetBidPercentage() const { return m_bidPercentage; }
333 inline bool BidPercentageHasBeenSet() const { return m_bidPercentageHasBeenSet; }
334 inline void SetBidPercentage(int value) { m_bidPercentageHasBeenSet = true; m_bidPercentage = value; }
335 inline ComputeResource& WithBidPercentage(int value) { SetBidPercentage(value); return *this;}
337
339
356 inline const Aws::String& GetSpotIamFleetRole() const { return m_spotIamFleetRole; }
357 inline bool SpotIamFleetRoleHasBeenSet() const { return m_spotIamFleetRoleHasBeenSet; }
358 template<typename SpotIamFleetRoleT = Aws::String>
359 void SetSpotIamFleetRole(SpotIamFleetRoleT&& value) { m_spotIamFleetRoleHasBeenSet = true; m_spotIamFleetRole = std::forward<SpotIamFleetRoleT>(value); }
360 template<typename SpotIamFleetRoleT = Aws::String>
361 ComputeResource& WithSpotIamFleetRole(SpotIamFleetRoleT&& value) { SetSpotIamFleetRole(std::forward<SpotIamFleetRoleT>(value)); return *this;}
363
365
377 inline const LaunchTemplateSpecification& GetLaunchTemplate() const { return m_launchTemplate; }
378 inline bool LaunchTemplateHasBeenSet() const { return m_launchTemplateHasBeenSet; }
379 template<typename LaunchTemplateT = LaunchTemplateSpecification>
380 void SetLaunchTemplate(LaunchTemplateT&& value) { m_launchTemplateHasBeenSet = true; m_launchTemplate = std::forward<LaunchTemplateT>(value); }
381 template<typename LaunchTemplateT = LaunchTemplateSpecification>
382 ComputeResource& WithLaunchTemplate(LaunchTemplateT&& value) { SetLaunchTemplate(std::forward<LaunchTemplateT>(value)); return *this;}
384
386
394 inline const Aws::Vector<Ec2Configuration>& GetEc2Configuration() const { return m_ec2Configuration; }
395 inline bool Ec2ConfigurationHasBeenSet() const { return m_ec2ConfigurationHasBeenSet; }
396 template<typename Ec2ConfigurationT = Aws::Vector<Ec2Configuration>>
397 void SetEc2Configuration(Ec2ConfigurationT&& value) { m_ec2ConfigurationHasBeenSet = true; m_ec2Configuration = std::forward<Ec2ConfigurationT>(value); }
398 template<typename Ec2ConfigurationT = Aws::Vector<Ec2Configuration>>
399 ComputeResource& WithEc2Configuration(Ec2ConfigurationT&& value) { SetEc2Configuration(std::forward<Ec2ConfigurationT>(value)); return *this;}
400 template<typename Ec2ConfigurationT = Ec2Configuration>
401 ComputeResource& AddEc2Configuration(Ec2ConfigurationT&& value) { m_ec2ConfigurationHasBeenSet = true; m_ec2Configuration.emplace_back(std::forward<Ec2ConfigurationT>(value)); return *this; }
403 private:
404
405 CRType m_type{CRType::NOT_SET};
406 bool m_typeHasBeenSet = false;
407
409 bool m_allocationStrategyHasBeenSet = false;
410
411 int m_minvCpus{0};
412 bool m_minvCpusHasBeenSet = false;
413
414 int m_maxvCpus{0};
415 bool m_maxvCpusHasBeenSet = false;
416
417 int m_desiredvCpus{0};
418 bool m_desiredvCpusHasBeenSet = false;
419
420 Aws::Vector<Aws::String> m_instanceTypes;
421 bool m_instanceTypesHasBeenSet = false;
422
423 Aws::Vector<Aws::String> m_subnets;
424 bool m_subnetsHasBeenSet = false;
425
426 Aws::Vector<Aws::String> m_securityGroupIds;
427 bool m_securityGroupIdsHasBeenSet = false;
428
429 Aws::String m_ec2KeyPair;
430 bool m_ec2KeyPairHasBeenSet = false;
431
432 Aws::String m_instanceRole;
433 bool m_instanceRoleHasBeenSet = false;
434
436 bool m_tagsHasBeenSet = false;
437
438 Aws::String m_placementGroup;
439 bool m_placementGroupHasBeenSet = false;
440
441 int m_bidPercentage{0};
442 bool m_bidPercentageHasBeenSet = false;
443
444 Aws::String m_spotIamFleetRole;
445 bool m_spotIamFleetRoleHasBeenSet = false;
446
447 LaunchTemplateSpecification m_launchTemplate;
448 bool m_launchTemplateHasBeenSet = false;
449
450 Aws::Vector<Ec2Configuration> m_ec2Configuration;
451 bool m_ec2ConfigurationHasBeenSet = false;
452 };
453
454} // namespace Model
455} // namespace Batch
456} // 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