blib/lib/Paws/EC2/RequestSpotInstances.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 25 / 25 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Paws/EC2/ReplaceNetworkAclAssociationResult.pm ↑ Summary blib/lib/Paws/EC2/RequestSpotInstancesResult.pm »
1  
2 package Paws::EC2::RequestSpotInstances;
3 1 ▶ use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 has AvailabilityZoneGroup => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'availabilityZoneGroup' );
5 1 has BlockDurationMinutes => (is => 'ro', isa => 'Int', traits => ['NameInRequest'], request_name => 'blockDurationMinutes' );
6 1 has ClientToken => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'clientToken' );
7 1 has DryRun => (is => 'ro', isa => 'Bool', traits => ['NameInRequest'], request_name => 'dryRun' );
8 1 has InstanceCount => (is => 'ro', isa => 'Int', traits => ['NameInRequest'], request_name => 'instanceCount' );
9 1 has InstanceInterruptionBehavior => (is => 'ro', isa => 'Str');
10 1 has LaunchGroup => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'launchGroup' );
11 1 has LaunchSpecification => (is => 'ro', isa => 'Paws::EC2::RequestSpotLaunchSpecification');
12 1 has SpotPrice => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'spotPrice' );
13 1 has TagSpecifications => (is => 'ro', isa => 'ArrayRef[Paws::EC2::TagSpecification]', traits => ['NameInRequest'], request_name => 'TagSpecification' );
14 1 has Type => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'type' );
15 1 has ValidFrom => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'validFrom' );
16 1 has ValidUntil => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'validUntil' );
17  
18 1 ▶ use MooseX::ClassAttribute;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 1 class_has _api_call => (isa => 'Str', is => 'ro', default => 'RequestSpotInstances');
21 1 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::EC2::RequestSpotInstancesResult');
22 1 class_has _result_key => (isa => 'Str', is => 'ro');
23 1 1;
24  
25 ### main pod documentation begin ###
26  
27 =head1 NAME
28  
29 Paws::EC2::RequestSpotInstances - Arguments for method RequestSpotInstances on L<Paws::EC2>
30  
31 =head1 DESCRIPTION
32  
33 This class represents the parameters used for calling the method RequestSpotInstances on the
34 L<Amazon Elastic Compute Cloud|Paws::EC2> service. Use the attributes of this class
35 as arguments to method RequestSpotInstances.
36  
37 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to RequestSpotInstances.
38  
39 =head1 SYNOPSIS
40  
41 my $ec2 = Paws->service('EC2');
42 # To create a one-time Spot Instance request
43 # This example creates a one-time Spot Instance request for five instances in
44 # the specified Availability Zone. If your account supports EC2-VPC only, Amazon
45 # EC2 launches the instances in the default subnet of the specified Availability
46 # Zone. If your account supports EC2-Classic, Amazon EC2 launches the instances
47 # in EC2-Classic in the specified Availability Zone.
48 my $RequestSpotInstancesResult = $ec2->RequestSpotInstances(
49 'InstanceCount' => 5,
50 'LaunchSpecification' => {
51 'IamInstanceProfile' => {
52 'Arn' => 'arn:aws:iam::123456789012:instance-profile/my-iam-role'
53 },
54 'ImageId' => 'ami-1a2b3c4d',
55 'InstanceType' => 'm3.medium',
56 'KeyName' => 'my-key-pair',
57 'Placement' => {
58 'AvailabilityZone' => 'us-west-2a'
59 },
60 'SecurityGroupIds' => ['sg-1a2b3c4d']
61 },
62 'SpotPrice' => 0.03,
63 'Type' => 'one-time'
64 );
65  
66 # To create a one-time Spot Instance request
67 # This example command creates a one-time Spot Instance request for five
68 # instances in the specified subnet. Amazon EC2 launches the instances in the
69 # specified subnet. If the VPC is a nondefault VPC, the instances do not receive
70 # a public IP address by default.
71 my $RequestSpotInstancesResult = $ec2->RequestSpotInstances(
72 'InstanceCount' => 5,
73 'LaunchSpecification' => {
74 'IamInstanceProfile' => {
75 'Arn' => 'arn:aws:iam::123456789012:instance-profile/my-iam-role'
76 },
77 'ImageId' => 'ami-1a2b3c4d',
78 'InstanceType' => 'm3.medium',
79 'SecurityGroupIds' => ['sg-1a2b3c4d'],
80 'SubnetId' => 'subnet-1a2b3c4d'
81 },
82 'SpotPrice' => 0.050,
83 'Type' => 'one-time'
84 );
85  
86  
87 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.
88 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/ec2/RequestSpotInstances>
89  
90 =head1 ATTRIBUTES
91  
92  
93 =head2 AvailabilityZoneGroup => Str
94  
95 The user-specified name for a logical grouping of requests.
96  
97 When you specify an Availability Zone group in a Spot Instance request,
98 all Spot Instances in the request are launched in the same Availability
99 Zone. Instance proximity is maintained with this parameter, but the
100 choice of Availability Zone is not. The group applies only to requests
101 for Spot Instances of the same instance type. Any additional Spot
102 Instance requests that are specified with the same Availability Zone
103 group name are launched in that same Availability Zone, as long as at
104 least one instance from the group is still active.
105  
106 If there is no active instance running in the Availability Zone group
107 that you specify for a new Spot Instance request (all instances are
108 terminated, the request is expired, or the maximum price you specified
109 falls below current Spot price), then Amazon EC2 launches the instance
110 in any Availability Zone where the constraint can be met. Consequently,
111 the subsequent set of Spot Instances could be placed in a different
112 zone from the original request, even if you specified the same
113 Availability Zone group.
114  
115 Default: Instances are launched in any available Availability Zone.
116  
117  
118  
119 =head2 BlockDurationMinutes => Int
120  
121 Deprecated.
122  
123  
124  
125 =head2 ClientToken => Str
126  
127 Unique, case-sensitive identifier that you provide to ensure the
128 idempotency of the request. For more information, see How to Ensure
129 Idempotency
130 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html)
131 in the I<Amazon EC2 User Guide for Linux Instances>.
132  
133  
134  
135 =head2 DryRun => Bool
136  
137 Checks whether you have the required permissions for the action,
138 without actually making the request, and provides an error response. If
139 you have the required permissions, the error response is
140 C<DryRunOperation>. Otherwise, it is C<UnauthorizedOperation>.
141  
142  
143  
144 =head2 InstanceCount => Int
145  
146 The maximum number of Spot Instances to launch.
147  
148 Default: 1
149  
150  
151  
152 =head2 InstanceInterruptionBehavior => Str
153  
154 The behavior when a Spot Instance is interrupted. The default is
155 C<terminate>.
156  
157 Valid values are: C<"hibernate">, C<"stop">, C<"terminate">
158  
159 =head2 LaunchGroup => Str
160  
161 The instance launch group. Launch groups are Spot Instances that launch
162 together and terminate together.
163  
164 Default: Instances are launched and terminated individually
165  
166  
167  
168 =head2 LaunchSpecification => L<Paws::EC2::RequestSpotLaunchSpecification>
169  
170 The launch specification.
171  
172  
173  
174 =head2 SpotPrice => Str
175  
176 The maximum price per hour that you are willing to pay for a Spot
177 Instance. The default is the On-Demand price.
178  
179  
180  
181 =head2 TagSpecifications => ArrayRef[L<Paws::EC2::TagSpecification>]
182  
183 The key-value pair for tagging the Spot Instance request on creation.
184 The value for C<ResourceType> must be C<spot-instances-request>,
185 otherwise the Spot Instance request fails. To tag the Spot Instance
186 request after it has been created, see CreateTags
187 (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html).
188  
189  
190  
191 =head2 Type => Str
192  
193 The Spot Instance request type.
194  
195 Default: C<one-time>
196  
197 Valid values are: C<"one-time">, C<"persistent">
198  
199 =head2 ValidFrom => Str
200  
201 The start date of the request. If this is a one-time request, the
202 request becomes active at this date and time and remains active until
203 all instances launch, the request expires, or the request is canceled.
204 If the request is persistent, the request becomes active at this date
205 and time and remains active until it expires or is canceled.
206  
207 The specified start date and time cannot be equal to the current date
208 and time. You must specify a start date and time that occurs after the
209 current date and time.
210  
211  
212  
213 =head2 ValidUntil => Str
214  
215 The end date of the request, in UTC format
216 (I<YYYY>-I<MM>-I<DD>TI<HH>:I<MM>:I<SS>Z).
217  
218 =over
219  
220 =item *
221  
222 For a persistent request, the request remains active until the
223 C<ValidUntil> date and time is reached. Otherwise, the request remains
224 active until you cancel it.
225  
226 =item *
227  
228 For a one-time request, the request remains active until all instances
229 launch, the request is canceled, or the C<ValidUntil> date and time is
230 reached. By default, the request is valid for 7 days from the date the
231 request was created.
232  
233 =back
234  
235  
236  
237  
238  
239 =head1 SEE ALSO
240  
241 This class forms part of L<Paws>, documenting arguments for method RequestSpotInstances in L<Paws::EC2>
242  
243 =head1 BUGS and CONTRIBUTIONS
244  
245 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
246  
247 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
248  
249 =cut
250  
« blib/lib/Paws/EC2/ReplaceNetworkAclAssociationResult.pm ↑ Summary blib/lib/Paws/EC2/RequestSpotInstancesResult.pm »