blib/lib/Paws/EC2/RequestSpotFleet.pm untested

filter: Statementstmt 0.0% 0 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 15 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package Paws::EC2::RequestSpotFleet;
3 use Moose;
4 has DryRun => (is => 'ro', isa => 'Bool', traits => ['NameInRequest'], request_name => 'dryRun' );
5 has SpotFleetRequestConfig => (is => 'ro', isa => 'Paws::EC2::SpotFleetRequestConfigData', traits => ['NameInRequest'], request_name => 'spotFleetRequestConfig' , required => 1);
6  
7 use MooseX::ClassAttribute;
8  
9 class_has _api_call => (isa => 'Str', is => 'ro', default => 'RequestSpotFleet');
10 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::EC2::RequestSpotFleetResponse');
11 class_has _result_key => (isa => 'Str', is => 'ro');
12 1;
13  
14 ### main pod documentation begin ###
15  
16 =head1 NAME
17  
18 Paws::EC2::RequestSpotFleet - Arguments for method RequestSpotFleet on L<Paws::EC2>
19  
20 =head1 DESCRIPTION
21  
22 This class represents the parameters used for calling the method RequestSpotFleet on the
23 L<Amazon Elastic Compute Cloud|Paws::EC2> service. Use the attributes of this class
24 as arguments to method RequestSpotFleet.
25  
26 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to RequestSpotFleet.
27  
28 =head1 SYNOPSIS
29  
30 my $ec2 = Paws->service('EC2');
31 # To request a Spot fleet in the subnet with the lowest price
32 # This example creates a Spot fleet request with two launch specifications that
33 # differ only by subnet. The Spot fleet launches the instances in the specified
34 # subnet with the lowest price. If the instances are launched in a default VPC,
35 # they receive a public IP address by default. If the instances are launched in
36 # a nondefault VPC, they do not receive a public IP address by default. Note
37 # that you can't specify different subnets from the same Availability Zone in a
38 # Spot fleet request.
39 my $RequestSpotFleetResponse = $ec2->RequestSpotFleet(
40 'SpotFleetRequestConfig' => {
41 'IamFleetRole' => 'arn:aws:iam::123456789012:role/my-spot-fleet-role',
42 'LaunchSpecifications' => [
43  
44 {
45 'IamInstanceProfile' => {
46 'Arn' => 'arn:aws:iam::123456789012:instance-profile/my-iam-role'
47 },
48 'ImageId' => 'ami-1a2b3c4d',
49 'InstanceType' => 'm3.medium',
50 'KeyName' => 'my-key-pair',
51 'SecurityGroups' => [
52  
53 {
54 'GroupId' => 'sg-1a2b3c4d'
55 }
56 ],
57 'SubnetId' => 'subnet-1a2b3c4d, subnet-3c4d5e6f'
58 }
59 ],
60 'SpotPrice' => 0.04,
61 'TargetCapacity' => 2
62 }
63 );
64  
65 # Results:
66 my $SpotFleetRequestId = $RequestSpotFleetResponse->SpotFleetRequestId;
67  
68 # Returns a L<Paws::EC2::RequestSpotFleetResponse> object.
69 # To request a Spot fleet in the Availability Zone with the lowest price
70 # This example creates a Spot fleet request with two launch specifications that
71 # differ only by Availability Zone. The Spot fleet launches the instances in the
72 # specified Availability Zone with the lowest price. If your account supports
73 # EC2-VPC only, Amazon EC2 launches the Spot instances in the default subnet of
74 # the Availability Zone. If your account supports EC2-Classic, Amazon EC2
75 # launches the instances in EC2-Classic in the Availability Zone.
76 my $RequestSpotFleetResponse = $ec2->RequestSpotFleet(
77 'SpotFleetRequestConfig' => {
78 'IamFleetRole' => 'arn:aws:iam::123456789012:role/my-spot-fleet-role',
79 'LaunchSpecifications' => [
80  
81 {
82 'IamInstanceProfile' => {
83 'Arn' => 'arn:aws:iam::123456789012:instance-profile/my-iam-role'
84 },
85 'ImageId' => 'ami-1a2b3c4d',
86 'InstanceType' => 'm3.medium',
87 'KeyName' => 'my-key-pair',
88 'Placement' => {
89 'AvailabilityZone' => 'us-west-2a, us-west-2b'
90 },
91 'SecurityGroups' => [
92  
93 {
94 'GroupId' => 'sg-1a2b3c4d'
95 }
96 ]
97 }
98 ],
99 'SpotPrice' => 0.04,
100 'TargetCapacity' => 2
101 }
102 );
103  
104 # Results:
105 my $SpotFleetRequestId = $RequestSpotFleetResponse->SpotFleetRequestId;
106  
107 # Returns a L<Paws::EC2::RequestSpotFleetResponse> object.
108 # To launch Spot instances in a subnet and assign them public IP addresses
109 # This example assigns public addresses to instances launched in a nondefault
110 # VPC. Note that when you specify a network interface, you must include the
111 # subnet ID and security group ID using the network interface.
112 my $RequestSpotFleetResponse = $ec2->RequestSpotFleet(
113 'SpotFleetRequestConfig' => {
114 'IamFleetRole' => 'arn:aws:iam::123456789012:role/my-spot-fleet-role',
115 'LaunchSpecifications' => [
116  
117 {
118 'IamInstanceProfile' => {
119 'Arn' => 'arn:aws:iam::880185128111:instance-profile/my-iam-role'
120 },
121 'ImageId' => 'ami-1a2b3c4d',
122 'InstanceType' => 'm3.medium',
123 'KeyName' => 'my-key-pair',
124 'NetworkInterfaces' => [
125  
126 {
127 'AssociatePublicIpAddress' => 1,
128 'DeviceIndex' => 0,
129 'Groups' => ['sg-1a2b3c4d'],
130 'SubnetId' => 'subnet-1a2b3c4d'
131 }
132 ]
133 }
134 ],
135 'SpotPrice' => 0.04,
136 'TargetCapacity' => 2
137 }
138 );
139  
140 # Results:
141 my $SpotFleetRequestId = $RequestSpotFleetResponse->SpotFleetRequestId;
142  
143 # Returns a L<Paws::EC2::RequestSpotFleetResponse> object.
144 # To request a Spot fleet using the diversified allocation strategy
145 # This example creates a Spot fleet request that launches 30 instances using the
146 # diversified allocation strategy. The launch specifications differ by instance
147 # type. The Spot fleet distributes the instances across the launch
148 # specifications such that there are 10 instances of each type.
149 my $RequestSpotFleetResponse = $ec2->RequestSpotFleet(
150 'SpotFleetRequestConfig' => {
151 'AllocationStrategy' => 'diversified',
152 'IamFleetRole' => 'arn:aws:iam::123456789012:role/my-spot-fleet-role',
153 'LaunchSpecifications' => [
154  
155 {
156 'ImageId' => 'ami-1a2b3c4d',
157 'InstanceType' => 'c4.2xlarge',
158 'SubnetId' => 'subnet-1a2b3c4d'
159 },
160  
161 {
162 'ImageId' => 'ami-1a2b3c4d',
163 'InstanceType' => 'm3.2xlarge',
164 'SubnetId' => 'subnet-1a2b3c4d'
165 },
166  
167 {
168 'ImageId' => 'ami-1a2b3c4d',
169 'InstanceType' => 'r3.2xlarge',
170 'SubnetId' => 'subnet-1a2b3c4d'
171 }
172 ],
173 'SpotPrice' => 0.70,
174 'TargetCapacity' => 30
175 }
176 );
177  
178 # Results:
179 my $SpotFleetRequestId = $RequestSpotFleetResponse->SpotFleetRequestId;
180  
181 # Returns a L<Paws::EC2::RequestSpotFleetResponse> object.
182  
183 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.
184 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/ec2/RequestSpotFleet>
185  
186 =head1 ATTRIBUTES
187  
188  
189 =head2 DryRun => Bool
190  
191 Checks whether you have the required permissions for the action,
192 without actually making the request, and provides an error response. If
193 you have the required permissions, the error response is
194 C<DryRunOperation>. Otherwise, it is C<UnauthorizedOperation>.
195  
196  
197  
198 =head2 B<REQUIRED> SpotFleetRequestConfig => L<Paws::EC2::SpotFleetRequestConfigData>
199  
200 The configuration for the Spot Fleet request.
201  
202  
203  
204  
205 =head1 SEE ALSO
206  
207 This class forms part of L<Paws>, documenting arguments for method RequestSpotFleet in L<Paws::EC2>
208  
209 =head1 BUGS and CONTRIBUTIONS
210  
211 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
212  
213 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
214  
215 =cut
216