blib/lib/Paws/Batch/CreateComputeEnvironment.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 24 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package Paws::Batch::CreateComputeEnvironment;
3 use Moose;
4 has ComputeEnvironmentName => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'computeEnvironmentName', required => 1);
5 has ComputeResources => (is => 'ro', isa => 'Paws::Batch::ComputeResource', traits => ['NameInRequest'], request_name => 'computeResources');
6 has ServiceRole => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'serviceRole');
7 has State => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'state');
8 has Tags => (is => 'ro', isa => 'Paws::Batch::TagrisTagsMap', traits => ['NameInRequest'], request_name => 'tags');
9 has Type => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'type', required => 1);
10  
11 use MooseX::ClassAttribute;
12  
13 class_has _api_call => (isa => 'Str', is => 'ro', default => 'CreateComputeEnvironment');
14 class_has _api_uri => (isa => 'Str', is => 'ro', default => '/v1/createcomputeenvironment');
15 class_has _api_method => (isa => 'Str', is => 'ro', default => 'POST');
16 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::Batch::CreateComputeEnvironmentResponse');
17 1;
18  
19 ### main pod documentation begin ###
20  
21 =head1 NAME
22  
23 Paws::Batch::CreateComputeEnvironment - Arguments for method CreateComputeEnvironment on L<Paws::Batch>
24  
25 =head1 DESCRIPTION
26  
27 This class represents the parameters used for calling the method CreateComputeEnvironment on the
28 L<AWS Batch|Paws::Batch> service. Use the attributes of this class
29 as arguments to method CreateComputeEnvironment.
30  
31 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to CreateComputeEnvironment.
32  
33 =head1 SYNOPSIS
34  
35 my $batch = Paws->service('Batch');
36 # To create a managed EC2 compute environment
37 # This example creates a managed compute environment with specific C4 instance
38 # types that are launched on demand. The compute environment is called
39 # C4OnDemand.
40 my $CreateComputeEnvironmentResponse = $batch->CreateComputeEnvironment(
41 'ComputeEnvironmentName' => 'C4OnDemand',
42 'ComputeResources' => {
43 'DesiredvCpus' => 48,
44 'Ec2KeyPair' => 'id_rsa',
45 'InstanceRole' => 'ecsInstanceRole',
46 'InstanceTypes' =>
47 [ 'c4.large', 'c4.xlarge', 'c4.2xlarge', 'c4.4xlarge', 'c4.8xlarge' ],
48 'MaxvCpus' => 128,
49 'MinvCpus' => 0,
50 'SecurityGroupIds' => ['sg-cf5093b2'],
51 'Subnets' =>
52 [ 'subnet-220c0e0a', 'subnet-1a95556d', 'subnet-978f6dce' ],
53 'Tags' => {
54 'Name' => 'Batch Instance - C4OnDemand'
55 },
56 'Type' => 'EC2'
57 },
58 'ServiceRole' => 'arn:aws:iam::012345678910:role/AWSBatchServiceRole',
59 'State' => 'ENABLED',
60 'Type' => 'MANAGED'
61 );
62  
63 # Results:
64 my $computeEnvironmentArn =
65 $CreateComputeEnvironmentResponse->computeEnvironmentArn;
66 my $computeEnvironmentName =
67 $CreateComputeEnvironmentResponse->computeEnvironmentName;
68  
69 # Returns a L<Paws::Batch::CreateComputeEnvironmentResponse> object.
70 # To create a managed EC2 Spot compute environment
71 # This example creates a managed compute environment with the M4 instance type
72 # that is launched when the Spot bid price is at or below 20% of the On-Demand
73 # price for the instance type. The compute environment is called M4Spot.
74 my $CreateComputeEnvironmentResponse = $batch->CreateComputeEnvironment(
75 'ComputeEnvironmentName' => 'M4Spot',
76 'ComputeResources' => {
77 'BidPercentage' => 20,
78 'DesiredvCpus' => 4,
79 'Ec2KeyPair' => 'id_rsa',
80 'InstanceRole' => 'ecsInstanceRole',
81 'InstanceTypes' => ['m4'],
82 'MaxvCpus' => 128,
83 'MinvCpus' => 0,
84 'SecurityGroupIds' => ['sg-cf5093b2'],
85 'SpotIamFleetRole' =>
86 'arn:aws:iam::012345678910:role/aws-ec2-spot-fleet-role',
87 'Subnets' =>
88 [ 'subnet-220c0e0a', 'subnet-1a95556d', 'subnet-978f6dce' ],
89 'Tags' => {
90 'Name' => 'Batch Instance - M4Spot'
91 },
92 'Type' => 'SPOT'
93 },
94 'ServiceRole' => 'arn:aws:iam::012345678910:role/AWSBatchServiceRole',
95 'State' => 'ENABLED',
96 'Type' => 'MANAGED'
97 );
98  
99 # Results:
100 my $computeEnvironmentArn =
101 $CreateComputeEnvironmentResponse->computeEnvironmentArn;
102 my $computeEnvironmentName =
103 $CreateComputeEnvironmentResponse->computeEnvironmentName;
104  
105 # Returns a L<Paws::Batch::CreateComputeEnvironmentResponse> object.
106  
107 Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
108 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/batch/CreateComputeEnvironment>
109  
110 =head1 ATTRIBUTES
111  
112  
113 =head2 B<REQUIRED> ComputeEnvironmentName => Str
114  
115 The name for your compute environment. Up to 128 letters (uppercase and
116 lowercase), numbers, hyphens, and underscores are allowed.
117  
118  
119  
120 =head2 ComputeResources => L<Paws::Batch::ComputeResource>
121  
122 Details about the compute resources managed by the compute environment.
123 This parameter is required for managed compute environments. For more
124 information, see Compute Environments
125 (https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html)
126 in the I<AWS Batch User Guide>.
127  
128  
129  
130 =head2 ServiceRole => Str
131  
132 The full Amazon Resource Name (ARN) of the IAM role that allows AWS
133 Batch to make calls to other AWS services on your behalf. For more
134 information, see AWS Batch service IAM role
135 (https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html)
136 in the I<AWS Batch User Guide>.
137  
138 If your account has already created the AWS Batch service-linked role,
139 that role is used by default for your compute environment unless you
140 specify a role here. If the AWS Batch service-linked role does not
141 exist in your account, and no role is specified here, the service will
142 try to create the AWS Batch service-linked role in your account.
143  
144 If your specified role has a path other than C</>, then you must
145 specify either the full role ARN (recommended) or prefix the role name
146 with the path. For example, if a role with the name C<bar> has a path
147 of C</foo/> then you would specify C</foo/bar> as the role name. For
148 more information, see Friendly names and paths
149 (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names)
150 in the I<IAM User Guide>.
151  
152 Depending on how you created your AWS Batch service role, its ARN might
153 contain the C<service-role> path prefix. When you only specify the name
154 of the service role, AWS Batch assumes that your ARN doesn't use the
155 C<service-role> path prefix. Because of this, we recommend that you
156 specify the full ARN of your service role when you create compute
157 environments.
158  
159  
160  
161 =head2 State => Str
162  
163 The state of the compute environment. If the state is C<ENABLED>, then
164 the compute environment accepts jobs from a queue and can scale out
165 automatically based on queues.
166  
167 If the state is C<ENABLED>, then the AWS Batch scheduler can attempt to
168 place jobs from an associated job queue on the compute resources within
169 the environment. If the compute environment is managed, then it can
170 scale its instances out or in automatically, based on the job queue
171 demand.
172  
173 If the state is C<DISABLED>, then the AWS Batch scheduler doesn't
174 attempt to place jobs within the environment. Jobs in a C<STARTING> or
175 C<RUNNING> state continue to progress normally. Managed compute
176 environments in the C<DISABLED> state don't scale out. However, they
177 scale in to C<minvCpus> value after instances become idle.
178  
179 Valid values are: C<"ENABLED">, C<"DISABLED">
180  
181 =head2 Tags => L<Paws::Batch::TagrisTagsMap>
182  
183 The tags that you apply to the compute environment to help you
184 categorize and organize your resources. Each tag consists of a key and
185 an optional value. For more information, see Tagging AWS Resources
186 (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in
187 I<AWS General Reference>.
188  
189 These tags can be updated or removed using the TagResource
190 (https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html)
191 and UntagResource
192 (https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html)
193 API operations. These tags don't propagate to the underlying compute
194 resources.
195  
196  
197  
198 =head2 B<REQUIRED> Type => Str
199  
200 The type of the compute environment: C<MANAGED> or C<UNMANAGED>. For
201 more information, see Compute Environments
202 (https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html)
203 in the I<AWS Batch User Guide>.
204  
205 Valid values are: C<"MANAGED">, C<"UNMANAGED">
206  
207  
208 =head1 SEE ALSO
209  
210 This class forms part of L<Paws>, documenting arguments for method CreateComputeEnvironment in L<Paws::Batch>
211  
212 =head1 BUGS and CONTRIBUTIONS
213  
214 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
215  
216 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
217  
218 =cut
219