Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/*
3
 * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License").
6
 * You may not use this file except in compliance with the License.
7
 * A copy of the License is located at
8
 *
9
 *  http://aws.amazon.com/apache2.0
10
 *
11
 * or in the "license" file accompanying this file. This file is distributed
12
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13
 * express or implied. See the License for the specific language governing
14
 * permissions and limitations under the License.
15
 */
16
 
17
/**
18
 * Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute
19
 * capacity in the cloud. It is designed to make web-scale computing easier for developers.
20
 *
21
 * Amazon EC2's simple web service interface allows you to obtain and configure capacity with
22
 * minimal friction. It provides you with complete control of your computing resources and lets
23
 * you run on Amazon's proven computing environment. Amazon EC2 reduces the time required to
24
 * obtain and boot new server instances to minutes, allowing you to quickly scale capacity, both
25
 * up and down, as your computing requirements change. Amazon EC2 changes the economics of
26
 * computing by allowing you to pay only for capacity that you actually use. Amazon EC2 provides
27
 * developers the tools to build failure resilient applications and isolate themselves from common
28
 * failure scenarios.
29
 *
30
 * Visit <a href="http://aws.amazon.com/ec2/">http://aws.amazon.com/ec2/</a> for more information.
31
 *
32
 * @version 2012.01.17
33
 * @license See the included NOTICE.md file for complete information.
34
 * @copyright See the included NOTICE.md file for complete information.
35
 * @link http://aws.amazon.com/ec2/ Amazon EC2
36
 * @link http://aws.amazon.com/ec2/documentation/ Amazon EC2 documentation
37
 */
38
class AmazonEC2 extends CFRuntime
39
{
40
	/*%******************************************************************************************%*/
41
	// CLASS CONSTANTS
42
 
43
	/**
44
	 * Specify the queue URL for the United States East (Northern Virginia) Region.
45
	 */
46
	const REGION_US_E1 = 'ec2.us-east-1.amazonaws.com';
47
 
48
	/**
49
	 * Specify the queue URL for the United States East (Northern Virginia) Region.
50
	 */
51
	const REGION_VIRGINIA = self::REGION_US_E1;
52
 
53
	/**
54
	 * Specify the queue URL for the United States West (Northern California) Region.
55
	 */
56
	const REGION_US_W1 = 'ec2.us-west-1.amazonaws.com';
57
 
58
	/**
59
	 * Specify the queue URL for the United States West (Northern California) Region.
60
	 */
61
	const REGION_CALIFORNIA = self::REGION_US_W1;
62
 
63
	/**
64
	 * Specify the queue URL for the United States West (Oregon) Region.
65
	 */
66
	const REGION_US_W2 = 'ec2.us-west-2.amazonaws.com';
67
 
68
	/**
69
	 * Specify the queue URL for the United States West (Oregon) Region.
70
	 */
71
	const REGION_OREGON = self::REGION_US_W2;
72
 
73
	/**
74
	 * Specify the queue URL for the Europe West (Ireland) Region.
75
	 */
76
	const REGION_EU_W1 = 'ec2.eu-west-1.amazonaws.com';
77
 
78
	/**
79
	 * Specify the queue URL for the Europe West (Ireland) Region.
80
	 */
81
	const REGION_IRELAND = self::REGION_EU_W1;
82
 
83
	/**
84
	 * Specify the queue URL for the Asia Pacific Southeast (Singapore) Region.
85
	 */
86
	const REGION_APAC_SE1 = 'ec2.ap-southeast-1.amazonaws.com';
87
 
88
	/**
89
	 * Specify the queue URL for the Asia Pacific Southeast (Singapore) Region.
90
	 */
91
	const REGION_SINGAPORE = self::REGION_APAC_SE1;
92
 
93
	/**
94
	 * Specify the queue URL for the Asia Pacific Northeast (Tokyo) Region.
95
	 */
96
	const REGION_APAC_NE1 = 'ec2.ap-northeast-1.amazonaws.com';
97
 
98
	/**
99
	 * Specify the queue URL for the Asia Pacific Northeast (Tokyo) Region.
100
	 */
101
	const REGION_TOKYO = self::REGION_APAC_NE1;
102
 
103
	/**
104
	 * Specify the queue URL for the United States GovCloud Region.
105
	 */
106
	const REGION_US_GOV1 = 'ec2.us-gov-west-1.amazonaws.com';
107
 
108
	/**
109
	 * Specify the queue URL for the South America (Sao Paulo) Region.
110
	 */
111
	const REGION_SA_E1 = 'ec2.sa-east-1.amazonaws.com';
112
 
113
	/**
114
	 * Specify the queue URL for the South America (Sao Paulo) Region.
115
	 */
116
	const REGION_SAO_PAULO = self::REGION_SA_E1;
117
 
118
	/**
119
	 * Default service endpoint.
120
	 */
121
	const DEFAULT_URL = self::REGION_US_E1;
122
 
123
 
124
	/*%******************************************************************************************%*/
125
	// CONSTRUCTOR
126
 
127
	/**
128
	 * Constructs a new instance of <AmazonEC2>.
129
	 *
130
	 * @param array $options (Optional) An associative array of parameters that can have the following keys: <ul>
131
	 * 	<li><code>certificate_authority</code> - <code>boolean</code> - Optional - Determines which Cerificate Authority file to use. A value of boolean <code>false</code> will use the Certificate Authority file available on the system. A value of boolean <code>true</code> will use the Certificate Authority provided by the SDK. Passing a file system path to a Certificate Authority file (chmodded to <code>0755</code>) will use that. Leave this set to <code>false</code> if you're not sure.</li>
132
	 * 	<li><code>credentials</code> - <code>string</code> - Optional - The name of the credential set to use for authentication.</li>
133
	 * 	<li><code>default_cache_config</code> - <code>string</code> - Optional - This option allows a preferred storage type to be configured for long-term caching. This can be changed later using the <set_cache_config()> method. Valid values are: <code>apc</code>, <code>xcache</code>, or a file system path such as <code>./cache</code> or <code>/tmp/cache/</code>.</li>
134
	 * 	<li><code>key</code> - <code>string</code> - Optional - Your AWS key, or a session key. If blank, the default credential set will be used.</li>
135
	 * 	<li><code>secret</code> - <code>string</code> - Optional - Your AWS secret key, or a session secret key. If blank, the default credential set will be used.</li>
136
	 * 	<li><code>token</code> - <code>string</code> - Optional - An AWS session token.</li></ul>
137
	 * @return void
138
	 */
139
	public function __construct(array $options = array())
140
	{
141
		$this->api_version = '2011-11-01';
142
		$this->hostname = self::DEFAULT_URL;
143
		$this->auth_class = 'AuthV2Query';
144
 
145
		return parent::__construct($options);
146
	}
147
 
148
 
149
	/*%******************************************************************************************%*/
150
	// STATE CONSTANTS
151
 
152
	const STATE_PENDING = 0;
153
	const STATE_RUNNING = 16;
154
	const STATE_SHUTTING_DOWN = 32;
155
	const STATE_TERMINATED = 48;
156
	const STATE_STOPPING = 64;
157
	const STATE_STOPPED = 80;
158
 
159
 
160
	/*%******************************************************************************************%*/
161
	// INSTANCE CONSTANTS
162
 
163
	// Standard
164
	const INSTANCE_MICRO = 't1.micro';
165
	const INSTANCE_SMALL = 'm1.small';
166
	const INSTANCE_LARGE = 'm1.large';
167
	const INSTANCE_XLARGE = 'm1.xlarge';
168
 
169
	// High Memory
170
	const INSTANCE_HIGH_MEM_XLARGE = 'm2.xlarge';
171
	const INSTANCE_HIGH_MEM_2XLARGE = 'm2.2xlarge';
172
	const INSTANCE_HIGH_MEM_4XLARGE = 'm2.4xlarge';
173
 
174
	// High CPU
175
	const INSTANCE_HIGH_CPU_MEDIUM = 'c1.medium';
176
	const INSTANCE_HIGH_CPU_XLARGE = 'c1.xlarge';
177
 
178
	// Cluster
179
	const INSTANCE_CLUSTER_4XLARGE = 'cc1.4xlarge';
180
	const INSTANCE_CLUSTER_8XLARGE = 'cc2.8xlarge';
181
	const INSTANCE_CLUSTER_GPU_XLARGE = 'cg1.4xlarge';
182
 
183
	/*%******************************************************************************************%*/
184
	// SETTERS
185
 
186
	/**
187
	 * This allows you to explicitly sets the region for the service to use.
188
	 *
189
	 * @param string $region (Required) The region to explicitly set. Available options are <REGION_US_E1>, <REGION_US_W1>, <REGION_US_W2>, <REGION_EU_W1>, <REGION_APAC_SE1>, <REGION_APAC_NE1>, <REGION_US_GOV1>, <REGION_SA_E1>.
190
	 * @return $this A reference to the current instance.
191
	 */
192
	public function set_region($region)
193
	{
194
		// @codeCoverageIgnoreStart
195
		$this->set_hostname($region);
196
		return $this;
197
		// @codeCoverageIgnoreEnd
198
	}
199
 
200
 
201
	/*%******************************************************************************************%*/
202
	// SERVICE METHODS
203
 
204
	/**
205
	 * Activates a specific number of licenses for a 90-day period. Activations can be done against a
206
	 * specific license ID.
207
	 *
208
	 * @param string $license_id (Required) Specifies the ID for the specific license to activate against.
209
	 * @param integer $capacity (Required) Specifies the additional number of licenses to activate.
210
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
211
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
212
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
213
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
214
	 */
215
	public function activate_license($license_id, $capacity, $opt = null)
216
	{
217
		if (!$opt) $opt = array();
218
		$opt['LicenseId'] = $license_id;
219
		$opt['Capacity'] = $capacity;
220
 
221
		return $this->authenticate('ActivateLicense', $opt);
222
	}
223
 
224
	/**
225
	 * The AllocateAddress operation acquires an elastic IP address for use with your account.
226
	 *
227
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
228
	 * 	<li><code>Domain</code> - <code>string</code> - Optional - Set to <code>vpc</code> to allocate the address to your VPC. By default, will allocate to EC2. [Allowed values: <code>vpc</code>, <code>standard</code>]</li>
229
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
230
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
231
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
232
	 */
233
	public function allocate_address($opt = null)
234
	{
235
		if (!$opt) $opt = array();
236
 
237
		return $this->authenticate('AllocateAddress', $opt);
238
	}
239
 
240
	/**
241
	 * The AssociateAddress operation associates an elastic IP address with an instance.
242
	 *
243
	 * If the IP address is currently assigned to another instance, the IP address is assigned to the
244
	 * new instance. This is an idempotent operation. If you enter it more than once, Amazon EC2 does
245
	 * not return an error.
246
	 *
247
	 * @param string $instance_id (Required) The instance to associate with the IP address.
248
	 * @param string $public_ip (Required) IP address that you are assigning to the instance.
249
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
250
	 * 	<li><code>AllocationId</code> - <code>string</code> - Optional - The allocation ID that AWS returned when you allocated the elastic IP address for use with Amazon VPC.</li>
251
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
252
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
253
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
254
	 */
255
	public function associate_address($instance_id, $public_ip, $opt = null)
256
	{
257
		if (!$opt) $opt = array();
258
		$opt['InstanceId'] = $instance_id;
259
		$opt['PublicIp'] = $public_ip;
260
 
261
		return $this->authenticate('AssociateAddress', $opt);
262
	}
263
 
264
	/**
265
	 * Associates a set of DHCP options (that you've previously created) with the specified VPC. Or,
266
	 * associates the default DHCP options with the VPC. The default set consists of the standard EC2
267
	 * host name, no domain name, no DNS server, no NTP server, and no NetBIOS server or node type.
268
	 * After you associate the options with the VPC, any existing instances and all new instances that
269
	 * you launch in that VPC use the options. For more information about the supported DHCP options
270
	 * and using them with Amazon VPC, go to Using DHCP Options in the Amazon Virtual Private Cloud
271
	 * Developer Guide.
272
	 *
273
	 * @param string $dhcp_options_id (Required) The ID of the DHCP options to associate with the VPC. Specify "default" to associate the default DHCP options with the VPC.
274
	 * @param string $vpc_id (Required) The ID of the VPC to associate the DHCP options with.
275
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
276
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
277
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
278
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
279
	 */
280
	public function associate_dhcp_options($dhcp_options_id, $vpc_id, $opt = null)
281
	{
282
		if (!$opt) $opt = array();
283
		$opt['DhcpOptionsId'] = $dhcp_options_id;
284
		$opt['VpcId'] = $vpc_id;
285
 
286
		return $this->authenticate('AssociateDhcpOptions', $opt);
287
	}
288
 
289
	/**
290
	 * Associates a subnet with a route table. The subnet and route table must be in the same VPC.
291
	 * This association causes traffic originating from the subnet to be routed according to the
292
	 * routes in the route table. The action returns an association ID, which you need if you want to
293
	 * disassociate the route table from the subnet later. A route table can be associated with
294
	 * multiple subnets.
295
	 *
296
	 * For more information about route tables, go to <a href=
297
	 * "http://docs.amazonwebservices.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html">Route
298
	 * Tables</a> in the Amazon Virtual Private Cloud User Guide.
299
	 *
300
	 * @param string $subnet_id (Required) The ID of the subnet.
301
	 * @param string $route_table_id (Required) The ID of the route table.
302
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
303
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
304
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
305
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
306
	 */
307
	public function associate_route_table($subnet_id, $route_table_id, $opt = null)
308
	{
309
		if (!$opt) $opt = array();
310
		$opt['SubnetId'] = $subnet_id;
311
		$opt['RouteTableId'] = $route_table_id;
312
 
313
		return $this->authenticate('AssociateRouteTable', $opt);
314
	}
315
 
316
	/**
317
	 * Attaches an Internet gateway to a VPC, enabling connectivity between the Internet and the VPC.
318
	 * For more information about your VPC and Internet gateway, go to the Amazon Virtual Private
319
	 * Cloud User Guide.
320
	 *
321
	 * @param string $internet_gateway_id (Required) The ID of the Internet gateway to attach.
322
	 * @param string $vpc_id (Required) The ID of the VPC.
323
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
324
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
325
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
326
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
327
	 */
328
	public function attach_internet_gateway($internet_gateway_id, $vpc_id, $opt = null)
329
	{
330
		if (!$opt) $opt = array();
331
		$opt['InternetGatewayId'] = $internet_gateway_id;
332
		$opt['VpcId'] = $vpc_id;
333
 
334
		return $this->authenticate('AttachInternetGateway', $opt);
335
	}
336
 
337
	/**
338
	 * Attach a previously created volume to a running instance.
339
	 *
340
	 * @param string $volume_id (Required) The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone and the instance must be running.
341
	 * @param string $instance_id (Required) The ID of the instance to which the volume attaches. The volume and instance must be within the same Availability Zone and the instance must be running.
342
	 * @param string $device (Required) Specifies how the device is exposed to the instance (e.g., <code>/dev/sdh</code>).
343
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
344
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
345
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
346
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
347
	 */
348
	public function attach_volume($volume_id, $instance_id, $device, $opt = null)
349
	{
350
		if (!$opt) $opt = array();
351
		$opt['VolumeId'] = $volume_id;
352
		$opt['InstanceId'] = $instance_id;
353
		$opt['Device'] = $device;
354
 
355
		return $this->authenticate('AttachVolume', $opt);
356
	}
357
 
358
	/**
359
	 * Attaches a VPN gateway to a VPC. This is the last step required to get your VPC fully connected
360
	 * to your data center before launching instances in it. For more information, go to Process for
361
	 * Using Amazon VPC in the Amazon Virtual Private Cloud Developer Guide.
362
	 *
363
	 * @param string $vpn_gateway_id (Required) The ID of the VPN gateway to attach to the VPC.
364
	 * @param string $vpc_id (Required) The ID of the VPC to attach to the VPN gateway.
365
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
366
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
367
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
368
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
369
	 */
370
	public function attach_vpn_gateway($vpn_gateway_id, $vpc_id, $opt = null)
371
	{
372
		if (!$opt) $opt = array();
373
		$opt['VpnGatewayId'] = $vpn_gateway_id;
374
		$opt['VpcId'] = $vpc_id;
375
 
376
		return $this->authenticate('AttachVpnGateway', $opt);
377
	}
378
 
379
	/**
380
	 * This action applies only to security groups in a VPC; it's not supported for EC2 security
381
	 * groups. For information about Amazon Virtual Private Cloud and VPC security groups, go to the
382
	 * Amazon Virtual Private Cloud User Guide.
383
	 *
384
	 * The action adds one or more egress rules to a VPC security group. Specifically, this permits
385
	 * instances in a security group to send traffic to either one or more destination CIDR IP address
386
	 * ranges, or to one or more destination security groups in the same VPC.
387
	 *
388
	 * Each rule consists of the protocol (e.g., TCP), plus either a CIDR range, or a source group.
389
	 * For the TCP and UDP protocols, you must also specify the destination port or port range. For
390
	 * the ICMP protocol, you must also specify the ICMP type and code. You can use <code>-1</code> as
391
	 * a wildcard for the ICMP type or code.
392
	 *
393
	 * Rule changes are propagated to instances within the security group as quickly as possible.
394
	 * However, a small delay might occur.
395
	 *
396
	 * <strong>Important:</strong> For VPC security groups: You can have up to 50 rules total per
397
	 * group (covering both ingress and egress).
398
	 *
399
	 * @param string $group_id (Required) ID of the VPC security group to modify.
400
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
401
	 * 	<li><code>IpPermissions</code> - <code>array</code> - Optional - List of IP permissions to authorize on the specified security group. Specifying permissions through IP permissions is the preferred way of authorizing permissions since it offers more flexibility and control. <ul>
402
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
403
	 * 			<li><code>IpProtocol</code> - <code>string</code> - Optional - The IP protocol of this permission. Valid protocol values: <code>tcp</code>, <code>udp</code>, <code>icmp</code></li>
404
	 * 			<li><code>FromPort</code> - <code>integer</code> - Optional - Start of port range for the TCP and UDP protocols, or an ICMP type number. An ICMP type number of <code>-1</code> indicates a wildcard (i.e., any ICMP type number).</li>
405
	 * 			<li><code>ToPort</code> - <code>integer</code> - Optional - End of port range for the TCP and UDP protocols, or an ICMP code. An ICMP code of <code>-1</code> indicates a wildcard (i.e., any ICMP code).</li>
406
	 * 			<li><code>Groups</code> - <code>array</code> - Optional - The list of AWS user IDs and groups included in this permission. <ul>
407
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
408
	 * 					<li><code>UserId</code> - <code>string</code> - Optional - The AWS user ID of an account.</li>
409
	 * 					<li><code>GroupName</code> - <code>string</code> - Optional - Name of the security group in the specified AWS account. Cannot be used when specifying a CIDR IP address range.</li>
410
	 * 					<li><code>GroupId</code> - <code>string</code> - Optional - ID of the security group in the specified AWS account. Cannot be used when specifying a CIDR IP address range.</li>
411
	 * 				</ul></li>
412
	 * 			</ul></li>
413
	 * 			<li><code>IpRanges</code> - <code>string|array</code> - Optional - The list of CIDR IP ranges included in this permission. Pass a string for a single value, or an indexed array for multiple values.</li>
414
	 * 		</ul></li>
415
	 * 	</ul></li>
416
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
417
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
418
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
419
	 */
420
	public function authorize_security_group_egress($group_id, $opt = null)
421
	{
422
		if (!$opt) $opt = array();
423
		$opt['GroupId'] = $group_id;
424
 
425
		// Optional list + map
426
		if (isset($opt['IpPermissions']))
427
		{
428
			$opt = array_merge($opt, CFComplexType::map(array(
429
				'IpPermissions' => $opt['IpPermissions']
430
			)));
431
			unset($opt['IpPermissions']);
432
		}
433
 
434
		return $this->authenticate('AuthorizeSecurityGroupEgress', $opt);
435
	}
436
 
437
	/**
438
	 * The AuthorizeSecurityGroupIngress operation adds permissions to a security group.
439
	 *
440
	 * Permissions are specified by the IP protocol (TCP, UDP or ICMP), the source of the request (by
441
	 * IP range or an Amazon EC2 user-group pair), the source and destination port ranges (for TCP and
442
	 * UDP), and the ICMP codes and types (for ICMP). When authorizing ICMP, <code>-1</code> can be
443
	 * used as a wildcard in the type and code fields.
444
	 *
445
	 * Permission changes are propagated to instances within the security group as quickly as
446
	 * possible. However, depending on the number of instances, a small delay might occur.
447
	 *
448
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
449
	 * 	<li><code>GroupName</code> - <code>string</code> - Optional - Name of the standard (EC2) security group to modify. The group must belong to your account. Can be used instead of GroupID for standard (EC2) security groups.</li>
450
	 * 	<li><code>GroupId</code> - <code>string</code> - Optional - ID of the standard (EC2) or VPC security group to modify. The group must belong to your account. Required for VPC security groups; can be used instead of GroupName for standard (EC2) security groups.</li>
451
	 * 	<li><code>IpPermissions</code> - <code>array</code> - Optional - List of IP permissions to authorize on the specified security group. Specifying permissions through IP permissions is the preferred way of authorizing permissions since it offers more flexibility and control. <ul>
452
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
453
	 * 			<li><code>IpProtocol</code> - <code>string</code> - Optional - The IP protocol of this permission. Valid protocol values: <code>tcp</code>, <code>udp</code>, <code>icmp</code></li>
454
	 * 			<li><code>FromPort</code> - <code>integer</code> - Optional - Start of port range for the TCP and UDP protocols, or an ICMP type number. An ICMP type number of <code>-1</code> indicates a wildcard (i.e., any ICMP type number).</li>
455
	 * 			<li><code>ToPort</code> - <code>integer</code> - Optional - End of port range for the TCP and UDP protocols, or an ICMP code. An ICMP code of <code>-1</code> indicates a wildcard (i.e., any ICMP code).</li>
456
	 * 			<li><code>Groups</code> - <code>array</code> - Optional - The list of AWS user IDs and groups included in this permission. <ul>
457
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
458
	 * 					<li><code>UserId</code> - <code>string</code> - Optional - The AWS user ID of an account.</li>
459
	 * 					<li><code>GroupName</code> - <code>string</code> - Optional - Name of the security group in the specified AWS account. Cannot be used when specifying a CIDR IP address range.</li>
460
	 * 					<li><code>GroupId</code> - <code>string</code> - Optional - ID of the security group in the specified AWS account. Cannot be used when specifying a CIDR IP address range.</li>
461
	 * 				</ul></li>
462
	 * 			</ul></li>
463
	 * 			<li><code>IpRanges</code> - <code>string|array</code> - Optional - The list of CIDR IP ranges included in this permission. Pass a string for a single value, or an indexed array for multiple values.</li>
464
	 * 		</ul></li>
465
	 * 	</ul></li>
466
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
467
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
468
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
469
	 */
470
	public function authorize_security_group_ingress($opt = null)
471
	{
472
		if (!$opt) $opt = array();
473
 
474
		// Optional list + map
475
		if (isset($opt['IpPermissions']))
476
		{
477
			$opt = array_merge($opt, CFComplexType::map(array(
478
				'IpPermissions' => $opt['IpPermissions']
479
			)));
480
			unset($opt['IpPermissions']);
481
		}
482
 
483
		return $this->authenticate('AuthorizeSecurityGroupIngress', $opt);
484
	}
485
 
486
	/**
487
	 * The BundleInstance operation request that an instance is bundled the next time it boots. The
488
	 * bundling process creates a new image from a running instance and stores the AMI data in S3. Once
489
	 * bundled, the image must be registered in the normal way using the RegisterImage API.
490
	 *
491
	 * @param string $instance_id (Required) The ID of the instance to bundle.
492
	 * @param array $policy (Required) The details of S3 storage for bundling a Windows instance. Takes an associative array of parameters that can have the following keys: <ul>
493
	 * 	<li><code>Bucket</code> - <code>string</code> - Optional - The bucket in which to store the AMI. You can specify a bucket that you already own or a new bucket that Amazon EC2 creates on your behalf. If you specify a bucket that belongs to someone else, Amazon EC2 returns an error.</li>
494
	 * 	<li><code>Prefix</code> - <code>string</code> - Optional - The prefix to use when storing the AMI in S3.</li>
495
	 * 	<li><code>AWSAccessKeyId</code> - <code>string</code> - Optional - The Access Key ID of the owner of the Amazon S3 bucket. Use the <CFPolicy::get_key()> method of a <CFPolicy> instance.</li>
496
	 * 	<li><code>UploadPolicy</code> - <code>string</code> - Optional - A Base64-encoded Amazon S3 upload policy that gives Amazon EC2 permission to upload items into Amazon S3 on the user's behalf. Use the <CFPolicy::get_policy()> method of a <CFPolicy> instance.</li>
497
	 * 	<li><code>UploadPolicySignature</code> - <code>string</code> - Optional - The signature of the Base64 encoded JSON document. Use the <CFPolicy::get_policy_signature()> method of a <CFPolicy> instance.</li></ul>
498
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
499
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
500
	 *  <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This is useful for manually-managed batch requests.</li></ul>
501
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
502
	 */
503
	public function bundle_instance($instance_id, $policy, $opt = null)
504
	{
505
		if (!$opt) $opt = array();
506
		$opt['InstanceId'] = $instance_id;
507
 
508
		$opt = array_merge($opt, CFComplexType::map(array(
509
			'Storage.S3' => $policy
510
		)));
511
 
512
		return $this->authenticate('BundleInstance', $opt, $this->hostname);
513
	}
514
 
515
	/**
516
	 * CancelBundleTask operation cancels a pending or in-progress bundling task. This is an
517
	 * asynchronous call and it make take a while for the task to be canceled. If a task is canceled
518
	 * while it is storing items, there may be parts of the incomplete AMI stored in S3. It is up to
519
	 * the caller to clean up these parts from S3.
520
	 *
521
	 * @param string $bundle_id (Required) The ID of the bundle task to cancel.
522
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
523
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
524
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
525
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
526
	 */
527
	public function cancel_bundle_task($bundle_id, $opt = null)
528
	{
529
		if (!$opt) $opt = array();
530
		$opt['BundleId'] = $bundle_id;
531
 
532
		return $this->authenticate('CancelBundleTask', $opt);
533
	}
534
 
535
	/**
536
	 * Cancels one or more Spot Instance requests.
537
	 *
538
	 * Spot Instances are instances that Amazon EC2 starts on your behalf when the maximum price that
539
	 * you specify exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price based
540
	 * on available Spot Instance capacity and current spot instance requests.
541
	 *
542
	 * For conceptual information about Spot Instances, refer to the <a href=
543
	 * "http://docs.amazonwebservices.com/AWSEC2/2009-11-30/DeveloperGuide/">Amazon Elastic Compute
544
	 * Cloud Developer Guide</a> or <a href=
545
	 * "http://docs.amazonwebservices.com/AWSEC2/2009-11-30/UserGuide/">Amazon Elastic Compute Cloud
546
	 * User Guide</a>.
547
	 *
548
	 * @param string|array $spot_instance_request_id (Required) Specifies the ID of the Spot Instance request. Pass a string for a single value, or an indexed array for multiple values.
549
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
550
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
551
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
552
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
553
	 */
554
	public function cancel_spot_instance_requests($spot_instance_request_id, $opt = null)
555
	{
556
		if (!$opt) $opt = array();
557
 
558
		// Required list (non-map)
559
		$opt = array_merge($opt, CFComplexType::map(array(
560
			'SpotInstanceRequestId' => (is_array($spot_instance_request_id) ? $spot_instance_request_id : array($spot_instance_request_id))
561
		)));
562
 
563
		return $this->authenticate('CancelSpotInstanceRequests', $opt);
564
	}
565
 
566
	/**
567
	 * The ConfirmProductInstance operation returns true if the specified product code is attached to
568
	 * the specified instance. The operation returns false if the product code is not attached to the
569
	 * instance.
570
	 *
571
	 * The ConfirmProductInstance operation can only be executed by the owner of the AMI. This feature
572
	 * is useful when an AMI owner is providing support and wants to verify whether a user's instance
573
	 * is eligible.
574
	 *
575
	 * @param string $product_code (Required) The product code to confirm.
576
	 * @param string $instance_id (Required) The ID of the instance to confirm.
577
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
578
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
579
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
580
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
581
	 */
582
	public function confirm_product_instance($product_code, $instance_id, $opt = null)
583
	{
584
		if (!$opt) $opt = array();
585
		$opt['ProductCode'] = $product_code;
586
		$opt['InstanceId'] = $instance_id;
587
 
588
		return $this->authenticate('ConfirmProductInstance', $opt);
589
	}
590
 
591
	/**
592
	 * Provides information to AWS about your customer gateway device. The customer gateway is the
593
	 * appliance at your end of the VPN connection (compared to the VPN gateway, which is the device
594
	 * at the AWS side of the VPN connection). You can have a single active customer gateway per AWS
595
	 * account (active means that you've created a VPN connection to use with the customer gateway).
596
	 * AWS might delete any customer gateway that you create with this operation if you leave it
597
	 * inactive for an extended period of time.
598
	 *
599
	 * You must provide the Internet-routable IP address of the customer gateway's external interface.
600
	 * The IP address must be static.
601
	 *
602
	 * You must also provide the device's Border Gateway Protocol (BGP) Autonomous System Number
603
	 * (ASN). You can use an existing ASN assigned to your network. If you don't have an ASN already,
604
	 * you can use a private ASN (in the 64512 - 65534 range). For more information about ASNs, go to
605
	 * 	<a href=
606
	 * "http://en.wikipedia.org/wiki/Autonomous_system_%28Internet%29">http://en.wikipedia.org/wiki/Autonomous_system_%28Internet%29</a>.
607
	 *
608
	 * @param string $type (Required) The type of VPN connection this customer gateway supports.
609
	 * @param string $ip_address (Required) The Internet-routable IP address for the customer gateway's outside interface. The address must be static
610
	 * @param integer $bgp_asn (Required) The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
611
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
612
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
613
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
614
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
615
	 */
616
	public function create_customer_gateway($type, $ip_address, $bgp_asn, $opt = null)
617
	{
618
		if (!$opt) $opt = array();
619
		$opt['Type'] = $type;
620
		$opt['IpAddress'] = $ip_address;
621
		$opt['BgpAsn'] = $bgp_asn;
622
 
623
		return $this->authenticate('CreateCustomerGateway', $opt);
624
	}
625
 
626
	/**
627
	 * Creates a set of DHCP options that you can then associate with one or more VPCs, causing all
628
	 * existing and new instances that you launch in those VPCs to use the set of DHCP options. The
629
	 * following table lists the individual DHCP options you can specify. For more information about
630
	 * the options, go to <a href=
631
	 * "http://www.ietf.org/rfc/rfc2132.txt">http://www.ietf.org/rfc/rfc2132.txt</a>
632
	 *
633
	 * @param array $dhcp_configuration (Required) A set of one or more DHCP configurations. <ul>
634
	 * 	<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
635
	 * 		<li><code>Key</code> - <code>string</code> - Optional - Contains the name of a DHCP option.</li>
636
	 * 		<li><code>Value</code> - <code>string|array</code> - Optional - Contains a set of values for a DHCP option. Pass a string for a single value, or an indexed array for multiple values.</li>
637
	 * 	</ul></li>
638
	 * </ul>
639
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
640
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
641
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
642
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
643
	 */
644
	public function create_dhcp_options($dhcp_configuration, $opt = null)
645
	{
646
		if (!$opt) $opt = array();
647
 
648
		// Required list + map
649
		$opt = array_merge($opt, CFComplexType::map(array(
650
			'DhcpConfiguration' => (is_array($dhcp_configuration) ? $dhcp_configuration : array($dhcp_configuration))
651
		)));
652
 
653
		return $this->authenticate('CreateDhcpOptions', $opt);
654
	}
655
 
656
	/**
657
	 * Creates an Amazon EBS-backed AMI from a "running" or "stopped" instance. AMIs that use an
658
	 * Amazon EBS root device boot faster than AMIs that use instance stores. They can be up to 1 TiB
659
	 * in size, use storage that persists on instance failure, and can be stopped and started.
660
	 *
661
	 * @param string $instance_id (Required) The ID of the instance from which to create the new image.
662
	 * @param string $name (Required) The name for the new AMI being created.
663
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
664
	 * 	<li><code>Description</code> - <code>string</code> - Optional - The description for the new AMI being created.</li>
665
	 * 	<li><code>NoReboot</code> - <code>boolean</code> - Optional - By default this property is set to <code>false</code>, which means Amazon EC2 attempts to cleanly shut down the instance before image creation and reboots the instance afterwards. When set to true, Amazon EC2 will not shut down the instance before creating the image. When this option is used, file system integrity on the created image cannot be guaranteed.</li>
666
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
667
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
668
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
669
	 */
670
	public function create_image($instance_id, $name, $opt = null)
671
	{
672
		if (!$opt) $opt = array();
673
		$opt['InstanceId'] = $instance_id;
674
		$opt['Name'] = $name;
675
 
676
		return $this->authenticate('CreateImage', $opt);
677
	}
678
 
679
	/**
680
	 * Creates a new Internet gateway in your AWS account. After creating the Internet gateway, you
681
	 * then attach it to a VPC using <code>AttachInternetGateway</code>. For more information about
682
	 * your VPC and Internet gateway, go to Amazon Virtual Private Cloud User Guide.
683
	 *
684
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
685
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
686
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
687
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
688
	 */
689
	public function create_internet_gateway($opt = null)
690
	{
691
		if (!$opt) $opt = array();
692
 
693
		return $this->authenticate('CreateInternetGateway', $opt);
694
	}
695
 
696
	/**
697
	 * The CreateKeyPair operation creates a new 2048 bit RSA key pair and returns a unique ID that
698
	 * can be used to reference this key pair when launching new instances. For more information, see
699
	 * RunInstances.
700
	 *
701
	 * @param string $key_name (Required) The unique name for the new key pair.
702
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
703
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
704
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
705
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
706
	 */
707
	public function create_key_pair($key_name, $opt = null)
708
	{
709
		if (!$opt) $opt = array();
710
		$opt['KeyName'] = $key_name;
711
 
712
		return $this->authenticate('CreateKeyPair', $opt);
713
	}
714
 
715
	/**
716
	 * Creates a new network ACL in a VPC. Network ACLs provide an optional layer of security (on top
717
	 * of security groups) for the instances in your VPC. For more information about network ACLs, go
718
	 * to Network ACLs in the Amazon Virtual Private Cloud User Guide.
719
	 *
720
	 * @param string $vpc_id (Required) The ID of the VPC where the network ACL will be created.
721
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
722
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
723
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
724
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
725
	 */
726
	public function create_network_acl($vpc_id, $opt = null)
727
	{
728
		if (!$opt) $opt = array();
729
		$opt['VpcId'] = $vpc_id;
730
 
731
		return $this->authenticate('CreateNetworkAcl', $opt);
732
	}
733
 
734
	/**
735
	 * Creates an entry (i.e., rule) in a network ACL with a rule number you specify. Each network ACL
736
	 * has a set of numbered ingress rules and a separate set of numbered egress rules. When
737
	 * determining whether a packet should be allowed in or out of a subnet associated with the ACL,
738
	 * Amazon VPC processes the entries in the ACL according to the rule numbers, in ascending order.
739
	 *
740
	 * <strong>Important:</strong> We recommend that you leave room between the rules (e.g., 100, 110,
741
	 * 120, etc.), and not number them sequentially (101, 102, 103, etc.). This allows you to easily
742
	 * add a new rule between existing ones without having to renumber the rules.
743
	 *
744
	 * After you add an entry, you can't modify it; you must either replace it, or create a new entry
745
	 * and delete the old one.
746
	 *
747
	 * For more information about network ACLs, go to Network ACLs in the Amazon Virtual Private Cloud
748
	 * User Guide.
749
	 *
750
	 * @param string $network_acl_id (Required) ID of the ACL where the entry will be created.
751
	 * @param integer $rule_number (Required) Rule number to assign to the entry (e.g., 100). ACL entries are processed in ascending order by rule number.
752
	 * @param string $protocol (Required) IP protocol the rule applies to. Valid Values: <code>tcp</code>, <code>udp</code>, <code>icmp</code> or an IP protocol number.
753
	 * @param string $rule_action (Required) Whether to allow or deny traffic that matches the rule. [Allowed values: <code>allow</code>, <code>deny</code>]
754
	 * @param boolean $egress (Required) Whether this rule applies to egress traffic from the subnet (<code>true</code>) or ingress traffic to the subnet (<code>false</code>).
755
	 * @param string $cidr_block (Required) The CIDR range to allow or deny, in CIDR notation (e.g., <code>172.16.0.0/24</code>).
756
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
757
	 * 	<li><code>Icmp</code> - <code>array</code> - Optional - ICMP values. <ul>
758
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
759
	 * 			<li><code>Type</code> - <code>integer</code> - Optional - For the ICMP protocol, the ICMP type. A value of <code>-1</code> is a wildcard meaning all types. Required if specifying <code>icmp</code> for the protocol.</li>
760
	 * 			<li><code>Code</code> - <code>integer</code> - Optional - For the ICMP protocol, the ICMP code. A value of <code>-1</code> is a wildcard meaning all codes. Required if specifying <code>icmp</code> for the protocol.</li>
761
	 * 		</ul></li>
762
	 * 	</ul></li>
763
	 * 	<li><code>PortRange</code> - <code>array</code> - Optional - Port ranges. <ul>
764
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
765
	 * 			<li><code>From</code> - <code>integer</code> - Optional - The first port in the range. Required if specifying <code>tcp</code> or <code>udp</code> for the protocol.</li>
766
	 * 			<li><code>To</code> - <code>integer</code> - Optional - The last port in the range. Required if specifying <code>tcp</code> or <code>udp</code> for the protocol.</li>
767
	 * 		</ul></li>
768
	 * 	</ul></li>
769
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
770
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
771
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
772
	 */
773
	public function create_network_acl_entry($network_acl_id, $rule_number, $protocol, $rule_action, $egress, $cidr_block, $opt = null)
774
	{
775
		if (!$opt) $opt = array();
776
		$opt['NetworkAclId'] = $network_acl_id;
777
		$opt['RuleNumber'] = $rule_number;
778
		$opt['Protocol'] = $protocol;
779
		$opt['RuleAction'] = $rule_action;
780
		$opt['Egress'] = $egress;
781
		$opt['CidrBlock'] = $cidr_block;
782
 
783
		// Optional map (non-list)
784
		if (isset($opt['Icmp']))
785
		{
786
			$opt = array_merge($opt, CFComplexType::map(array(
787
				'Icmp' => $opt['Icmp']
788
			)));
789
			unset($opt['Icmp']);
790
		}
791
 
792
		// Optional map (non-list)
793
		if (isset($opt['PortRange']))
794
		{
795
			$opt = array_merge($opt, CFComplexType::map(array(
796
				'PortRange' => $opt['PortRange']
797
			)));
798
			unset($opt['PortRange']);
799
		}
800
 
801
		return $this->authenticate('CreateNetworkAclEntry', $opt);
802
	}
803
 
804
	/**
805
	 * Creates a <code>PlacementGroup</code> into which multiple Amazon EC2 instances can be launched.
806
	 * Users must give the group a name unique within the scope of the user account.
807
	 *
808
	 * @param string $group_name (Required) The name of the <code>PlacementGroup</code>.
809
	 * @param string $strategy (Required) The <code>PlacementGroup</code> strategy. [Allowed values: <code>cluster</code>]
810
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
811
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
812
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
813
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
814
	 */
815
	public function create_placement_group($group_name, $strategy, $opt = null)
816
	{
817
		if (!$opt) $opt = array();
818
		$opt['GroupName'] = $group_name;
819
		$opt['Strategy'] = $strategy;
820
 
821
		return $this->authenticate('CreatePlacementGroup', $opt);
822
	}
823
 
824
	/**
825
	 * Creates a new route in a route table within a VPC. The route's target can be either a gateway
826
	 * attached to the VPC or a NAT instance in the VPC.
827
	 *
828
	 * When determining how to route traffic, we use the route with the most specific match. For
829
	 * example, let's say the traffic is destined for <code>192.0.2.3</code>, and the route table
830
	 * includes the following two routes:
831
	 *
832
	 * <ul>
833
	 * 	<li><code>192.0.2.0/24</code> (goes to some target A)</li>
834
	 * 	<li><code>192.0.2.0/28</code> (goes to some target B)</li>
835
	 * </ul>
836
	 *
837
	 * Both routes apply to the traffic destined for <code>192.0.2.3</code>. However, the second route
838
	 * in the list is more specific, so we use that route to determine where to target the traffic.
839
	 *
840
	 * For more information about route tables, go to <a href=
841
	 * "http://docs.amazonwebservices.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html">Route
842
	 * Tables</a> in the Amazon Virtual Private Cloud User Guide.
843
	 *
844
	 * @param string $route_table_id (Required) The ID of the route table where the route will be added.
845
	 * @param string $destination_cidr_block (Required) The CIDR address block used for the destination match. For example: <code>0.0.0.0/0</code>. Routing decisions are based on the most specific match.
846
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
847
	 * 	<li><code>GatewayId</code> - <code>string</code> - Optional - The ID of a VPN or Internet gateway attached to your VPC. You must provide either <code>GatewayId</code> or <code>InstanceId</code>, but not both.</li>
848
	 * 	<li><code>InstanceId</code> - <code>string</code> - Optional - The ID of a NAT instance in your VPC. You must provide either <code>GatewayId</code> or <code>InstanceId</code>, but not both.</li>
849
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
850
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
851
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
852
	 */
853
	public function create_route($route_table_id, $destination_cidr_block, $opt = null)
854
	{
855
		if (!$opt) $opt = array();
856
		$opt['RouteTableId'] = $route_table_id;
857
		$opt['DestinationCidrBlock'] = $destination_cidr_block;
858
 
859
		return $this->authenticate('CreateRoute', $opt);
860
	}
861
 
862
	/**
863
	 * Creates a new route table within a VPC. After you create a new route table, you can add routes
864
	 * and associate the table with a subnet. For more information about route tables, go to <a href=
865
	 * "http://docs.amazonwebservices.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html">Route
866
	 * Tables</a> in the Amazon Virtual Private Cloud User Guide.
867
	 *
868
	 * @param string $vpc_id (Required) The ID of the VPC where the route table will be created.
869
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
870
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
871
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
872
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
873
	 */
874
	public function create_route_table($vpc_id, $opt = null)
875
	{
876
		if (!$opt) $opt = array();
877
		$opt['VpcId'] = $vpc_id;
878
 
879
		return $this->authenticate('CreateRouteTable', $opt);
880
	}
881
 
882
	/**
883
	 * The CreateSecurityGroup operation creates a new security group.
884
	 *
885
	 * Every instance is launched in a security group. If no security group is specified during
886
	 * launch, the instances are launched in the default security group. Instances within the same
887
	 * security group have unrestricted network access to each other. Instances will reject network
888
	 * access attempts from other instances in a different security group. As the owner of instances
889
	 * you can grant or revoke specific permissions using the AuthorizeSecurityGroupIngress and
890
	 * RevokeSecurityGroupIngress operations.
891
	 *
892
	 * @param string $group_name (Required) Name of the security group.
893
	 * @param string $group_description (Required) Description of the group. This is informational only.
894
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
895
	 * 	<li><code>VpcId</code> - <code>string</code> - Optional - ID of the VPC.</li>
896
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
897
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
898
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
899
	 */
900
	public function create_security_group($group_name, $group_description, $opt = null)
901
	{
902
		if (!$opt) $opt = array();
903
		$opt['GroupName'] = $group_name;
904
		$opt['GroupDescription'] = $group_description;
905
 
906
		return $this->authenticate('CreateSecurityGroup', $opt);
907
	}
908
 
909
	/**
910
	 * Create a snapshot of the volume identified by volume ID. A volume does not have to be detached
911
	 * at the time the snapshot is taken.
912
	 *
913
	 * <p class="note">
914
	 * Snapshot creation requires that the system is in a consistent state. For instance, this means
915
	 * that if taking a snapshot of a database, the tables must be read-only locked to ensure that the
916
	 * snapshot will not contain a corrupted version of the database. Therefore, be careful when using
917
	 * this API to ensure that the system remains in the consistent state until the create snapshot
918
	 * status has returned.
919
	 * </p>
920
	 *
921
	 * @param string $volume_id (Required) The ID of the volume from which to create the snapshot.
922
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
923
	 * 	<li><code>Description</code> - <code>string</code> - Optional - The description for the new snapshot.</li>
924
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
925
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
926
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
927
	 */
928
	public function create_snapshot($volume_id, $opt = null)
929
	{
930
		if (!$opt) $opt = array();
931
		$opt['VolumeId'] = $volume_id;
932
 
933
		return $this->authenticate('CreateSnapshot', $opt);
934
	}
935
 
936
	/**
937
	 * Creates the data feed for Spot Instances, enabling you to view Spot Instance usage logs. You
938
	 * can create one data feed per account.
939
	 *
940
	 * For conceptual information about Spot Instances, refer to the <a href=
941
	 * "http://docs.amazonwebservices.com/AWSEC2/2009-11-30/DeveloperGuide/">Amazon Elastic Compute
942
	 * Cloud Developer Guide</a> or <a href=
943
	 * "http://docs.amazonwebservices.com/AWSEC2/2009-11-30/UserGuide/">Amazon Elastic Compute Cloud
944
	 * User Guide</a>.
945
	 *
946
	 * @param string $bucket (Required) The Amazon S3 bucket in which to store the Spot Instance datafeed.
947
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
948
	 * 	<li><code>Prefix</code> - <code>string</code> - Optional - The prefix that is prepended to datafeed files.</li>
949
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
950
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
951
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
952
	 */
953
	public function create_spot_datafeed_subscription($bucket, $opt = null)
954
	{
955
		if (!$opt) $opt = array();
956
		$opt['Bucket'] = $bucket;
957
 
958
		return $this->authenticate('CreateSpotDatafeedSubscription', $opt);
959
	}
960
 
961
	/**
962
	 * Creates a subnet in an existing VPC. You can create up to 20 subnets in a VPC. If you add more
963
	 * than one subnet to a VPC, they're set up in a star topology with a logical router in the
964
	 * middle. When you create each subnet, you provide the VPC ID and the CIDR block you want for the
965
	 * subnet. Once you create a subnet, you can't change its CIDR block. The subnet's CIDR block can
966
	 * be the same as the VPC's CIDR block (assuming you want only a single subnet in the VPC), or a
967
	 * subset of the VPC's CIDR block. If you create more than one subnet in a VPC, the subnets' CIDR
968
	 * blocks must not overlap. The smallest subnet (and VPC) you can create uses a <code>/28</code>
969
	 * netmask (16 IP addresses), and the largest uses a <code>/18</code> netmask (16,384 IP
970
	 * addresses).
971
	 *
972
	 * <p class="important"></p>
973
	 * AWS reserves both the first four and the last IP address in each subnet's CIDR block. They're
974
	 * not available for use.
975
	 *
976
	 * @param string $vpc_id (Required) The ID of the VPC to create the subnet in.
977
	 * @param string $cidr_block (Required) The CIDR block the subnet is to cover.
978
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
979
	 * 	<li><code>AvailabilityZone</code> - <code>string</code> - Optional - The Availability Zone to create the subnet in.</li>
980
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
981
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
982
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
983
	 */
984
	public function create_subnet($vpc_id, $cidr_block, $opt = null)
985
	{
986
		if (!$opt) $opt = array();
987
		$opt['VpcId'] = $vpc_id;
988
		$opt['CidrBlock'] = $cidr_block;
989
 
990
		return $this->authenticate('CreateSubnet', $opt);
991
	}
992
 
993
	/**
994
	 * Adds or overwrites tags for the specified resources. Each resource can have a maximum of 10
995
	 * tags. Each tag consists of a key-value pair. Tag keys must be unique per resource.
996
	 *
997
	 * @param string|array $resource_id (Required) One or more IDs of resources to tag. This could be the ID of an AMI, an instance, an EBS volume, or snapshot, etc. Pass a string for a single value, or an indexed array for multiple values.
998
	 * @param array $tag (Required) The tags to add or overwrite for the specified resources. Each tag item consists of a key-value pair. <ul>
999
	 * 	<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
1000
	 * 		<li><code>Key</code> - <code>string</code> - Optional - The tag's key.</li>
1001
	 * 		<li><code>Value</code> - <code>string</code> - Optional - The tag's value.</li>
1002
	 * 	</ul></li>
1003
	 * </ul>
1004
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1005
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1006
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1007
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1008
	 */
1009
	public function create_tags($resource_id, $tag, $opt = null)
1010
	{
1011
		if (!$opt) $opt = array();
1012
 
1013
		// Required list (non-map)
1014
		$opt = array_merge($opt, CFComplexType::map(array(
1015
			'ResourceId' => (is_array($resource_id) ? $resource_id : array($resource_id))
1016
		)));
1017
 
1018
		// Required list + map
1019
		$opt = array_merge($opt, CFComplexType::map(array(
1020
			'Tag' => (is_array($tag) ? $tag : array($tag))
1021
		)));
1022
 
1023
		return $this->authenticate('CreateTags', $opt);
1024
	}
1025
 
1026
	/**
1027
	 * Initializes an empty volume of a given size.
1028
	 *
1029
	 * @param string $availability_zone (Required) The Availability Zone in which to create the new volume.
1030
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1031
	 * 	<li><code>Size</code> - <code>integer</code> - Optional - The size of the volume, in gigabytes. Required if you are not creating a volume from a snapshot.</li>
1032
	 * 	<li><code>SnapshotId</code> - <code>string</code> - Optional - The ID of the snapshot from which to create the new volume.</li>
1033
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1034
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1035
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1036
	 */
1037
	public function create_volume($availability_zone, $opt = null)
1038
	{
1039
		if (!$opt) $opt = array();
1040
		$opt['AvailabilityZone'] = $availability_zone;
1041
 
1042
		return $this->authenticate('CreateVolume', $opt);
1043
	}
1044
 
1045
	/**
1046
	 * Creates a VPC with the CIDR block you specify. The smallest VPC you can create uses a
1047
	 * <code>/28</code> netmask (16 IP addresses), and the largest uses a <code>/18</code> netmask
1048
	 * (16,384 IP addresses). To help you decide how big to make your VPC, go to the topic about
1049
	 * creating VPCs in the Amazon Virtual Private Cloud Developer Guide.
1050
	 *
1051
	 * By default, each instance you launch in the VPC has the default DHCP options (the standard EC2
1052
	 * host name, no domain name, no DNS server, no NTP server, and no NetBIOS server or node type).
1053
	 *
1054
	 * @param string $cidr_block (Required) A valid CIDR block.
1055
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1056
	 * 	<li><code>InstanceTenancy</code> - <code>string</code> - Optional - The allowed tenancy of instances launched into the VPC. A value of default means instances can be launched with any tenancy; a value of dedicated means instances must be launched with tenancy as dedicated.</li>
1057
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1058
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1059
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1060
	 */
1061
	public function create_vpc($cidr_block, $opt = null)
1062
	{
1063
		if (!$opt) $opt = array();
1064
		$opt['CidrBlock'] = $cidr_block;
1065
 
1066
		return $this->authenticate('CreateVpc', $opt);
1067
	}
1068
 
1069
	/**
1070
	 * Creates a new VPN connection between an existing VPN gateway and customer gateway. The only
1071
	 * supported connection type is ipsec.1.
1072
	 *
1073
	 * The response includes information that you need to configure your customer gateway, in XML
1074
	 * format. We recommend you use the command line version of this operation
1075
	 * (<code>ec2-create-vpn-connection</code>), which takes an <code>-f</code> option (for format)
1076
	 * and returns configuration information formatted as expected by the vendor you specified, or in
1077
	 * a generic, human readable format. For information about the command, go to
1078
	 * <code>ec2-create-vpn-connection</code> in the Amazon Virtual Private Cloud Command Line
1079
	 * Reference.
1080
	 *
1081
	 * <p class="important"></p>
1082
	 * We strongly recommend you use HTTPS when calling this operation because the response contains
1083
	 * sensitive cryptographic information for configuring your customer gateway.
1084
	 *
1085
	 * If you decide to shut down your VPN connection for any reason and then create a new one, you
1086
	 * must re-configure your customer gateway with the new information returned from this call.
1087
	 *
1088
	 * @param string $type (Required) The type of VPN connection.
1089
	 * @param string $customer_gateway_id (Required) The ID of the customer gateway.
1090
	 * @param string $vpn_gateway_id (Required) The ID of the VPN gateway.
1091
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1092
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1093
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1094
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1095
	 */
1096
	public function create_vpn_connection($type, $customer_gateway_id, $vpn_gateway_id, $opt = null)
1097
	{
1098
		if (!$opt) $opt = array();
1099
		$opt['Type'] = $type;
1100
		$opt['CustomerGatewayId'] = $customer_gateway_id;
1101
		$opt['VpnGatewayId'] = $vpn_gateway_id;
1102
 
1103
		return $this->authenticate('CreateVpnConnection', $opt);
1104
	}
1105
 
1106
	/**
1107
	 * Creates a new VPN gateway. A VPN gateway is the VPC-side endpoint for your VPN connection. You
1108
	 * can create a VPN gateway before creating the VPC itself.
1109
	 *
1110
	 * @param string $type (Required) The type of VPN connection this VPN gateway supports.
1111
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1112
	 * 	<li><code>AvailabilityZone</code> - <code>string</code> - Optional - The Availability Zone in which to create the VPN gateway.</li>
1113
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1114
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1115
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1116
	 */
1117
	public function create_vpn_gateway($type, $opt = null)
1118
	{
1119
		if (!$opt) $opt = array();
1120
		$opt['Type'] = $type;
1121
 
1122
		return $this->authenticate('CreateVpnGateway', $opt);
1123
	}
1124
 
1125
	/**
1126
	 * Deactivates a specific number of licenses. Deactivations can be done against a specific license
1127
	 * ID after they have persisted for at least a 90-day period.
1128
	 *
1129
	 * @param string $license_id (Required) Specifies the ID for the specific license to deactivate against.
1130
	 * @param integer $capacity (Required) Specifies the amount of capacity to deactivate against the license.
1131
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1132
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1133
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1134
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1135
	 */
1136
	public function deactivate_license($license_id, $capacity, $opt = null)
1137
	{
1138
		if (!$opt) $opt = array();
1139
		$opt['LicenseId'] = $license_id;
1140
		$opt['Capacity'] = $capacity;
1141
 
1142
		return $this->authenticate('DeactivateLicense', $opt);
1143
	}
1144
 
1145
	/**
1146
	 * Deletes a customer gateway. You must delete the VPN connection before deleting the customer
1147
	 * gateway.
1148
	 *
1149
	 * You can have a single active customer gateway per AWS account (active means that you've created
1150
	 * a VPN connection with that customer gateway). AWS might delete any customer gateway you leave
1151
	 * inactive for an extended period of time.
1152
	 *
1153
	 * @param string $customer_gateway_id (Required) The ID of the customer gateway to delete.
1154
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1155
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1156
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1157
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1158
	 */
1159
	public function delete_customer_gateway($customer_gateway_id, $opt = null)
1160
	{
1161
		if (!$opt) $opt = array();
1162
		$opt['CustomerGatewayId'] = $customer_gateway_id;
1163
 
1164
		return $this->authenticate('DeleteCustomerGateway', $opt);
1165
	}
1166
 
1167
	/**
1168
	 * Deletes a set of DHCP options that you specify. Amazon VPC returns an error if the set of
1169
	 * options you specify is currently associated with a VPC. You can disassociate the set of options
1170
	 * by associating either a new set of options or the default options with the VPC.
1171
	 *
1172
	 * @param string $dhcp_options_id (Required) The ID of the DHCP options set to delete.
1173
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1174
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1175
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1176
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1177
	 */
1178
	public function delete_dhcp_options($dhcp_options_id, $opt = null)
1179
	{
1180
		if (!$opt) $opt = array();
1181
		$opt['DhcpOptionsId'] = $dhcp_options_id;
1182
 
1183
		return $this->authenticate('DeleteDhcpOptions', $opt);
1184
	}
1185
 
1186
	/**
1187
	 * Deletes an Internet gateway from your AWS account. The gateway must not be attached to a VPC.
1188
	 * For more information about your VPC and Internet gateway, go to Amazon Virtual Private Cloud
1189
	 * User Guide.
1190
	 *
1191
	 * @param string $internet_gateway_id (Required) The ID of the Internet gateway to be deleted.
1192
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1193
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1194
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1195
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1196
	 */
1197
	public function delete_internet_gateway($internet_gateway_id, $opt = null)
1198
	{
1199
		if (!$opt) $opt = array();
1200
		$opt['InternetGatewayId'] = $internet_gateway_id;
1201
 
1202
		return $this->authenticate('DeleteInternetGateway', $opt);
1203
	}
1204
 
1205
	/**
1206
	 * The DeleteKeyPair operation deletes a key pair.
1207
	 *
1208
	 * @param string $key_name (Required) The name of the Amazon EC2 key pair to delete.
1209
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1210
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1211
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1212
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1213
	 */
1214
	public function delete_key_pair($key_name, $opt = null)
1215
	{
1216
		if (!$opt) $opt = array();
1217
		$opt['KeyName'] = $key_name;
1218
 
1219
		return $this->authenticate('DeleteKeyPair', $opt);
1220
	}
1221
 
1222
	/**
1223
	 * Deletes a network ACL from a VPC. The ACL must not have any subnets associated with it. You
1224
	 * can't delete the default network ACL. For more information about network ACLs, go to Network
1225
	 * ACLs in the Amazon Virtual Private Cloud User Guide.
1226
	 *
1227
	 * @param string $network_acl_id (Required) The ID of the network ACL to be deleted.
1228
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1229
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1230
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1231
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1232
	 */
1233
	public function delete_network_acl($network_acl_id, $opt = null)
1234
	{
1235
		if (!$opt) $opt = array();
1236
		$opt['NetworkAclId'] = $network_acl_id;
1237
 
1238
		return $this->authenticate('DeleteNetworkAcl', $opt);
1239
	}
1240
 
1241
	/**
1242
	 * Deletes an ingress or egress entry (i.e., rule) from a network ACL. For more information about
1243
	 * network ACLs, go to Network ACLs in the Amazon Virtual Private Cloud User Guide.
1244
	 *
1245
	 * @param string $network_acl_id (Required) ID of the network ACL.
1246
	 * @param integer $rule_number (Required) Rule number for the entry to delete.
1247
	 * @param boolean $egress (Required) Whether the rule to delete is an egress rule (<code>true</code>) or ingress rule (<code>false</code>).
1248
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1249
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1250
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1251
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1252
	 */
1253
	public function delete_network_acl_entry($network_acl_id, $rule_number, $egress, $opt = null)
1254
	{
1255
		if (!$opt) $opt = array();
1256
		$opt['NetworkAclId'] = $network_acl_id;
1257
		$opt['RuleNumber'] = $rule_number;
1258
		$opt['Egress'] = $egress;
1259
 
1260
		return $this->authenticate('DeleteNetworkAclEntry', $opt);
1261
	}
1262
 
1263
	/**
1264
	 * Deletes a <code>PlacementGroup</code> from a user's account. Terminate all Amazon EC2 instances
1265
	 * in the placement group before deletion.
1266
	 *
1267
	 * @param string $group_name (Required) The name of the <code>PlacementGroup</code> to delete.
1268
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1269
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1270
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1271
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1272
	 */
1273
	public function delete_placement_group($group_name, $opt = null)
1274
	{
1275
		if (!$opt) $opt = array();
1276
		$opt['GroupName'] = $group_name;
1277
 
1278
		return $this->authenticate('DeletePlacementGroup', $opt);
1279
	}
1280
 
1281
	/**
1282
	 * Deletes a route from a route table in a VPC. For more information about route tables, go to
1283
	 * 	<a href=
1284
	 * "http://docs.amazonwebservices.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html">Route
1285
	 * Tables</a> in the Amazon Virtual Private Cloud User Guide.
1286
	 *
1287
	 * @param string $route_table_id (Required) The ID of the route table where the route will be deleted.
1288
	 * @param string $destination_cidr_block (Required) The CIDR range for the route you want to delete. The value you specify must exactly match the CIDR for the route you want to delete.
1289
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1290
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1291
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1292
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1293
	 */
1294
	public function delete_route($route_table_id, $destination_cidr_block, $opt = null)
1295
	{
1296
		if (!$opt) $opt = array();
1297
		$opt['RouteTableId'] = $route_table_id;
1298
		$opt['DestinationCidrBlock'] = $destination_cidr_block;
1299
 
1300
		return $this->authenticate('DeleteRoute', $opt);
1301
	}
1302
 
1303
	/**
1304
	 * Deletes a route table from a VPC. The route table must not be associated with a subnet. You
1305
	 * can't delete the main route table. For more information about route tables, go to <a href=
1306
	 * "http://docs.amazonwebservices.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html">Route
1307
	 * Tables</a> in the Amazon Virtual Private Cloud User Guide.
1308
	 *
1309
	 * @param string $route_table_id (Required) The ID of the route table to be deleted.
1310
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1311
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1312
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1313
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1314
	 */
1315
	public function delete_route_table($route_table_id, $opt = null)
1316
	{
1317
		if (!$opt) $opt = array();
1318
		$opt['RouteTableId'] = $route_table_id;
1319
 
1320
		return $this->authenticate('DeleteRouteTable', $opt);
1321
	}
1322
 
1323
	/**
1324
	 * The DeleteSecurityGroup operation deletes a security group.
1325
	 *
1326
	 * <p class="note"></p>
1327
	 * If you attempt to delete a security group that contains instances, a fault is returned.
1328
	 *
1329
	 * If you attempt to delete a security group that is referenced by another security group, a fault
1330
	 * is returned. For example, if security group B has a rule that allows access from security group
1331
	 * A, security group A cannot be deleted until the allow rule is removed.
1332
	 *
1333
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1334
	 * 	<li><code>GroupName</code> - <code>string</code> - Optional - The name of the Amazon EC2 security group to delete.</li>
1335
	 * 	<li><code>GroupId</code> - <code>string</code> - Optional - The ID of the Amazon EC2 security group to delete.</li>
1336
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1337
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1338
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1339
	 */
1340
	public function delete_security_group($opt = null)
1341
	{
1342
		if (!$opt) $opt = array();
1343
 
1344
		return $this->authenticate('DeleteSecurityGroup', $opt);
1345
	}
1346
 
1347
	/**
1348
	 * Deletes the snapshot identified by <code>snapshotId</code>.
1349
	 *
1350
	 * @param string $snapshot_id (Required) The ID of the snapshot to delete.
1351
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1352
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1353
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1354
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1355
	 */
1356
	public function delete_snapshot($snapshot_id, $opt = null)
1357
	{
1358
		if (!$opt) $opt = array();
1359
		$opt['SnapshotId'] = $snapshot_id;
1360
 
1361
		return $this->authenticate('DeleteSnapshot', $opt);
1362
	}
1363
 
1364
	/**
1365
	 * Deletes the data feed for Spot Instances.
1366
	 *
1367
	 * For conceptual information about Spot Instances, refer to the <a href=
1368
	 * "http://docs.amazonwebservices.com/AWSEC2/2009-11-30/DeveloperGuide/">Amazon Elastic Compute
1369
	 * Cloud Developer Guide</a> or <a href=
1370
	 * "http://docs.amazonwebservices.com/AWSEC2/2009-11-30/UserGuide/">Amazon Elastic Compute Cloud
1371
	 * User Guide</a>.
1372
	 *
1373
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1374
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1375
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1376
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1377
	 */
1378
	public function delete_spot_datafeed_subscription($opt = null)
1379
	{
1380
		if (!$opt) $opt = array();
1381
 
1382
		return $this->authenticate('DeleteSpotDatafeedSubscription', $opt);
1383
	}
1384
 
1385
	/**
1386
	 * Deletes a subnet from a VPC. You must terminate all running instances in the subnet before
1387
	 * deleting it, otherwise Amazon VPC returns an error.
1388
	 *
1389
	 * @param string $subnet_id (Required) The ID of the subnet you want to delete.
1390
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1391
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1392
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1393
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1394
	 */
1395
	public function delete_subnet($subnet_id, $opt = null)
1396
	{
1397
		if (!$opt) $opt = array();
1398
		$opt['SubnetId'] = $subnet_id;
1399
 
1400
		return $this->authenticate('DeleteSubnet', $opt);
1401
	}
1402
 
1403
	/**
1404
	 * Deletes tags from the specified Amazon EC2 resources.
1405
	 *
1406
	 * @param string|array $resource_id (Required) A list of one or more resource IDs. This could be the ID of an AMI, an instance, an EBS volume, or snapshot, etc. Pass a string for a single value, or an indexed array for multiple values.
1407
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1408
	 * 	<li><code>Tag</code> - <code>array</code> - Optional - The tags to delete from the specified resources. Each tag item consists of a key-value pair. If a tag is specified without a value, the tag and all of its values are deleted. <ul>
1409
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
1410
	 * 			<li><code>Key</code> - <code>string</code> - Optional - The tag's key.</li>
1411
	 * 			<li><code>Value</code> - <code>string</code> - Optional - The tag's value.</li>
1412
	 * 		</ul></li>
1413
	 * 	</ul></li>
1414
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1415
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1416
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1417
	 */
1418
	public function delete_tags($resource_id, $opt = null)
1419
	{
1420
		if (!$opt) $opt = array();
1421
 
1422
		// Required list (non-map)
1423
		$opt = array_merge($opt, CFComplexType::map(array(
1424
			'ResourceId' => (is_array($resource_id) ? $resource_id : array($resource_id))
1425
		)));
1426
 
1427
		// Optional list + map
1428
		if (isset($opt['Tag']))
1429
		{
1430
			$opt = array_merge($opt, CFComplexType::map(array(
1431
				'Tag' => $opt['Tag']
1432
			)));
1433
			unset($opt['Tag']);
1434
		}
1435
 
1436
		return $this->authenticate('DeleteTags', $opt);
1437
	}
1438
 
1439
	/**
1440
	 * Deletes a previously created volume. Once successfully deleted, a new volume can be created
1441
	 * with the same name.
1442
	 *
1443
	 * @param string $volume_id (Required) The ID of the EBS volume to delete.
1444
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1445
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1446
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1447
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1448
	 */
1449
	public function delete_volume($volume_id, $opt = null)
1450
	{
1451
		if (!$opt) $opt = array();
1452
		$opt['VolumeId'] = $volume_id;
1453
 
1454
		return $this->authenticate('DeleteVolume', $opt);
1455
	}
1456
 
1457
	/**
1458
	 * Deletes a VPC. You must detach or delete all gateways or other objects that are dependent on
1459
	 * the VPC first. For example, you must terminate all running instances, delete all VPC security
1460
	 * groups (except the default), delete all the route tables (except the default), etc.
1461
	 *
1462
	 * @param string $vpc_id (Required) The ID of the VPC you want to delete.
1463
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1464
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1465
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1466
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1467
	 */
1468
	public function delete_vpc($vpc_id, $opt = null)
1469
	{
1470
		if (!$opt) $opt = array();
1471
		$opt['VpcId'] = $vpc_id;
1472
 
1473
		return $this->authenticate('DeleteVpc', $opt);
1474
	}
1475
 
1476
	/**
1477
	 * Deletes a VPN connection. Use this if you want to delete a VPC and all its associated
1478
	 * components. Another reason to use this operation is if you believe the tunnel credentials for
1479
	 * your VPN connection have been compromised. In that situation, you can delete the VPN connection
1480
	 * and create a new one that has new keys, without needing to delete the VPC or VPN gateway. If
1481
	 * you create a new VPN connection, you must reconfigure the customer gateway using the new
1482
	 * configuration information returned with the new VPN connection ID.
1483
	 *
1484
	 * If you're deleting the VPC and all its associated parts, we recommend you detach the VPN
1485
	 * gateway from the VPC and delete the VPC before deleting the VPN connection.
1486
	 *
1487
	 * @param string $vpn_connection_id (Required) The ID of the VPN connection to delete
1488
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1489
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1490
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1491
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1492
	 */
1493
	public function delete_vpn_connection($vpn_connection_id, $opt = null)
1494
	{
1495
		if (!$opt) $opt = array();
1496
		$opt['VpnConnectionId'] = $vpn_connection_id;
1497
 
1498
		return $this->authenticate('DeleteVpnConnection', $opt);
1499
	}
1500
 
1501
	/**
1502
	 * Deletes a VPN gateway. Use this when you want to delete a VPC and all its associated components
1503
	 * because you no longer need them. We recommend that before you delete a VPN gateway, you detach
1504
	 * it from the VPC and delete the VPN connection. Note that you don't need to delete the VPN
1505
	 * gateway if you just want to delete and re-create the VPN connection between your VPC and data
1506
	 * center.
1507
	 *
1508
	 * @param string $vpn_gateway_id (Required) The ID of the VPN gateway to delete.
1509
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1510
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1511
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1512
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1513
	 */
1514
	public function delete_vpn_gateway($vpn_gateway_id, $opt = null)
1515
	{
1516
		if (!$opt) $opt = array();
1517
		$opt['VpnGatewayId'] = $vpn_gateway_id;
1518
 
1519
		return $this->authenticate('DeleteVpnGateway', $opt);
1520
	}
1521
 
1522
	/**
1523
	 * The DeregisterImage operation deregisters an AMI. Once deregistered, instances of the AMI can
1524
	 * no longer be launched.
1525
	 *
1526
	 * @param string $image_id (Required) The ID of the AMI to deregister.
1527
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1528
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1529
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1530
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1531
	 */
1532
	public function deregister_image($image_id, $opt = null)
1533
	{
1534
		if (!$opt) $opt = array();
1535
		$opt['ImageId'] = $image_id;
1536
 
1537
		return $this->authenticate('DeregisterImage', $opt);
1538
	}
1539
 
1540
	/**
1541
	 * The DescribeAddresses operation lists elastic IP addresses assigned to your account.
1542
	 *
1543
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1544
	 * 	<li><code>PublicIp</code> - <code>string|array</code> - Optional - The optional list of Elastic IP addresses to describe. Pass a string for a single value, or an indexed array for multiple values.</li>
1545
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for Addresses. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
1546
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
1547
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
1548
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
1549
	 * 		</ul></li>
1550
	 * 	</ul></li>
1551
	 * 	<li><code>AllocationId</code> - <code>string|array</code> - Optional -  Pass a string for a single value, or an indexed array for multiple values.</li>
1552
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1553
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1554
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1555
	 */
1556
	public function describe_addresses($opt = null)
1557
	{
1558
		if (!$opt) $opt = array();
1559
 
1560
		// Optional list (non-map)
1561
		if (isset($opt['PublicIp']))
1562
		{
1563
			$opt = array_merge($opt, CFComplexType::map(array(
1564
				'PublicIp' => (is_array($opt['PublicIp']) ? $opt['PublicIp'] : array($opt['PublicIp']))
1565
			)));
1566
			unset($opt['PublicIp']);
1567
		}
1568
 
1569
		// Optional list + map
1570
		if (isset($opt['Filter']))
1571
		{
1572
			$opt = array_merge($opt, CFComplexType::map(array(
1573
				'Filter' => $opt['Filter']
1574
			)));
1575
			unset($opt['Filter']);
1576
		}
1577
 
1578
		// Optional list (non-map)
1579
		if (isset($opt['AllocationId']))
1580
		{
1581
			$opt = array_merge($opt, CFComplexType::map(array(
1582
				'AllocationId' => (is_array($opt['AllocationId']) ? $opt['AllocationId'] : array($opt['AllocationId']))
1583
			)));
1584
			unset($opt['AllocationId']);
1585
		}
1586
 
1587
		return $this->authenticate('DescribeAddresses', $opt);
1588
	}
1589
 
1590
	/**
1591
	 * The DescribeAvailabilityZones operation describes availability zones that are currently
1592
	 * available to the account and their states.
1593
	 *
1594
	 * Availability zones are not the same across accounts. The availability zone
1595
	 * <code>us-east-1a</code> for account A is not necessarily the same as <code>us-east-1a</code>
1596
	 * for account B. Zone assignments are mapped independently for each account.
1597
	 *
1598
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1599
	 * 	<li><code>ZoneName</code> - <code>string|array</code> - Optional - A list of the availability zone names to describe. Pass a string for a single value, or an indexed array for multiple values.</li>
1600
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for AvailabilityZones. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
1601
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
1602
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
1603
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
1604
	 * 		</ul></li>
1605
	 * 	</ul></li>
1606
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1607
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1608
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1609
	 */
1610
	public function describe_availability_zones($opt = null)
1611
	{
1612
		if (!$opt) $opt = array();
1613
 
1614
		// Optional list (non-map)
1615
		if (isset($opt['ZoneName']))
1616
		{
1617
			$opt = array_merge($opt, CFComplexType::map(array(
1618
				'ZoneName' => (is_array($opt['ZoneName']) ? $opt['ZoneName'] : array($opt['ZoneName']))
1619
			)));
1620
			unset($opt['ZoneName']);
1621
		}
1622
 
1623
		// Optional list + map
1624
		if (isset($opt['Filter']))
1625
		{
1626
			$opt = array_merge($opt, CFComplexType::map(array(
1627
				'Filter' => $opt['Filter']
1628
			)));
1629
			unset($opt['Filter']);
1630
		}
1631
 
1632
		return $this->authenticate('DescribeAvailabilityZones', $opt);
1633
	}
1634
 
1635
	/**
1636
	 * The DescribeBundleTasks operation describes in-progress and recent bundle tasks. Complete and
1637
	 * failed tasks are removed from the list a short time after completion. If no bundle ids are
1638
	 * given, all bundle tasks are returned.
1639
	 *
1640
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1641
	 * 	<li><code>BundleId</code> - <code>string|array</code> - Optional - The list of bundle task IDs to describe. Pass a string for a single value, or an indexed array for multiple values.</li>
1642
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for BundleTasks. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
1643
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
1644
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
1645
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
1646
	 * 		</ul></li>
1647
	 * 	</ul></li>
1648
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1649
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1650
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1651
	 */
1652
	public function describe_bundle_tasks($opt = null)
1653
	{
1654
		if (!$opt) $opt = array();
1655
 
1656
		// Optional list (non-map)
1657
		if (isset($opt['BundleId']))
1658
		{
1659
			$opt = array_merge($opt, CFComplexType::map(array(
1660
				'BundleId' => (is_array($opt['BundleId']) ? $opt['BundleId'] : array($opt['BundleId']))
1661
			)));
1662
			unset($opt['BundleId']);
1663
		}
1664
 
1665
		// Optional list + map
1666
		if (isset($opt['Filter']))
1667
		{
1668
			$opt = array_merge($opt, CFComplexType::map(array(
1669
				'Filter' => $opt['Filter']
1670
			)));
1671
			unset($opt['Filter']);
1672
		}
1673
 
1674
		return $this->authenticate('DescribeBundleTasks', $opt);
1675
	}
1676
 
1677
	/**
1678
	 * Gives you information about your customer gateways. You can filter the results to return
1679
	 * information only about customer gateways that match criteria you specify. For example, you
1680
	 * could ask to get information about a particular customer gateway (or all) only if the gateway's
1681
	 * state is pending or available. You can specify multiple filters (e.g., the customer gateway has
1682
	 * a particular IP address for the Internet-routable external interface, and the gateway's state
1683
	 * is pending or available). The result includes information for a particular customer gateway
1684
	 * only if the gateway matches all your filters. If there's no match, no special message is
1685
	 * returned; the response is simply empty. The following table shows the available filters.
1686
	 *
1687
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1688
	 * 	<li><code>CustomerGatewayId</code> - <code>string|array</code> - Optional - A set of one or more customer gateway IDs. Pass a string for a single value, or an indexed array for multiple values.</li>
1689
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for Customer Gateways. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
1690
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
1691
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
1692
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
1693
	 * 		</ul></li>
1694
	 * 	</ul></li>
1695
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1696
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1697
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1698
	 */
1699
	public function describe_customer_gateways($opt = null)
1700
	{
1701
		if (!$opt) $opt = array();
1702
 
1703
		// Optional list (non-map)
1704
		if (isset($opt['CustomerGatewayId']))
1705
		{
1706
			$opt = array_merge($opt, CFComplexType::map(array(
1707
				'CustomerGatewayId' => (is_array($opt['CustomerGatewayId']) ? $opt['CustomerGatewayId'] : array($opt['CustomerGatewayId']))
1708
			)));
1709
			unset($opt['CustomerGatewayId']);
1710
		}
1711
 
1712
		// Optional list + map
1713
		if (isset($opt['Filter']))
1714
		{
1715
			$opt = array_merge($opt, CFComplexType::map(array(
1716
				'Filter' => $opt['Filter']
1717
			)));
1718
			unset($opt['Filter']);
1719
		}
1720
 
1721
		return $this->authenticate('DescribeCustomerGateways', $opt);
1722
	}
1723
 
1724
	/**
1725
	 * Gives you information about one or more sets of DHCP options. You can specify one or more DHCP
1726
	 * options set IDs, or no IDs (to describe all your sets of DHCP options). The returned
1727
	 * information consists of:
1728
	 *
1729
	 * <ul>
1730
	 * 	<li>The DHCP options set ID</li>
1731
	 * 	<li>The options</li>
1732
	 * </ul>
1733
	 *
1734
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1735
	 * 	<li><code>DhcpOptionsId</code> - <code>string|array</code> - Optional -  Pass a string for a single value, or an indexed array for multiple values.</li>
1736
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for DhcpOptions. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
1737
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
1738
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
1739
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
1740
	 * 		</ul></li>
1741
	 * 	</ul></li>
1742
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1743
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1744
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1745
	 */
1746
	public function describe_dhcp_options($opt = null)
1747
	{
1748
		if (!$opt) $opt = array();
1749
 
1750
		// Optional list (non-map)
1751
		if (isset($opt['DhcpOptionsId']))
1752
		{
1753
			$opt = array_merge($opt, CFComplexType::map(array(
1754
				'DhcpOptionsId' => (is_array($opt['DhcpOptionsId']) ? $opt['DhcpOptionsId'] : array($opt['DhcpOptionsId']))
1755
			)));
1756
			unset($opt['DhcpOptionsId']);
1757
		}
1758
 
1759
		// Optional list + map
1760
		if (isset($opt['Filter']))
1761
		{
1762
			$opt = array_merge($opt, CFComplexType::map(array(
1763
				'Filter' => $opt['Filter']
1764
			)));
1765
			unset($opt['Filter']);
1766
		}
1767
 
1768
		return $this->authenticate('DescribeDhcpOptions', $opt);
1769
	}
1770
 
1771
	/**
1772
	 * The DescribeImageAttribute operation returns information about an attribute of an AMI. Only one
1773
	 * attribute can be specified per call.
1774
	 *
1775
	 * @param string $image_id (Required) The ID of the AMI whose attribute is to be described.
1776
	 * @param string $attribute (Required) The name of the attribute to describe. Available attribute names: <code>productCodes</code>, <code>kernel</code>, <code>ramdisk</code>, <code>launchPermisson</code>, <code>blockDeviceMapping</code>
1777
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1778
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1779
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1780
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1781
	 */
1782
	public function describe_image_attribute($image_id, $attribute, $opt = null)
1783
	{
1784
		if (!$opt) $opt = array();
1785
		$opt['ImageId'] = $image_id;
1786
		$opt['Attribute'] = $attribute;
1787
 
1788
		return $this->authenticate('DescribeImageAttribute', $opt);
1789
	}
1790
 
1791
	/**
1792
	 * The DescribeImages operation returns information about AMIs, AKIs, and ARIs available to the
1793
	 * user. Information returned includes image type, product codes, architecture, and kernel and RAM
1794
	 * disk IDs. Images available to the user include public images available for any user to launch,
1795
	 * private images owned by the user making the request, and private images owned by other users
1796
	 * for which the user has explicit launch permissions.
1797
	 *
1798
	 * Launch permissions fall into three categories:
1799
	 *
1800
	 * <ul>
1801
	 * 	<li><strong>Public:</strong> The owner of the AMI granted launch permissions for the AMI to the
1802
	 * 	all group. All users have launch permissions for these AMIs.</li>
1803
	 * 	<li><strong>Explicit:</strong> The owner of the AMI granted launch permissions to a specific
1804
	 * 	user.</li>
1805
	 * 	<li><strong>Implicit:</strong> A user has implicit launch permissions for all AMIs he or she
1806
	 * 	owns.</li>
1807
	 * </ul>
1808
	 *
1809
	 * The list of AMIs returned can be modified by specifying AMI IDs, AMI owners, or users with
1810
	 * launch permissions. If no options are specified, Amazon EC2 returns all AMIs for which the user
1811
	 * has launch permissions.
1812
	 *
1813
	 * If you specify one or more AMI IDs, only AMIs that have the specified IDs are returned. If you
1814
	 * specify an invalid AMI ID, a fault is returned. If you specify an AMI ID for which you do not
1815
	 * have access, it will not be included in the returned results.
1816
	 *
1817
	 * If you specify one or more AMI owners, only AMIs from the specified owners and for which you
1818
	 * have access are returned. The results can include the account IDs of the specified owners,
1819
	 * amazon for AMIs owned by Amazon or self for AMIs that you own.
1820
	 *
1821
	 * If you specify a list of executable users, only users that have launch permissions for the AMIs
1822
	 * are returned. You can specify account IDs (if you own the AMI(s)), self for AMIs for which you
1823
	 * own or have explicit permissions, or all for public AMIs.
1824
	 *
1825
	 * <p class="note">
1826
	 * Deregistered images are included in the returned results for an unspecified interval after
1827
	 * deregistration.
1828
	 * </p>
1829
	 *
1830
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1831
	 * 	<li><code>ImageId</code> - <code>string|array</code> - Optional - An optional list of the AMI IDs to describe. If not specified, all AMIs will be described. Pass a string for a single value, or an indexed array for multiple values.</li>
1832
	 * 	<li><code>Owner</code> - <code>string|array</code> - Optional - The optional list of owners for the described AMIs. The IDs amazon, self, and explicit can be used to include AMIs owned by Amazon, AMIs owned by the user, and AMIs for which the user has explicit launch permissions, respectively. Pass a string for a single value, or an indexed array for multiple values.</li>
1833
	 * 	<li><code>ExecutableBy</code> - <code>string|array</code> - Optional - The optional list of users with explicit launch permissions for the described AMIs. The user ID can be a user's account ID, 'self' to return AMIs for which the sender of the request has explicit launch permissions, or 'all' to return AMIs with public launch permissions. Pass a string for a single value, or an indexed array for multiple values.</li>
1834
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for Images. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
1835
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
1836
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
1837
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
1838
	 * 		</ul></li>
1839
	 * 	</ul></li>
1840
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1841
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1842
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1843
	 */
1844
	public function describe_images($opt = null)
1845
	{
1846
		if (!$opt) $opt = array();
1847
 
1848
		// Optional list (non-map)
1849
		if (isset($opt['ImageId']))
1850
		{
1851
			$opt = array_merge($opt, CFComplexType::map(array(
1852
				'ImageId' => (is_array($opt['ImageId']) ? $opt['ImageId'] : array($opt['ImageId']))
1853
			)));
1854
			unset($opt['ImageId']);
1855
		}
1856
 
1857
		// Optional list (non-map)
1858
		if (isset($opt['Owner']))
1859
		{
1860
			$opt = array_merge($opt, CFComplexType::map(array(
1861
				'Owner' => (is_array($opt['Owner']) ? $opt['Owner'] : array($opt['Owner']))
1862
			)));
1863
			unset($opt['Owner']);
1864
		}
1865
 
1866
		// Optional list (non-map)
1867
		if (isset($opt['ExecutableBy']))
1868
		{
1869
			$opt = array_merge($opt, CFComplexType::map(array(
1870
				'ExecutableBy' => (is_array($opt['ExecutableBy']) ? $opt['ExecutableBy'] : array($opt['ExecutableBy']))
1871
			)));
1872
			unset($opt['ExecutableBy']);
1873
		}
1874
 
1875
		// Optional list + map
1876
		if (isset($opt['Filter']))
1877
		{
1878
			$opt = array_merge($opt, CFComplexType::map(array(
1879
				'Filter' => $opt['Filter']
1880
			)));
1881
			unset($opt['Filter']);
1882
		}
1883
 
1884
		return $this->authenticate('DescribeImages', $opt);
1885
	}
1886
 
1887
	/**
1888
	 * Returns information about an attribute of an instance. Only one attribute can be specified per
1889
	 * call.
1890
	 *
1891
	 * @param string $instance_id (Required) The ID of the instance whose instance attribute is being described.
1892
	 * @param string $attribute (Required) The name of the attribute to describe. Available attribute names: <code>instanceType</code>, <code>kernel</code>, <code>ramdisk</code>, <code>userData</code>, <code>disableApiTermination</code>, <code>instanceInitiatedShutdownBehavior</code>, <code>rootDeviceName</code>, <code>blockDeviceMapping</code>
1893
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1894
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1895
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1896
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1897
	 */
1898
	public function describe_instance_attribute($instance_id, $attribute, $opt = null)
1899
	{
1900
		if (!$opt) $opt = array();
1901
		$opt['InstanceId'] = $instance_id;
1902
		$opt['Attribute'] = $attribute;
1903
 
1904
		return $this->authenticate('DescribeInstanceAttribute', $opt);
1905
	}
1906
 
1907
	/**
1908
	 * Describes the status of an Amazon Elastic Compute Cloud (Amazon EC2) instance. Instance status
1909
	 * provides information about two types of scheduled events for an instance that may require your
1910
	 * attention:
1911
	 *
1912
	 * <ul>
1913
	 * 	<li>Scheduled Reboot: When Amazon EC2 determines that an instance must be rebooted, the
1914
	 * instance's status will return one of two event codes: <code>system-reboot</code> or
1915
	 * <code>instance-reboot</code>. System reboot commonly occurs if certain maintenance or upgrade
1916
	 * operations require a reboot of the underlying host that supports an instance. Instance reboot
1917
	 * commonly occurs if the instance must be rebooted, rather than the underlying host. Rebooting
1918
	 * events include a scheduled start and end time.</li>
1919
	 * 	<li>Scheduled Retirement: When Amazon EC2 determines that an instance must be shut down, the
1920
	 * instance's status will return an event code called <code>instance-retirement</code>. Retirement
1921
	 * commonly occurs when the underlying host is degraded and must be replaced. Retirement events
1922
	 * include a scheduled start and end time. You're also notified by email if one of your instances
1923
	 * is set to retiring. The email message indicates when your instance will be permanently retired.</li>
1924
	 * </ul>
1925
	 *
1926
	 * If your instance is permanently retired, it will not be restarted. You can avoid retirement by
1927
	 * manually restarting your instance when its event code is <code>instance-retirement</code>. This
1928
	 * ensures that your instance is started on a healthy host.
1929
	 *
1930
	 * <code>DescribeInstanceStatus</code> returns information only for instances in the running
1931
	 * state.
1932
	 *
1933
	 * You can filter the results to return information only about instances that match criteria you
1934
	 * specify. For example, you could get information about instances in a specific Availability
1935
	 * Zone. You can specify multiple values for a filter (e.g., more than one Availability Zone). An
1936
	 * instance must match at least one of the specified values for it to be included in the results.
1937
	 *
1938
	 * You can specify multiple filters. An instance must match all the filters for it to be included
1939
	 * in the results. If there's no match, no special message is returned; the response is simply
1940
	 * empty.
1941
	 *
1942
	 * You can use wildcards with the filter values: <code>*</code> matches zero or more characters,
1943
	 * and <code>?</code> matches exactly one character. You can escape special characters using a
1944
	 * backslash before the character. For example, a value of <code>\*amazon\?\\</code> searches for
1945
	 * the literal string <code>*amazon?\</code>.
1946
	 *
1947
	 * The following filters are available:
1948
	 *
1949
	 * <ul>
1950
	 * 	<li><code>availability-zone</code> - Filter on an instance's availability zone.</li>
1951
	 * 	<li><code>instance-state-name</code> - Filter on the intended state of the instance, e.g.,
1952
	 * 	running.</li>
1953
	 * 	<li><code>instance-state-code</code> - Filter on the intended state code of the instance, e.g.,
1954
	 * 	16.</li>
1955
	 * </ul>
1956
	 *
1957
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
1958
	 * 	<li><code>InstanceId</code> - <code>string|array</code> - Optional - The list of instance IDs. If not specified, all instances are described. Pass a string for a single value, or an indexed array for multiple values.</li>
1959
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - The list of filters to limit returned results. <ul>
1960
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
1961
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
1962
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
1963
	 * 		</ul></li>
1964
	 * 	</ul></li>
1965
	 * 	<li><code>NextToken</code> - <code>string</code> - Optional - A string specifying the next paginated set of results to return.</li>
1966
	 * 	<li><code>MaxResults</code> - <code>integer</code> - Optional - The maximum number of paginated instance items per response.</li>
1967
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
1968
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
1969
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
1970
	 */
1971
	public function describe_instance_status($opt = null)
1972
	{
1973
		if (!$opt) $opt = array();
1974
 
1975
		// Optional list (non-map)
1976
		if (isset($opt['InstanceId']))
1977
		{
1978
			$opt = array_merge($opt, CFComplexType::map(array(
1979
				'InstanceId' => (is_array($opt['InstanceId']) ? $opt['InstanceId'] : array($opt['InstanceId']))
1980
			)));
1981
			unset($opt['InstanceId']);
1982
		}
1983
 
1984
		// Optional list + map
1985
		if (isset($opt['Filter']))
1986
		{
1987
			$opt = array_merge($opt, CFComplexType::map(array(
1988
				'Filter' => $opt['Filter']
1989
			)));
1990
			unset($opt['Filter']);
1991
		}
1992
 
1993
		return $this->authenticate('DescribeInstanceStatus', $opt);
1994
	}
1995
 
1996
	/**
1997
	 * The DescribeInstances operation returns information about instances that you own.
1998
	 *
1999
	 * If you specify one or more instance IDs, Amazon EC2 returns information for those instances. If
2000
	 * you do not specify instance IDs, Amazon EC2 returns information for all relevant instances. If
2001
	 * you specify an invalid instance ID, a fault is returned. If you specify an instance that you do
2002
	 * not own, it will not be included in the returned results.
2003
	 *
2004
	 * Recently terminated instances might appear in the returned results. This interval is usually
2005
	 * less than one hour.
2006
	 *
2007
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2008
	 * 	<li><code>InstanceId</code> - <code>string|array</code> - Optional - An optional list of the instances to describe. Pass a string for a single value, or an indexed array for multiple values.</li>
2009
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for Instances. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/index.html?ApiReference-query-DescribeInstances.html">Amazon EC2 API reference</a>. <ul>
2010
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2011
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2012
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2013
	 * 		</ul></li>
2014
	 * 	</ul></li>
2015
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2016
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2017
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2018
	 */
2019
	public function describe_instances($opt = null)
2020
	{
2021
		if (!$opt) $opt = array();
2022
 
2023
		// Optional list (non-map)
2024
		if (isset($opt['InstanceId']))
2025
		{
2026
			$opt = array_merge($opt, CFComplexType::map(array(
2027
				'InstanceId' => (is_array($opt['InstanceId']) ? $opt['InstanceId'] : array($opt['InstanceId']))
2028
			)));
2029
			unset($opt['InstanceId']);
2030
		}
2031
 
2032
		// Optional list + map
2033
		if (isset($opt['Filter']))
2034
		{
2035
			$opt = array_merge($opt, CFComplexType::map(array(
2036
				'Filter' => $opt['Filter']
2037
			)));
2038
			unset($opt['Filter']);
2039
		}
2040
 
2041
		return $this->authenticate('DescribeInstances', $opt);
2042
	}
2043
 
2044
	/**
2045
	 * Gives you information about your Internet gateways. You can filter the results to return
2046
	 * information only about Internet gateways that match criteria you specify. For example, you
2047
	 * could get information only about gateways with particular tags. The Internet gateway must match
2048
	 * at least one of the specified values for it to be included in the results.
2049
	 *
2050
	 * You can specify multiple filters (e.g., the Internet gateway is attached to a particular VPC
2051
	 * and is tagged with a particular value). The result includes information for a particular
2052
	 * Internet gateway only if the gateway matches all your filters. If there's no match, no special
2053
	 * message is returned; the response is simply empty.
2054
	 *
2055
	 * You can use wildcards with the filter values: an asterisk matches zero or more characters, and
2056
	 * <code>?</code> matches exactly one character. You can escape special characters using a
2057
	 * backslash before the character. For example, a value of <code>\*amazon\?\\</code> searches for
2058
	 * the literal string <code>*amazon?\</code>.
2059
	 *
2060
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2061
	 * 	<li><code>InternetGatewayId</code> - <code>string|array</code> - Optional - One or more Internet gateway IDs. Pass a string for a single value, or an indexed array for multiple values.</li>
2062
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for Internet Gateways. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2063
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2064
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2065
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2066
	 * 		</ul></li>
2067
	 * 	</ul></li>
2068
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2069
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2070
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2071
	 */
2072
	public function describe_internet_gateways($opt = null)
2073
	{
2074
		if (!$opt) $opt = array();
2075
 
2076
		// Optional list (non-map)
2077
		if (isset($opt['InternetGatewayId']))
2078
		{
2079
			$opt = array_merge($opt, CFComplexType::map(array(
2080
				'InternetGatewayId' => (is_array($opt['InternetGatewayId']) ? $opt['InternetGatewayId'] : array($opt['InternetGatewayId']))
2081
			)));
2082
			unset($opt['InternetGatewayId']);
2083
		}
2084
 
2085
		// Optional list + map
2086
		if (isset($opt['Filter']))
2087
		{
2088
			$opt = array_merge($opt, CFComplexType::map(array(
2089
				'Filter' => $opt['Filter']
2090
			)));
2091
			unset($opt['Filter']);
2092
		}
2093
 
2094
		return $this->authenticate('DescribeInternetGateways', $opt);
2095
	}
2096
 
2097
	/**
2098
	 * The DescribeKeyPairs operation returns information about key pairs available to you. If you
2099
	 * specify key pairs, information about those key pairs is returned. Otherwise, information for
2100
	 * all registered key pairs is returned.
2101
	 *
2102
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2103
	 * 	<li><code>KeyName</code> - <code>string|array</code> - Optional - The optional list of key pair names to describe. Pass a string for a single value, or an indexed array for multiple values.</li>
2104
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for KeyPairs. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2105
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2106
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2107
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2108
	 * 		</ul></li>
2109
	 * 	</ul></li>
2110
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2111
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2112
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2113
	 */
2114
	public function describe_key_pairs($opt = null)
2115
	{
2116
		if (!$opt) $opt = array();
2117
 
2118
		// Optional list (non-map)
2119
		if (isset($opt['KeyName']))
2120
		{
2121
			$opt = array_merge($opt, CFComplexType::map(array(
2122
				'KeyName' => (is_array($opt['KeyName']) ? $opt['KeyName'] : array($opt['KeyName']))
2123
			)));
2124
			unset($opt['KeyName']);
2125
		}
2126
 
2127
		// Optional list + map
2128
		if (isset($opt['Filter']))
2129
		{
2130
			$opt = array_merge($opt, CFComplexType::map(array(
2131
				'Filter' => $opt['Filter']
2132
			)));
2133
			unset($opt['Filter']);
2134
		}
2135
 
2136
		return $this->authenticate('DescribeKeyPairs', $opt);
2137
	}
2138
 
2139
	/**
2140
	 * Provides details of a user's registered licenses. Zero or more IDs may be specified on the
2141
	 * call. When one or more license IDs are specified, only data for the specified IDs are returned.
2142
	 *
2143
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2144
	 * 	<li><code>LicenseId</code> - <code>string|array</code> - Optional - Specifies the license registration for which details are to be returned. Pass a string for a single value, or an indexed array for multiple values.</li>
2145
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for Licenses. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2146
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2147
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2148
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2149
	 * 		</ul></li>
2150
	 * 	</ul></li>
2151
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2152
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2153
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2154
	 */
2155
	public function describe_licenses($opt = null)
2156
	{
2157
		if (!$opt) $opt = array();
2158
 
2159
		// Optional list (non-map)
2160
		if (isset($opt['LicenseId']))
2161
		{
2162
			$opt = array_merge($opt, CFComplexType::map(array(
2163
				'LicenseId' => (is_array($opt['LicenseId']) ? $opt['LicenseId'] : array($opt['LicenseId']))
2164
			)));
2165
			unset($opt['LicenseId']);
2166
		}
2167
 
2168
		// Optional list + map
2169
		if (isset($opt['Filter']))
2170
		{
2171
			$opt = array_merge($opt, CFComplexType::map(array(
2172
				'Filter' => $opt['Filter']
2173
			)));
2174
			unset($opt['Filter']);
2175
		}
2176
 
2177
		return $this->authenticate('DescribeLicenses', $opt);
2178
	}
2179
 
2180
	/**
2181
	 * Gives you information about the network ACLs in your VPC. You can filter the results to return
2182
	 * information only about ACLs that match criteria you specify. For example, you could get
2183
	 * information only the ACL associated with a particular subnet. The ACL must match at least one
2184
	 * of the specified values for it to be included in the results.
2185
	 *
2186
	 * You can specify multiple filters (e.g., the ACL is associated with a particular subnet and has
2187
	 * an egress entry that denies traffic to a particular port). The result includes information for
2188
	 * a particular ACL only if it matches all your filters. If there's no match, no special message
2189
	 * is returned; the response is simply empty.
2190
	 *
2191
	 * You can use wildcards with the filter values: an asterisk matches zero or more characters, and
2192
	 * <code>?</code> matches exactly one character. You can escape special characters using a
2193
	 * backslash before the character. For example, a value of <code>\*amazon\?\\</code> searches for
2194
	 * the literal string <code>*amazon?\</code>.
2195
	 *
2196
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2197
	 * 	<li><code>NetworkAclId</code> - <code>string|array</code> - Optional - One or more network ACL IDs. Pass a string for a single value, or an indexed array for multiple values.</li>
2198
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for Network ACLs. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2199
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2200
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2201
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2202
	 * 		</ul></li>
2203
	 * 	</ul></li>
2204
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2205
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2206
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2207
	 */
2208
	public function describe_network_acls($opt = null)
2209
	{
2210
		if (!$opt) $opt = array();
2211
 
2212
		// Optional list (non-map)
2213
		if (isset($opt['NetworkAclId']))
2214
		{
2215
			$opt = array_merge($opt, CFComplexType::map(array(
2216
				'NetworkAclId' => (is_array($opt['NetworkAclId']) ? $opt['NetworkAclId'] : array($opt['NetworkAclId']))
2217
			)));
2218
			unset($opt['NetworkAclId']);
2219
		}
2220
 
2221
		// Optional list + map
2222
		if (isset($opt['Filter']))
2223
		{
2224
			$opt = array_merge($opt, CFComplexType::map(array(
2225
				'Filter' => $opt['Filter']
2226
			)));
2227
			unset($opt['Filter']);
2228
		}
2229
 
2230
		return $this->authenticate('DescribeNetworkAcls', $opt);
2231
	}
2232
 
2233
	/**
2234
	 * Returns information about one or more <code>PlacementGroup</code> instances in a user's
2235
	 * account.
2236
	 *
2237
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2238
	 * 	<li><code>GroupName</code> - <code>string|array</code> - Optional - The name of the <code>PlacementGroup</code>. Pass a string for a single value, or an indexed array for multiple values.</li>
2239
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for Placement Groups. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2240
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2241
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2242
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2243
	 * 		</ul></li>
2244
	 * 	</ul></li>
2245
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2246
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2247
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2248
	 */
2249
	public function describe_placement_groups($opt = null)
2250
	{
2251
		if (!$opt) $opt = array();
2252
 
2253
		// Optional list (non-map)
2254
		if (isset($opt['GroupName']))
2255
		{
2256
			$opt = array_merge($opt, CFComplexType::map(array(
2257
				'GroupName' => (is_array($opt['GroupName']) ? $opt['GroupName'] : array($opt['GroupName']))
2258
			)));
2259
			unset($opt['GroupName']);
2260
		}
2261
 
2262
		// Optional list + map
2263
		if (isset($opt['Filter']))
2264
		{
2265
			$opt = array_merge($opt, CFComplexType::map(array(
2266
				'Filter' => $opt['Filter']
2267
			)));
2268
			unset($opt['Filter']);
2269
		}
2270
 
2271
		return $this->authenticate('DescribePlacementGroups', $opt);
2272
	}
2273
 
2274
	/**
2275
	 * The DescribeRegions operation describes regions zones that are currently available to the
2276
	 * account.
2277
	 *
2278
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2279
	 * 	<li><code>RegionName</code> - <code>string|array</code> - Optional - The optional list of regions to describe. Pass a string for a single value, or an indexed array for multiple values.</li>
2280
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for Regions. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2281
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2282
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2283
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2284
	 * 		</ul></li>
2285
	 * 	</ul></li>
2286
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2287
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2288
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2289
	 */
2290
	public function describe_regions($opt = null)
2291
	{
2292
		if (!$opt) $opt = array();
2293
 
2294
		// Optional list (non-map)
2295
		if (isset($opt['RegionName']))
2296
		{
2297
			$opt = array_merge($opt, CFComplexType::map(array(
2298
				'RegionName' => (is_array($opt['RegionName']) ? $opt['RegionName'] : array($opt['RegionName']))
2299
			)));
2300
			unset($opt['RegionName']);
2301
		}
2302
 
2303
		// Optional list + map
2304
		if (isset($opt['Filter']))
2305
		{
2306
			$opt = array_merge($opt, CFComplexType::map(array(
2307
				'Filter' => $opt['Filter']
2308
			)));
2309
			unset($opt['Filter']);
2310
		}
2311
 
2312
		return $this->authenticate('DescribeRegions', $opt);
2313
	}
2314
 
2315
	/**
2316
	 * The DescribeReservedInstances operation describes Reserved Instances that were purchased for
2317
	 * use with your account.
2318
	 *
2319
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2320
	 * 	<li><code>ReservedInstancesId</code> - <code>string|array</code> - Optional - The optional list of Reserved Instance IDs to describe. Pass a string for a single value, or an indexed array for multiple values.</li>
2321
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for ReservedInstances. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2322
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2323
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2324
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2325
	 * 		</ul></li>
2326
	 * 	</ul></li>
2327
	 * 	<li><code>OfferingType</code> - <code>string</code> - Optional - The Reserved Instance offering type.</li>
2328
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2329
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2330
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2331
	 */
2332
	public function describe_reserved_instances($opt = null)
2333
	{
2334
		if (!$opt) $opt = array();
2335
 
2336
		// Optional list (non-map)
2337
		if (isset($opt['ReservedInstancesId']))
2338
		{
2339
			$opt = array_merge($opt, CFComplexType::map(array(
2340
				'ReservedInstancesId' => (is_array($opt['ReservedInstancesId']) ? $opt['ReservedInstancesId'] : array($opt['ReservedInstancesId']))
2341
			)));
2342
			unset($opt['ReservedInstancesId']);
2343
		}
2344
 
2345
		// Optional list + map
2346
		if (isset($opt['Filter']))
2347
		{
2348
			$opt = array_merge($opt, CFComplexType::map(array(
2349
				'Filter' => $opt['Filter']
2350
			)));
2351
			unset($opt['Filter']);
2352
		}
2353
 
2354
		return $this->authenticate('DescribeReservedInstances', $opt);
2355
	}
2356
 
2357
	/**
2358
	 * The DescribeReservedInstancesOfferings operation describes Reserved Instance offerings that are
2359
	 * available for purchase. With Amazon EC2 Reserved Instances, you purchase the right to launch
2360
	 * Amazon EC2 instances for a period of time (without getting insufficient capacity errors) and
2361
	 * pay a lower usage rate for the actual time used.
2362
	 *
2363
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2364
	 * 	<li><code>ReservedInstancesOfferingId</code> - <code>string|array</code> - Optional - An optional list of the unique IDs of the Reserved Instance offerings to describe. Pass a string for a single value, or an indexed array for multiple values.</li>
2365
	 * 	<li><code>InstanceType</code> - <code>string</code> - Optional - The instance type on which the Reserved Instance can be used. [Allowed values: <code>t1.micro</code>, <code>m1.small</code>, <code>m1.large</code>, <code>m1.xlarge</code>, <code>m2.xlarge</code>, <code>m2.2xlarge</code>, <code>m2.4xlarge</code>, <code>c1.medium</code>, <code>c1.xlarge</code>, <code>cc1.4xlarge</code>, <code>cc2.8xlarge</code>, <code>cg1.4xlarge</code>]</li>
2366
	 * 	<li><code>AvailabilityZone</code> - <code>string</code> - Optional - The Availability Zone in which the Reserved Instance can be used.</li>
2367
	 * 	<li><code>ProductDescription</code> - <code>string</code> - Optional - The Reserved Instance product description.</li>
2368
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for ReservedInstancesOfferings. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2369
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2370
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2371
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2372
	 * 		</ul></li>
2373
	 * 	</ul></li>
2374
	 * 	<li><code>InstanceTenancy</code> - <code>string</code> - Optional - The tenancy of the Reserved Instance offering. A Reserved Instance with tenancy of dedicated will run on single-tenant hardware and can only be launched within a VPC.</li>
2375
	 * 	<li><code>OfferingType</code> - <code>string</code> - Optional - The Reserved Instance offering type.</li>
2376
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2377
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2378
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2379
	 */
2380
	public function describe_reserved_instances_offerings($opt = null)
2381
	{
2382
		if (!$opt) $opt = array();
2383
 
2384
		// Optional list (non-map)
2385
		if (isset($opt['ReservedInstancesOfferingId']))
2386
		{
2387
			$opt = array_merge($opt, CFComplexType::map(array(
2388
				'ReservedInstancesOfferingId' => (is_array($opt['ReservedInstancesOfferingId']) ? $opt['ReservedInstancesOfferingId'] : array($opt['ReservedInstancesOfferingId']))
2389
			)));
2390
			unset($opt['ReservedInstancesOfferingId']);
2391
		}
2392
 
2393
		// Optional list + map
2394
		if (isset($opt['Filter']))
2395
		{
2396
			$opt = array_merge($opt, CFComplexType::map(array(
2397
				'Filter' => $opt['Filter']
2398
			)));
2399
			unset($opt['Filter']);
2400
		}
2401
 
2402
		return $this->authenticate('DescribeReservedInstancesOfferings', $opt);
2403
	}
2404
 
2405
	/**
2406
	 * Gives you information about your route tables. You can filter the results to return information
2407
	 * only about tables that match criteria you specify. For example, you could get information only
2408
	 * about a table associated with a particular subnet. You can specify multiple values for the
2409
	 * filter. The table must match at least one of the specified values for it to be included in the
2410
	 * results.
2411
	 *
2412
	 * You can specify multiple filters (e.g., the table has a particular route, and is associated
2413
	 * with a particular subnet). The result includes information for a particular table only if it
2414
	 * matches all your filters. If there's no match, no special message is returned; the response is
2415
	 * simply empty.
2416
	 *
2417
	 * You can use wildcards with the filter values: an asterisk matches zero or more characters, and
2418
	 * <code>?</code> matches exactly one character. You can escape special characters using a
2419
	 * backslash before the character. For example, a value of <code>\*amazon\?\\</code> searches for
2420
	 * the literal string <code>*amazon?\</code>.
2421
	 *
2422
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2423
	 * 	<li><code>RouteTableId</code> - <code>string|array</code> - Optional - One or more route table IDs. Pass a string for a single value, or an indexed array for multiple values.</li>
2424
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for Route Tables. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2425
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2426
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2427
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2428
	 * 		</ul></li>
2429
	 * 	</ul></li>
2430
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2431
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2432
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2433
	 */
2434
	public function describe_route_tables($opt = null)
2435
	{
2436
		if (!$opt) $opt = array();
2437
 
2438
		// Optional list (non-map)
2439
		if (isset($opt['RouteTableId']))
2440
		{
2441
			$opt = array_merge($opt, CFComplexType::map(array(
2442
				'RouteTableId' => (is_array($opt['RouteTableId']) ? $opt['RouteTableId'] : array($opt['RouteTableId']))
2443
			)));
2444
			unset($opt['RouteTableId']);
2445
		}
2446
 
2447
		// Optional list + map
2448
		if (isset($opt['Filter']))
2449
		{
2450
			$opt = array_merge($opt, CFComplexType::map(array(
2451
				'Filter' => $opt['Filter']
2452
			)));
2453
			unset($opt['Filter']);
2454
		}
2455
 
2456
		return $this->authenticate('DescribeRouteTables', $opt);
2457
	}
2458
 
2459
	/**
2460
	 * The DescribeSecurityGroups operation returns information about security groups that you own.
2461
	 *
2462
	 * If you specify security group names, information about those security group is returned.
2463
	 * Otherwise, information for all security group is returned. If you specify a group that does not
2464
	 * exist, a fault is returned.
2465
	 *
2466
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2467
	 * 	<li><code>GroupName</code> - <code>string|array</code> - Optional - The optional list of Amazon EC2 security groups to describe. Pass a string for a single value, or an indexed array for multiple values.</li>
2468
	 * 	<li><code>GroupId</code> - <code>string|array</code> - Optional -  Pass a string for a single value, or an indexed array for multiple values.</li>
2469
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for SecurityGroups. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2470
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2471
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2472
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2473
	 * 		</ul></li>
2474
	 * 	</ul></li>
2475
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2476
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2477
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2478
	 */
2479
	public function describe_security_groups($opt = null)
2480
	{
2481
		if (!$opt) $opt = array();
2482
 
2483
		// Optional list (non-map)
2484
		if (isset($opt['GroupName']))
2485
		{
2486
			$opt = array_merge($opt, CFComplexType::map(array(
2487
				'GroupName' => (is_array($opt['GroupName']) ? $opt['GroupName'] : array($opt['GroupName']))
2488
			)));
2489
			unset($opt['GroupName']);
2490
		}
2491
 
2492
		// Optional list (non-map)
2493
		if (isset($opt['GroupId']))
2494
		{
2495
			$opt = array_merge($opt, CFComplexType::map(array(
2496
				'GroupId' => (is_array($opt['GroupId']) ? $opt['GroupId'] : array($opt['GroupId']))
2497
			)));
2498
			unset($opt['GroupId']);
2499
		}
2500
 
2501
		// Optional list + map
2502
		if (isset($opt['Filter']))
2503
		{
2504
			$opt = array_merge($opt, CFComplexType::map(array(
2505
				'Filter' => $opt['Filter']
2506
			)));
2507
			unset($opt['Filter']);
2508
		}
2509
 
2510
		return $this->authenticate('DescribeSecurityGroups', $opt);
2511
	}
2512
 
2513
	/**
2514
	 * Returns information about an attribute of a snapshot. Only one attribute can be specified per
2515
	 * call.
2516
	 *
2517
	 * @param string $snapshot_id (Required) The ID of the EBS snapshot whose attribute is being described.
2518
	 * @param string $attribute (Required) The name of the EBS attribute to describe. Available attribute names: createVolumePermission
2519
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2520
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2521
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2522
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2523
	 */
2524
	public function describe_snapshot_attribute($snapshot_id, $attribute, $opt = null)
2525
	{
2526
		if (!$opt) $opt = array();
2527
		$opt['SnapshotId'] = $snapshot_id;
2528
		$opt['Attribute'] = $attribute;
2529
 
2530
		return $this->authenticate('DescribeSnapshotAttribute', $opt);
2531
	}
2532
 
2533
	/**
2534
	 * Returns information about the Amazon EBS snapshots available to you. Snapshots available to you
2535
	 * include public snapshots available for any AWS account to launch, private snapshots you own,
2536
	 * and private snapshots owned by another AWS account but for which you've been given explicit
2537
	 * create volume permissions.
2538
	 *
2539
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2540
	 * 	<li><code>SnapshotId</code> - <code>string|array</code> - Optional - The optional list of EBS snapshot IDs to describe. Pass a string for a single value, or an indexed array for multiple values.</li>
2541
	 * 	<li><code>Owner</code> - <code>string|array</code> - Optional - The optional list of EBS snapshot owners. Pass a string for a single value, or an indexed array for multiple values.</li>
2542
	 * 	<li><code>RestorableBy</code> - <code>string|array</code> - Optional - The optional list of users who have permission to create volumes from the described EBS snapshots. Pass a string for a single value, or an indexed array for multiple values.</li>
2543
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for Snapshots. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2544
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2545
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2546
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2547
	 * 		</ul></li>
2548
	 * 	</ul></li>
2549
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2550
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2551
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2552
	 */
2553
	public function describe_snapshots($opt = null)
2554
	{
2555
		if (!$opt) $opt = array();
2556
 
2557
		// Optional list (non-map)
2558
		if (isset($opt['SnapshotId']))
2559
		{
2560
			$opt = array_merge($opt, CFComplexType::map(array(
2561
				'SnapshotId' => (is_array($opt['SnapshotId']) ? $opt['SnapshotId'] : array($opt['SnapshotId']))
2562
			)));
2563
			unset($opt['SnapshotId']);
2564
		}
2565
 
2566
		// Optional list (non-map)
2567
		if (isset($opt['Owner']))
2568
		{
2569
			$opt = array_merge($opt, CFComplexType::map(array(
2570
				'Owner' => (is_array($opt['Owner']) ? $opt['Owner'] : array($opt['Owner']))
2571
			)));
2572
			unset($opt['Owner']);
2573
		}
2574
 
2575
		// Optional list (non-map)
2576
		if (isset($opt['RestorableBy']))
2577
		{
2578
			$opt = array_merge($opt, CFComplexType::map(array(
2579
				'RestorableBy' => (is_array($opt['RestorableBy']) ? $opt['RestorableBy'] : array($opt['RestorableBy']))
2580
			)));
2581
			unset($opt['RestorableBy']);
2582
		}
2583
 
2584
		// Optional list + map
2585
		if (isset($opt['Filter']))
2586
		{
2587
			$opt = array_merge($opt, CFComplexType::map(array(
2588
				'Filter' => $opt['Filter']
2589
			)));
2590
			unset($opt['Filter']);
2591
		}
2592
 
2593
		return $this->authenticate('DescribeSnapshots', $opt);
2594
	}
2595
 
2596
	/**
2597
	 * Describes the data feed for Spot Instances.
2598
	 *
2599
	 * For conceptual information about Spot Instances, refer to the <a href=
2600
	 * "http://docs.amazonwebservices.com/AWSEC2/2009-11-30/DeveloperGuide/">Amazon Elastic Compute
2601
	 * Cloud Developer Guide</a> or <a href=
2602
	 * "http://docs.amazonwebservices.com/AWSEC2/2009-11-30/UserGuide/">Amazon Elastic Compute Cloud
2603
	 * User Guide</a>.
2604
	 *
2605
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2606
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2607
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2608
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2609
	 */
2610
	public function describe_spot_datafeed_subscription($opt = null)
2611
	{
2612
		if (!$opt) $opt = array();
2613
 
2614
		return $this->authenticate('DescribeSpotDatafeedSubscription', $opt);
2615
	}
2616
 
2617
	/**
2618
	 * Describes Spot Instance requests. Spot Instances are instances that Amazon EC2 starts on your
2619
	 * behalf when the maximum price that you specify exceeds the current Spot Price. Amazon EC2
2620
	 * periodically sets the Spot Price based on available Spot Instance capacity and current spot
2621
	 * instance requests. For conceptual information about Spot Instances, refer to the <a href=
2622
	 * "http://docs.amazonwebservices.com/AWSEC2/2010-08-31/DeveloperGuide/">Amazon Elastic Compute
2623
	 * Cloud Developer Guide</a> or <a href=
2624
	 * "http://docs.amazonwebservices.com/AWSEC2/2010-08-31/UserGuide/">Amazon Elastic Compute Cloud
2625
	 * User Guide</a>.
2626
	 *
2627
	 * You can filter the results to return information only about Spot Instance requests that match
2628
	 * criteria you specify. For example, you could get information about requests where the Spot
2629
	 * Price you specified is a certain value (you can't use greater than or less than comparison, but
2630
	 * you can use <code>*</code> and <code>?</code> wildcards). You can specify multiple values for a
2631
	 * filter. A Spot Instance request must match at least one of the specified values for it to be
2632
	 * included in the results.
2633
	 *
2634
	 * You can specify multiple filters (e.g., the Spot Price is equal to a particular value, and the
2635
	 * instance type is <code>m1.small</code>). The result includes information for a particular
2636
	 * request only if it matches all your filters. If there's no match, no special message is
2637
	 * returned; the response is simply empty.
2638
	 *
2639
	 * You can use wildcards with the filter values: an asterisk matches zero or more characters, and
2640
	 * <code>?</code> matches exactly one character. You can escape special characters using a
2641
	 * backslash before the character. For example, a value of <code>\*amazon\?\\</code> searches for
2642
	 * the literal string <code>*amazon?\</code>.
2643
	 *
2644
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2645
	 * 	<li><code>SpotInstanceRequestId</code> - <code>string|array</code> - Optional - The ID of the request. Pass a string for a single value, or an indexed array for multiple values.</li>
2646
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for SpotInstances. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2647
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2648
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2649
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2650
	 * 		</ul></li>
2651
	 * 	</ul></li>
2652
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2653
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2654
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2655
	 */
2656
	public function describe_spot_instance_requests($opt = null)
2657
	{
2658
		if (!$opt) $opt = array();
2659
 
2660
		// Optional list (non-map)
2661
		if (isset($opt['SpotInstanceRequestId']))
2662
		{
2663
			$opt = array_merge($opt, CFComplexType::map(array(
2664
				'SpotInstanceRequestId' => (is_array($opt['SpotInstanceRequestId']) ? $opt['SpotInstanceRequestId'] : array($opt['SpotInstanceRequestId']))
2665
			)));
2666
			unset($opt['SpotInstanceRequestId']);
2667
		}
2668
 
2669
		// Optional list + map
2670
		if (isset($opt['Filter']))
2671
		{
2672
			$opt = array_merge($opt, CFComplexType::map(array(
2673
				'Filter' => $opt['Filter']
2674
			)));
2675
			unset($opt['Filter']);
2676
		}
2677
 
2678
		return $this->authenticate('DescribeSpotInstanceRequests', $opt);
2679
	}
2680
 
2681
	/**
2682
	 * Describes the Spot Price history.
2683
	 *
2684
	 * Spot Instances are instances that Amazon EC2 starts on your behalf when the maximum price that
2685
	 * you specify exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price based
2686
	 * on available Spot Instance capacity and current spot instance requests.
2687
	 *
2688
	 * For conceptual information about Spot Instances, refer to the <a href=
2689
	 * "http://docs.amazonwebservices.com/AWSEC2/2009-11-30/DeveloperGuide/">Amazon Elastic Compute
2690
	 * Cloud Developer Guide</a> or <a href=
2691
	 * "http://docs.amazonwebservices.com/AWSEC2/2009-11-30/UserGuide/">Amazon Elastic Compute Cloud
2692
	 * User Guide</a>.
2693
	 *
2694
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2695
	 * 	<li><code>StartTime</code> - <code>string</code> - Optional - The start date and time of the Spot Instance price history data. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
2696
	 * 	<li><code>EndTime</code> - <code>string</code> - Optional - The end date and time of the Spot Instance price history data. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
2697
	 * 	<li><code>InstanceType</code> - <code>string|array</code> - Optional - Specifies the instance type to return. Pass a string for a single value, or an indexed array for multiple values.</li>
2698
	 * 	<li><code>ProductDescription</code> - <code>string|array</code> - Optional - The description of the AMI. Pass a string for a single value, or an indexed array for multiple values.</li>
2699
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for SpotPriceHistory. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2700
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2701
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2702
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2703
	 * 		</ul></li>
2704
	 * 	</ul></li>
2705
	 * 	<li><code>AvailabilityZone</code> - <code>string</code> - Optional - Filters the results by availability zone (ex: 'us-east-1a').</li>
2706
	 * 	<li><code>MaxResults</code> - <code>integer</code> - Optional - Specifies the number of rows to return.</li>
2707
	 * 	<li><code>NextToken</code> - <code>string</code> - Optional - Specifies the next set of rows to return.</li>
2708
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2709
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2710
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2711
	 */
2712
	public function describe_spot_price_history($opt = null)
2713
	{
2714
		if (!$opt) $opt = array();
2715
 
2716
		// Optional DateTime
2717
		if (isset($opt['StartTime']))
2718
		{
2719
			$opt['StartTime'] = $this->util->convert_date_to_iso8601($opt['StartTime']);
2720
		}
2721
 
2722
		// Optional DateTime
2723
		if (isset($opt['EndTime']))
2724
		{
2725
			$opt['EndTime'] = $this->util->convert_date_to_iso8601($opt['EndTime']);
2726
		}
2727
 
2728
		// Optional list (non-map)
2729
		if (isset($opt['InstanceType']))
2730
		{
2731
			$opt = array_merge($opt, CFComplexType::map(array(
2732
				'InstanceType' => (is_array($opt['InstanceType']) ? $opt['InstanceType'] : array($opt['InstanceType']))
2733
			)));
2734
			unset($opt['InstanceType']);
2735
		}
2736
 
2737
		// Optional list (non-map)
2738
		if (isset($opt['ProductDescription']))
2739
		{
2740
			$opt = array_merge($opt, CFComplexType::map(array(
2741
				'ProductDescription' => (is_array($opt['ProductDescription']) ? $opt['ProductDescription'] : array($opt['ProductDescription']))
2742
			)));
2743
			unset($opt['ProductDescription']);
2744
		}
2745
 
2746
		// Optional list + map
2747
		if (isset($opt['Filter']))
2748
		{
2749
			$opt = array_merge($opt, CFComplexType::map(array(
2750
				'Filter' => $opt['Filter']
2751
			)));
2752
			unset($opt['Filter']);
2753
		}
2754
 
2755
		return $this->authenticate('DescribeSpotPriceHistory', $opt);
2756
	}
2757
 
2758
	/**
2759
	 * Gives you information about your subnets. You can filter the results to return information only
2760
	 * about subnets that match criteria you specify.
2761
	 *
2762
	 * For example, you could ask to get information about a particular subnet (or all) only if the
2763
	 * subnet's state is available. You can specify multiple filters (e.g., the subnet is in a
2764
	 * particular VPC, and the subnet's state is available).
2765
	 *
2766
	 * The result includes information for a particular subnet only if the subnet matches all your
2767
	 * filters. If there's no match, no special message is returned; the response is simply empty. The
2768
	 * following table shows the available filters.
2769
	 *
2770
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2771
	 * 	<li><code>SubnetId</code> - <code>string|array</code> - Optional - A set of one or more subnet IDs. Pass a string for a single value, or an indexed array for multiple values.</li>
2772
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for Subnets. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2773
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2774
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2775
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2776
	 * 		</ul></li>
2777
	 * 	</ul></li>
2778
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2779
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2780
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2781
	 */
2782
	public function describe_subnets($opt = null)
2783
	{
2784
		if (!$opt) $opt = array();
2785
 
2786
		// Optional list (non-map)
2787
		if (isset($opt['SubnetId']))
2788
		{
2789
			$opt = array_merge($opt, CFComplexType::map(array(
2790
				'SubnetId' => (is_array($opt['SubnetId']) ? $opt['SubnetId'] : array($opt['SubnetId']))
2791
			)));
2792
			unset($opt['SubnetId']);
2793
		}
2794
 
2795
		// Optional list + map
2796
		if (isset($opt['Filter']))
2797
		{
2798
			$opt = array_merge($opt, CFComplexType::map(array(
2799
				'Filter' => $opt['Filter']
2800
			)));
2801
			unset($opt['Filter']);
2802
		}
2803
 
2804
		return $this->authenticate('DescribeSubnets', $opt);
2805
	}
2806
 
2807
	/**
2808
	 * Describes the tags for the specified resources.
2809
	 *
2810
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2811
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for tags. <ul>
2812
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2813
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2814
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2815
	 * 		</ul></li>
2816
	 * 	</ul></li>
2817
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2818
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2819
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2820
	 */
2821
	public function describe_tags($opt = null)
2822
	{
2823
		if (!$opt) $opt = array();
2824
 
2825
		// Optional list + map
2826
		if (isset($opt['Filter']))
2827
		{
2828
			$opt = array_merge($opt, CFComplexType::map(array(
2829
				'Filter' => $opt['Filter']
2830
			)));
2831
			unset($opt['Filter']);
2832
		}
2833
 
2834
		return $this->authenticate('DescribeTags', $opt);
2835
	}
2836
 
2837
	/**
2838
	 * Describes the status of the indicated volume or, in lieu of any specified, all volumes
2839
	 * belonging to the caller. Volumes that have been deleted are not described.
2840
	 *
2841
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2842
	 * 	<li><code>VolumeId</code> - <code>string|array</code> - Optional - The optional list of EBS volumes to describe. Pass a string for a single value, or an indexed array for multiple values.</li>
2843
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for Volumes. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2844
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2845
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2846
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2847
	 * 		</ul></li>
2848
	 * 	</ul></li>
2849
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2850
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2851
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2852
	 */
2853
	public function describe_volumes($opt = null)
2854
	{
2855
		if (!$opt) $opt = array();
2856
 
2857
		// Optional list (non-map)
2858
		if (isset($opt['VolumeId']))
2859
		{
2860
			$opt = array_merge($opt, CFComplexType::map(array(
2861
				'VolumeId' => (is_array($opt['VolumeId']) ? $opt['VolumeId'] : array($opt['VolumeId']))
2862
			)));
2863
			unset($opt['VolumeId']);
2864
		}
2865
 
2866
		// Optional list + map
2867
		if (isset($opt['Filter']))
2868
		{
2869
			$opt = array_merge($opt, CFComplexType::map(array(
2870
				'Filter' => $opt['Filter']
2871
			)));
2872
			unset($opt['Filter']);
2873
		}
2874
 
2875
		return $this->authenticate('DescribeVolumes', $opt);
2876
	}
2877
 
2878
	/**
2879
	 * Gives you information about your VPCs. You can filter the results to return information only
2880
	 * about VPCs that match criteria you specify.
2881
	 *
2882
	 * For example, you could ask to get information about a particular VPC or VPCs (or all your VPCs)
2883
	 * only if the VPC's state is available. You can specify multiple filters (e.g., the VPC uses one
2884
	 * of several sets of DHCP options, and the VPC's state is available). The result includes
2885
	 * information for a particular VPC only if the VPC matches all your filters.
2886
	 *
2887
	 * If there's no match, no special message is returned; the response is simply empty. The
2888
	 * following table shows the available filters.
2889
	 *
2890
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2891
	 * 	<li><code>VpcId</code> - <code>string|array</code> - Optional - The ID of a VPC you want information about. Pass a string for a single value, or an indexed array for multiple values.</li>
2892
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for VPCs. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2893
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2894
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2895
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2896
	 * 		</ul></li>
2897
	 * 	</ul></li>
2898
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2899
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2900
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2901
	 */
2902
	public function describe_vpcs($opt = null)
2903
	{
2904
		if (!$opt) $opt = array();
2905
 
2906
		// Optional list (non-map)
2907
		if (isset($opt['VpcId']))
2908
		{
2909
			$opt = array_merge($opt, CFComplexType::map(array(
2910
				'VpcId' => (is_array($opt['VpcId']) ? $opt['VpcId'] : array($opt['VpcId']))
2911
			)));
2912
			unset($opt['VpcId']);
2913
		}
2914
 
2915
		// Optional list + map
2916
		if (isset($opt['Filter']))
2917
		{
2918
			$opt = array_merge($opt, CFComplexType::map(array(
2919
				'Filter' => $opt['Filter']
2920
			)));
2921
			unset($opt['Filter']);
2922
		}
2923
 
2924
		return $this->authenticate('DescribeVpcs', $opt);
2925
	}
2926
 
2927
	/**
2928
	 * Gives you information about your VPN connections.
2929
	 *
2930
	 * <p class="important"></p>
2931
	 * We strongly recommend you use HTTPS when calling this operation because the response contains
2932
	 * sensitive cryptographic information for configuring your customer gateway.
2933
	 *
2934
	 * You can filter the results to return information only about VPN connections that match criteria
2935
	 * you specify. For example, you could ask to get information about a particular VPN connection
2936
	 * (or all) only if the VPN's state is pending or available. You can specify multiple filters
2937
	 * (e.g., the VPN connection is associated with a particular VPN gateway, and the gateway's state
2938
	 * is pending or available). The result includes information for a particular VPN connection only
2939
	 * if the VPN connection matches all your filters. If there's no match, no special message is
2940
	 * returned; the response is simply empty. The following table shows the available filters.
2941
	 *
2942
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2943
	 * 	<li><code>VpnConnectionId</code> - <code>string|array</code> - Optional - A VPN connection ID. More than one may be specified per request. Pass a string for a single value, or an indexed array for multiple values.</li>
2944
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for VPN Connections. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2945
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2946
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2947
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2948
	 * 		</ul></li>
2949
	 * 	</ul></li>
2950
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
2951
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
2952
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
2953
	 */
2954
	public function describe_vpn_connections($opt = null)
2955
	{
2956
		if (!$opt) $opt = array();
2957
 
2958
		// Optional list (non-map)
2959
		if (isset($opt['VpnConnectionId']))
2960
		{
2961
			$opt = array_merge($opt, CFComplexType::map(array(
2962
				'VpnConnectionId' => (is_array($opt['VpnConnectionId']) ? $opt['VpnConnectionId'] : array($opt['VpnConnectionId']))
2963
			)));
2964
			unset($opt['VpnConnectionId']);
2965
		}
2966
 
2967
		// Optional list + map
2968
		if (isset($opt['Filter']))
2969
		{
2970
			$opt = array_merge($opt, CFComplexType::map(array(
2971
				'Filter' => $opt['Filter']
2972
			)));
2973
			unset($opt['Filter']);
2974
		}
2975
 
2976
		return $this->authenticate('DescribeVpnConnections', $opt);
2977
	}
2978
 
2979
	/**
2980
	 * Gives you information about your VPN gateways. You can filter the results to return information
2981
	 * only about VPN gateways that match criteria you specify.
2982
	 *
2983
	 * For example, you could ask to get information about a particular VPN gateway (or all) only if
2984
	 * the gateway's state is pending or available. You can specify multiple filters (e.g., the VPN
2985
	 * gateway is in a particular Availability Zone and the gateway's state is pending or available).
2986
	 *
2987
	 * The result includes information for a particular VPN gateway only if the gateway matches all
2988
	 * your filters. If there's no match, no special message is returned; the response is simply
2989
	 * empty. The following table shows the available filters.
2990
	 *
2991
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
2992
	 * 	<li><code>VpnGatewayId</code> - <code>string|array</code> - Optional - A list of filters used to match properties for VPN Gateways. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. Pass a string for a single value, or an indexed array for multiple values.</li>
2993
	 * 	<li><code>Filter</code> - <code>array</code> - Optional - A list of filters used to match properties for VPN Gateways. For a complete reference to the available filter keys for this operation, see the <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/">Amazon EC2 API reference</a>. <ul>
2994
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
2995
	 * 			<li><code>Name</code> - <code>string</code> - Optional - Specifies the name of the filter.</li>
2996
	 * 			<li><code>Value</code> - <code>string|array</code> - Optional - Contains one or more values for the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
2997
	 * 		</ul></li>
2998
	 * 	</ul></li>
2999
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3000
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3001
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3002
	 */
3003
	public function describe_vpn_gateways($opt = null)
3004
	{
3005
		if (!$opt) $opt = array();
3006
 
3007
		// Optional list (non-map)
3008
		if (isset($opt['VpnGatewayId']))
3009
		{
3010
			$opt = array_merge($opt, CFComplexType::map(array(
3011
				'VpnGatewayId' => (is_array($opt['VpnGatewayId']) ? $opt['VpnGatewayId'] : array($opt['VpnGatewayId']))
3012
			)));
3013
			unset($opt['VpnGatewayId']);
3014
		}
3015
 
3016
		// Optional list + map
3017
		if (isset($opt['Filter']))
3018
		{
3019
			$opt = array_merge($opt, CFComplexType::map(array(
3020
				'Filter' => $opt['Filter']
3021
			)));
3022
			unset($opt['Filter']);
3023
		}
3024
 
3025
		return $this->authenticate('DescribeVpnGateways', $opt);
3026
	}
3027
 
3028
	/**
3029
	 * Detaches an Internet gateway from a VPC, disabling connectivity between the Internet and the
3030
	 * VPC. The VPC must not contain any running instances with elastic IP addresses. For more
3031
	 * information about your VPC and Internet gateway, go to Amazon Virtual Private Cloud User Guide.
3032
	 *
3033
	 * For more information about Amazon Virtual Private Cloud and Internet gateways, go to the Amazon
3034
	 * Virtual Private Cloud User Guide.
3035
	 *
3036
	 * @param string $internet_gateway_id (Required) The ID of the Internet gateway to detach.
3037
	 * @param string $vpc_id (Required) The ID of the VPC.
3038
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3039
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3040
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3041
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3042
	 */
3043
	public function detach_internet_gateway($internet_gateway_id, $vpc_id, $opt = null)
3044
	{
3045
		if (!$opt) $opt = array();
3046
		$opt['InternetGatewayId'] = $internet_gateway_id;
3047
		$opt['VpcId'] = $vpc_id;
3048
 
3049
		return $this->authenticate('DetachInternetGateway', $opt);
3050
	}
3051
 
3052
	/**
3053
	 * Detach a previously attached volume from a running instance.
3054
	 *
3055
	 * @param string $volume_id (Required) The ID of the volume to detach.
3056
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3057
	 * 	<li><code>InstanceId</code> - <code>string</code> - Optional - The ID of the instance from which to detach the the specified volume.</li>
3058
	 * 	<li><code>Device</code> - <code>string</code> - Optional - The device name to which the volume is attached on the specified instance.</li>
3059
	 * 	<li><code>Force</code> - <code>boolean</code> - Optional - Forces detachment if the previous detachment attempt did not occur cleanly (logging into an instance, unmounting the volume, and detaching normally). This option can lead to data loss or a corrupted file system. Use this option only as a last resort to detach a volume from a failed instance. The instance will not have an opportunity to flush file system caches nor file system meta data. If you use this option, you must perform file system check and repair procedures.</li>
3060
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3061
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3062
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3063
	 */
3064
	public function detach_volume($volume_id, $opt = null)
3065
	{
3066
		if (!$opt) $opt = array();
3067
		$opt['VolumeId'] = $volume_id;
3068
 
3069
		return $this->authenticate('DetachVolume', $opt);
3070
	}
3071
 
3072
	/**
3073
	 * Detaches a VPN gateway from a VPC. You do this if you're planning to turn off the VPC and not
3074
	 * use it anymore. You can confirm a VPN gateway has been completely detached from a VPC by
3075
	 * describing the VPN gateway (any attachments to the VPN gateway are also described).
3076
	 *
3077
	 * You must wait for the attachment's state to switch to detached before you can delete the VPC or
3078
	 * attach a different VPC to the VPN gateway.
3079
	 *
3080
	 * @param string $vpn_gateway_id (Required) The ID of the VPN gateway to detach from the VPC.
3081
	 * @param string $vpc_id (Required) The ID of the VPC to detach the VPN gateway from.
3082
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3083
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3084
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3085
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3086
	 */
3087
	public function detach_vpn_gateway($vpn_gateway_id, $vpc_id, $opt = null)
3088
	{
3089
		if (!$opt) $opt = array();
3090
		$opt['VpnGatewayId'] = $vpn_gateway_id;
3091
		$opt['VpcId'] = $vpc_id;
3092
 
3093
		return $this->authenticate('DetachVpnGateway', $opt);
3094
	}
3095
 
3096
	/**
3097
	 * The DisassociateAddress operation disassociates the specified elastic IP address from the
3098
	 * instance to which it is assigned. This is an idempotent operation. If you enter it more than
3099
	 * once, Amazon EC2 does not return an error.
3100
	 *
3101
	 * @param string $public_ip (Required) The elastic IP address that you are disassociating from the instance.
3102
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3103
	 * 	<li><code>AssociationId</code> - <code>string</code> - Optional - Association ID corresponding to the VPC elastic IP address you want to disassociate.</li>
3104
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3105
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3106
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3107
	 */
3108
	public function disassociate_address($public_ip, $opt = null)
3109
	{
3110
		if (!$opt) $opt = array();
3111
		$opt['PublicIp'] = $public_ip;
3112
 
3113
		return $this->authenticate('DisassociateAddress', $opt);
3114
	}
3115
 
3116
	/**
3117
	 * Disassociates a subnet from a route table.
3118
	 *
3119
	 * After you perform this action, the subnet no longer uses the routes in the route table. Instead
3120
	 * it uses the routes in the VPC's main route table. For more information about route tables, go
3121
	 * to <a href=
3122
	 * "http://docs.amazonwebservices.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html">Route
3123
	 * Tables</a> in the Amazon Virtual Private Cloud User Guide.
3124
	 *
3125
	 * @param string $association_id (Required) The association ID representing the current association between the route table and subnet.
3126
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3127
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3128
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3129
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3130
	 */
3131
	public function disassociate_route_table($association_id, $opt = null)
3132
	{
3133
		if (!$opt) $opt = array();
3134
		$opt['AssociationId'] = $association_id;
3135
 
3136
		return $this->authenticate('DisassociateRouteTable', $opt);
3137
	}
3138
 
3139
	/**
3140
	 * The GetConsoleOutput operation retrieves console output for the specified instance.
3141
	 *
3142
	 * Instance console output is buffered and posted shortly after instance boot, reboot, and
3143
	 * termination. Amazon EC2 preserves the most recent 64 KB output which will be available for at least
3144
	 * one hour after the most recent post.
3145
	 *
3146
	 * @param string $instance_id (Required) The ID of the instance for which you want console output.
3147
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3148
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3149
	 *  <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This is useful for manually-managed batch requests.</li></ul>
3150
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response. The value of <code>output</code> is automatically Base64-decoded.
3151
	 */
3152
	public function get_console_output($instance_id, $opt = null)
3153
	{
3154
		if (!$opt) $opt = array();
3155
		$opt['InstanceId'] = $instance_id;
3156
 
3157
		$response = $this->authenticate('GetConsoleOutput', $opt, $this->hostname);
3158
 
3159
		// Automatically Base64-decode the <output> value.
3160
		if ($this->util->is_base64((string) $response->body->output))
3161
		{
3162
			$response->body->output = base64_decode($response->body->output);
3163
		}
3164
 
3165
		return $response;
3166
	}
3167
 
3168
	/**
3169
	 * Retrieves the encrypted administrator password for the instances running Windows.
3170
	 *
3171
	 * The Windows password is only generated the first time an AMI is launched. It is not generated for
3172
	 * rebundled AMIs or after the password is changed on an instance. The password is encrypted using the
3173
	 * key pair that you provided.
3174
	 *
3175
	 * @param string $instance_id (Required) The ID of the instance for which you want the Windows administrator password.
3176
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3177
	 * 	<li><code>DecryptPasswordWithKey</code> - <code>string</code> - Optional - Enables the decryption of the Administrator password for the given Microsoft Windows instance. Specifies the RSA private key that is associated with the keypair ID which was used to launch the Microsoft Windows instance.</li>
3178
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3179
	 *  <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This is useful for manually-managed batch requests.</li></ul>
3180
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3181
	 */
3182
	public function get_password_data($instance_id, $opt = null)
3183
	{
3184
		if (!$opt) $opt = array();
3185
		$opt['InstanceId'] = $instance_id;
3186
 
3187
		// Unless DecryptPasswordWithKey is set, simply return the response.
3188
		if (!isset($opt['DecryptPasswordWithKey']))
3189
		{
3190
			return $this->authenticate('GetPasswordData', $opt, $this->hostname);
3191
		}
3192
 
3193
		// Otherwise, decrypt the password.
3194
		else
3195
		{
3196
			// Get a resource representing the private key.
3197
			$private_key = openssl_pkey_get_private($opt['DecryptPasswordWithKey']);
3198
			unset($opt['DecryptPasswordWithKey']);
3199
 
3200
			// Fetch the encrypted password.
3201
			$response = $this->authenticate('GetPasswordData', $opt, $this->hostname);
3202
			$data = trim((string) $response->body->passwordData);
3203
 
3204
			// If it's Base64-encoded...
3205
			if ($this->util->is_base64($data))
3206
			{
3207
				// Base64-decode it, and decrypt it with the private key.
3208
				if (openssl_private_decrypt(base64_decode($data), $decrypted, $private_key))
3209
				{
3210
					// Replace the previous password data with the decrypted value.
3211
					$response->body->passwordData = $decrypted;
3212
				}
3213
			}
3214
 
3215
			return $response;
3216
		}
3217
	}
3218
 
3219
	/**
3220
	 * Imports the public key from an RSA key pair created with a third-party tool. This operation differs
3221
	 * from CreateKeyPair as the private key is never transferred between the caller and AWS servers.
3222
	 *
3223
	 * RSA key pairs are easily created on Microsoft Windows and Linux OS systems using the <code>ssh-keygen</code>
3224
	 * command line tool provided with the standard OpenSSH installation. Standard library support for RSA
3225
	 * key pair creation is also available for Java, Ruby, Python, and many other programming languages.
3226
	 *
3227
	 * The following formats are supported:
3228
	 *
3229
	 * <ul>
3230
	 * 	<li>OpenSSH public key format.</li>
3231
	 * 	<li>Base64 encoded DER format.</li>
3232
	 * 	<li>SSH public key file format as specified in <a href="http://tools.ietf.org/html/rfc4716">RFC 4716</a>.</li>
3233
	 * </ul>
3234
	 *
3235
	 * @param string $key_name (Required) The unique name for the key pair.
3236
	 * @param string $public_key_material (Required) The public key portion of the key pair being imported.
3237
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3238
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3239
	 *  <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This is useful for manually-managed batch requests.</li></ul>
3240
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3241
	 */
3242
	public function import_key_pair($key_name, $public_key_material, $opt = null)
3243
	{
3244
		if (!$opt) $opt = array();
3245
		$opt['KeyName'] = $key_name;
3246
		$opt['PublicKeyMaterial'] = $this->util->is_base64($public_key_material) ? $public_key_material : base64_encode($public_key_material);
3247
 
3248
		return $this->authenticate('ImportKeyPair', $opt, $this->hostname);
3249
	}
3250
 
3251
	/**
3252
	 * The ModifyImageAttribute operation modifies an attribute of an AMI.
3253
	 *
3254
	 * @param string $image_id (Required) The ID of the AMI whose attribute you want to modify.
3255
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3256
	 * 	<li><code>Attribute</code> - <code>string</code> - Optional - The name of the AMI attribute you want to modify. Available attributes: <code>launchPermission</code>, <code>productCodes</code></li>
3257
	 * 	<li><code>OperationType</code> - <code>string</code> - Optional - The type of operation being requested. Available operation types: <code>add</code>, <code>remove</code></li>
3258
	 * 	<li><code>UserId</code> - <code>string|array</code> - Optional - The AWS user ID being added to or removed from the list of users with launch permissions for this AMI. Only valid when the launchPermission attribute is being modified. Pass a string for a single value, or an indexed array for multiple values.</li>
3259
	 * 	<li><code>UserGroup</code> - <code>string|array</code> - Optional - The user group being added to or removed from the list of user groups with launch permissions for this AMI. Only valid when the launchPermission attribute is being modified. Available user groups: <code>all</code> Pass a string for a single value, or an indexed array for multiple values.</li>
3260
	 * 	<li><code>ProductCode</code> - <code>string|array</code> - Optional - The list of product codes being added to or removed from the specified AMI. Only valid when the productCodes attribute is being modified. Pass a string for a single value, or an indexed array for multiple values.</li>
3261
	 * 	<li><code>Value</code> - <code>string</code> - Optional - The value of the attribute being modified. Only valid when the description attribute is being modified.</li>
3262
	 * 	<li><code>LaunchPermission</code> - <code>array</code> - Optional -  <ul>
3263
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3264
	 * 			<li><code>Add</code> - <code>array</code> - Optional - <p>
3265
        Describes a permission to launch an Amazon Machine Image (AMI).
3266
        </p> <ul>
3267
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3268
	 * 					<li><code>UserId</code> - <code>string</code> - Optional - The AWS user ID of the user involved in this launch permission.</li>
3269
	 * 					<li><code>Group</code> - <code>string</code> - Optional - The AWS group of the user involved in this launch permission. Available groups: <code>all</code></li>
3270
	 * 				</ul></li>
3271
	 * 			</ul></li>
3272
	 * 			<li><code>Remove</code> - <code>array</code> - Optional - <p>
3273
        Describes a permission to launch an Amazon Machine Image (AMI).
3274
        </p> <ul>
3275
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3276
	 * 					<li><code>UserId</code> - <code>string</code> - Optional - The AWS user ID of the user involved in this launch permission.</li>
3277
	 * 					<li><code>Group</code> - <code>string</code> - Optional - The AWS group of the user involved in this launch permission. Available groups: <code>all</code></li>
3278
	 * 				</ul></li>
3279
	 * 			</ul></li>
3280
	 * 		</ul></li>
3281
	 * 	</ul></li>
3282
	 * 	<li><code>Description.Value</code> - <code>string</code> - Optional - String value</li>
3283
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3284
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3285
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3286
	 */
3287
	public function modify_image_attribute($image_id, $opt = null)
3288
	{
3289
		if (!$opt) $opt = array();
3290
		$opt['ImageId'] = $image_id;
3291
 
3292
		// Optional list (non-map)
3293
		if (isset($opt['UserId']))
3294
		{
3295
			$opt = array_merge($opt, CFComplexType::map(array(
3296
				'UserId' => (is_array($opt['UserId']) ? $opt['UserId'] : array($opt['UserId']))
3297
			)));
3298
			unset($opt['UserId']);
3299
		}
3300
 
3301
		// Optional list (non-map)
3302
		if (isset($opt['UserGroup']))
3303
		{
3304
			$opt = array_merge($opt, CFComplexType::map(array(
3305
				'UserGroup' => (is_array($opt['UserGroup']) ? $opt['UserGroup'] : array($opt['UserGroup']))
3306
			)));
3307
			unset($opt['UserGroup']);
3308
		}
3309
 
3310
		// Optional list (non-map)
3311
		if (isset($opt['ProductCode']))
3312
		{
3313
			$opt = array_merge($opt, CFComplexType::map(array(
3314
				'ProductCode' => (is_array($opt['ProductCode']) ? $opt['ProductCode'] : array($opt['ProductCode']))
3315
			)));
3316
			unset($opt['ProductCode']);
3317
		}
3318
 
3319
		// Optional map (non-list)
3320
		if (isset($opt['LaunchPermission']))
3321
		{
3322
			$opt = array_merge($opt, CFComplexType::map(array(
3323
				'LaunchPermission' => $opt['LaunchPermission']
3324
			)));
3325
			unset($opt['LaunchPermission']);
3326
		}
3327
 
3328
		return $this->authenticate('ModifyImageAttribute', $opt);
3329
	}
3330
 
3331
	/**
3332
	 * Modifies an attribute of an instance.
3333
	 *
3334
	 * @param string $instance_id (Required) The ID of the instance whose attribute is being modified.
3335
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3336
	 * 	<li><code>Attribute</code> - <code>string</code> - Optional - The name of the attribute being modified. Available attribute names: <code>instanceType</code>, <code>kernel</code>, <code>ramdisk</code>, <code>userData</code>, <code>disableApiTermination</code>, <code>instanceInitiatedShutdownBehavior</code>, <code>rootDevice</code>, <code>blockDeviceMapping</code></li>
3337
	 * 	<li><code>Value</code> - <code>string</code> - Optional - The new value of the instance attribute being modified. Only valid when <code>kernel</code>, <code>ramdisk</code>, <code>userData</code>, <code>disableApiTermination</code> or <code>instanceInitiateShutdownBehavior</code> is specified as the attribute being modified.</li>
3338
	 * 	<li><code>BlockDeviceMapping</code> - <code>array</code> - Optional - The new block device mappings for the instance whose attributes are being modified. Only valid when blockDeviceMapping is specified as the attribute being modified. <ul>
3339
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3340
	 * 			<li><code>DeviceName</code> - <code>string</code> - Optional - The device name (e.g., <code>/dev/sdh</code>) at which the block device is exposed on the instance.</li>
3341
	 * 			<li><code>Ebs</code> - <code>array</code> - Optional - The EBS instance block device specification describing the EBS block device to map to the specified device name on a running instance. <ul>
3342
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3343
	 * 					<li><code>VolumeId</code> - <code>string</code> - Optional - The ID of the EBS volume that should be mounted as a block device on an Amazon EC2 instance.</li>
3344
	 * 					<li><code>DeleteOnTermination</code> - <code>boolean</code> - Optional - Specifies whether the Amazon EBS volume is deleted on instance termination.</li>
3345
	 * 				</ul></li>
3346
	 * 			</ul></li>
3347
	 * 			<li><code>VirtualName</code> - <code>string</code> - Optional - The virtual device name.</li>
3348
	 * 			<li><code>NoDevice</code> - <code>string</code> - Optional - When set to the empty string, specifies that the device name in this object should not be mapped to any real device.</li>
3349
	 * 		</ul></li>
3350
	 * 	</ul></li>
3351
	 * 	<li><code>SourceDestCheck.Value</code> - <code>boolean</code> - Optional - Boolean value</li>
3352
	 * 	<li><code>DisableApiTermination.Value</code> - <code>boolean</code> - Optional - Boolean value</li>
3353
	 * 	<li><code>InstanceType.Value</code> - <code>string</code> - Optional - String value</li>
3354
	 * 	<li><code>Kernel.Value</code> - <code>string</code> - Optional - String value</li>
3355
	 * 	<li><code>Ramdisk.Value</code> - <code>string</code> - Optional - String value</li>
3356
	 * 	<li><code>UserData.Value</code> - <code>string</code> - Optional - String value</li>
3357
	 * 	<li><code>InstanceInitiatedShutdownBehavior.Value</code> - <code>string</code> - Optional - String value</li>
3358
	 * 	<li><code>GroupId</code> - <code>string|array</code> - Optional -  Pass a string for a single value, or an indexed array for multiple values.</li>
3359
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3360
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3361
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3362
	 */
3363
	public function modify_instance_attribute($instance_id, $opt = null)
3364
	{
3365
		if (!$opt) $opt = array();
3366
		$opt['InstanceId'] = $instance_id;
3367
 
3368
		// Optional list + map
3369
		if (isset($opt['BlockDeviceMapping']))
3370
		{
3371
			$opt = array_merge($opt, CFComplexType::map(array(
3372
				'BlockDeviceMapping' => $opt['BlockDeviceMapping']
3373
			)));
3374
			unset($opt['BlockDeviceMapping']);
3375
		}
3376
 
3377
		// Optional list (non-map)
3378
		if (isset($opt['GroupId']))
3379
		{
3380
			$opt = array_merge($opt, CFComplexType::map(array(
3381
				'GroupId' => (is_array($opt['GroupId']) ? $opt['GroupId'] : array($opt['GroupId']))
3382
			)));
3383
			unset($opt['GroupId']);
3384
		}
3385
 
3386
		return $this->authenticate('ModifyInstanceAttribute', $opt);
3387
	}
3388
 
3389
	/**
3390
	 * Adds or remove permission settings for the specified snapshot.
3391
	 *
3392
	 * @param string $snapshot_id (Required) The ID of the EBS snapshot whose attributes are being modified.
3393
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3394
	 * 	<li><code>Attribute</code> - <code>string</code> - Optional - The name of the attribute being modified. Available attribute names: <code>createVolumePermission</code></li>
3395
	 * 	<li><code>OperationType</code> - <code>string</code> - Optional - The operation to perform on the attribute. Available operation names: <code>add</code>, <code>remove</code></li>
3396
	 * 	<li><code>UserId</code> - <code>string|array</code> - Optional - The AWS user IDs to add to or remove from the list of users that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <p class="note">Only valid when the <code>createVolumePermission</code> attribute is being modified.</p> Pass a string for a single value, or an indexed array for multiple values.</li>
3397
	 * 	<li><code>UserGroup</code> - <code>string|array</code> - Optional - The AWS group names to add to or remove from the list of groups that have permission to create EBS volumes from the specified snapshot. Currently supports "all". <p class="note">Only valid when the <code>createVolumePermission</code> attribute is being modified.</p> Pass a string for a single value, or an indexed array for multiple values.</li>
3398
	 * 	<li><code>CreateVolumePermission</code> - <code>array</code> - Optional -  <ul>
3399
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3400
	 * 			<li><code>Add</code> - <code>array</code> - Optional - <p>
3401
        Describes a permission allowing either a user or group to create a new EBS
3402
        volume from a snapshot.
3403
        </p> <ul>
3404
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3405
	 * 					<li><code>UserId</code> - <code>string</code> - Optional - The user ID of the user that can create volumes from the snapshot.</li>
3406
	 * 					<li><code>Group</code> - <code>string</code> - Optional - The group that is allowed to create volumes from the snapshot (currently supports "all").</li>
3407
	 * 				</ul></li>
3408
	 * 			</ul></li>
3409
	 * 			<li><code>Remove</code> - <code>array</code> - Optional - <p>
3410
        Describes a permission allowing either a user or group to create a new EBS
3411
        volume from a snapshot.
3412
        </p> <ul>
3413
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3414
	 * 					<li><code>UserId</code> - <code>string</code> - Optional - The user ID of the user that can create volumes from the snapshot.</li>
3415
	 * 					<li><code>Group</code> - <code>string</code> - Optional - The group that is allowed to create volumes from the snapshot (currently supports "all").</li>
3416
	 * 				</ul></li>
3417
	 * 			</ul></li>
3418
	 * 		</ul></li>
3419
	 * 	</ul></li>
3420
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3421
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3422
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3423
	 */
3424
	public function modify_snapshot_attribute($snapshot_id, $opt = null)
3425
	{
3426
		if (!$opt) $opt = array();
3427
		$opt['SnapshotId'] = $snapshot_id;
3428
 
3429
		// Optional list (non-map)
3430
		if (isset($opt['UserId']))
3431
		{
3432
			$opt = array_merge($opt, CFComplexType::map(array(
3433
				'UserId' => (is_array($opt['UserId']) ? $opt['UserId'] : array($opt['UserId']))
3434
			)));
3435
			unset($opt['UserId']);
3436
		}
3437
 
3438
		// Optional list (non-map)
3439
		if (isset($opt['UserGroup']))
3440
		{
3441
			$opt = array_merge($opt, CFComplexType::map(array(
3442
				'UserGroup' => (is_array($opt['UserGroup']) ? $opt['UserGroup'] : array($opt['UserGroup']))
3443
			)));
3444
			unset($opt['UserGroup']);
3445
		}
3446
 
3447
		// Optional map (non-list)
3448
		if (isset($opt['CreateVolumePermission']))
3449
		{
3450
			$opt = array_merge($opt, CFComplexType::map(array(
3451
				'CreateVolumePermission' => $opt['CreateVolumePermission']
3452
			)));
3453
			unset($opt['CreateVolumePermission']);
3454
		}
3455
 
3456
		return $this->authenticate('ModifySnapshotAttribute', $opt);
3457
	}
3458
 
3459
	/**
3460
	 * Enables monitoring for a running instance.
3461
	 *
3462
	 * @param string|array $instance_id (Required) The list of Amazon EC2 instances on which to enable monitoring. Pass a string for a single value, or an indexed array for multiple values.
3463
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3464
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3465
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3466
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3467
	 */
3468
	public function monitor_instances($instance_id, $opt = null)
3469
	{
3470
		if (!$opt) $opt = array();
3471
 
3472
		// Required list (non-map)
3473
		$opt = array_merge($opt, CFComplexType::map(array(
3474
			'InstanceId' => (is_array($instance_id) ? $instance_id : array($instance_id))
3475
		)));
3476
 
3477
		return $this->authenticate('MonitorInstances', $opt);
3478
	}
3479
 
3480
	/**
3481
	 * The PurchaseReservedInstancesOffering operation purchases a Reserved Instance for use with your
3482
	 * account. With Amazon EC2 Reserved Instances, you purchase the right to launch Amazon EC2
3483
	 * instances for a period of time (without getting insufficient capacity errors) and pay a lower
3484
	 * usage rate for the actual time used.
3485
	 *
3486
	 * @param string $reserved_instances_offering_id (Required) The unique ID of the Reserved Instances offering being purchased.
3487
	 * @param integer $instance_count (Required) The number of Reserved Instances to purchase.
3488
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3489
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3490
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3491
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3492
	 */
3493
	public function purchase_reserved_instances_offering($reserved_instances_offering_id, $instance_count, $opt = null)
3494
	{
3495
		if (!$opt) $opt = array();
3496
		$opt['ReservedInstancesOfferingId'] = $reserved_instances_offering_id;
3497
		$opt['InstanceCount'] = $instance_count;
3498
 
3499
		return $this->authenticate('PurchaseReservedInstancesOffering', $opt);
3500
	}
3501
 
3502
	/**
3503
	 * The RebootInstances operation requests a reboot of one or more instances. This operation is
3504
	 * asynchronous; it only queues a request to reboot the specified instance(s). The operation will
3505
	 * succeed if the instances are valid and belong to the user. Requests to reboot terminated
3506
	 * instances are ignored.
3507
	 *
3508
	 * @param string|array $instance_id (Required) The list of instances to terminate. Pass a string for a single value, or an indexed array for multiple values.
3509
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3510
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3511
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3512
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3513
	 */
3514
	public function reboot_instances($instance_id, $opt = null)
3515
	{
3516
		if (!$opt) $opt = array();
3517
 
3518
		// Required list (non-map)
3519
		$opt = array_merge($opt, CFComplexType::map(array(
3520
			'InstanceId' => (is_array($instance_id) ? $instance_id : array($instance_id))
3521
		)));
3522
 
3523
		return $this->authenticate('RebootInstances', $opt);
3524
	}
3525
 
3526
	/**
3527
	 * The RegisterImage operation registers an AMI with Amazon EC2. Images must be registered before
3528
	 * they can be launched. For more information, see RunInstances.
3529
	 *
3530
	 * Each AMI is associated with an unique ID which is provided by the Amazon EC2 service through
3531
	 * the RegisterImage operation. During registration, Amazon EC2 retrieves the specified image
3532
	 * manifest from Amazon S3 and verifies that the image is owned by the user registering the image.
3533
	 *
3534
	 * The image manifest is retrieved once and stored within the Amazon EC2. Any modifications to an
3535
	 * image in Amazon S3 invalidates this registration. If you make changes to an image, deregister
3536
	 * the previous image and register the new image. For more information, see DeregisterImage.
3537
	 *
3538
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3539
	 * 	<li><code>ImageLocation</code> - <code>string</code> - Optional - The full path to your AMI manifest in Amazon S3 storage.</li>
3540
	 * 	<li><code>Name</code> - <code>string</code> - Optional - The name to give the new Amazon Machine Image. Constraints: 3-128 alphanumeric characters, parenthesis (<code>()</code>), commas (<code>,</code>), slashes (<code>/</code>), dashes (<code>-</code>), or underscores(<code>_</code>)</li>
3541
	 * 	<li><code>Description</code> - <code>string</code> - Optional - The description describing the new AMI.</li>
3542
	 * 	<li><code>Architecture</code> - <code>string</code> - Optional - The architecture of the image. Valid Values: <code>i386</code>, <code>x86_64</code></li>
3543
	 * 	<li><code>KernelId</code> - <code>string</code> - Optional - The optional ID of a specific kernel to register with the new AMI.</li>
3544
	 * 	<li><code>RamdiskId</code> - <code>string</code> - Optional - The optional ID of a specific ramdisk to register with the new AMI. Some kernels require additional drivers at launch. Check the kernel requirements for information on whether you need to specify a RAM disk.</li>
3545
	 * 	<li><code>RootDeviceName</code> - <code>string</code> - Optional - The root device name (e.g., <code>/dev/sda1</code>).</li>
3546
	 * 	<li><code>BlockDeviceMapping</code> - <code>array</code> - Optional - The block device mappings for the new AMI, which specify how different block devices (ex: EBS volumes and ephemeral drives) will be exposed on instances launched from the new image. <ul>
3547
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3548
	 * 			<li><code>VirtualName</code> - <code>string</code> - Optional - Specifies the virtual device name.</li>
3549
	 * 			<li><code>DeviceName</code> - <code>string</code> - Optional - Specifies the device name (e.g., <code>/dev/sdh</code>).</li>
3550
	 * 			<li><code>Ebs</code> - <code>array</code> - Optional - Specifies parameters used to automatically setup Amazon EBS volumes when the instance is launched. <ul>
3551
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3552
	 * 					<li><code>SnapshotId</code> - <code>string</code> - Optional - The ID of the snapshot from which the volume will be created.</li>
3553
	 * 					<li><code>VolumeSize</code> - <code>integer</code> - Optional - The size of the volume, in gigabytes.</li>
3554
	 * 					<li><code>DeleteOnTermination</code> - <code>boolean</code> - Optional - Specifies whether the Amazon EBS volume is deleted on instance termination.</li>
3555
	 * 				</ul></li>
3556
	 * 			</ul></li>
3557
	 * 			<li><code>NoDevice</code> - <code>string</code> - Optional - Specifies the device name to suppress during instance launch.</li>
3558
	 * 		</ul></li>
3559
	 * 	</ul></li>
3560
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3561
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3562
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3563
	 */
3564
	public function register_image($opt = null)
3565
	{
3566
		if (!$opt) $opt = array();
3567
 
3568
		// Optional list + map
3569
		if (isset($opt['BlockDeviceMapping']))
3570
		{
3571
			$opt = array_merge($opt, CFComplexType::map(array(
3572
				'BlockDeviceMapping' => $opt['BlockDeviceMapping']
3573
			)));
3574
			unset($opt['BlockDeviceMapping']);
3575
		}
3576
 
3577
		return $this->authenticate('RegisterImage', $opt);
3578
	}
3579
 
3580
	/**
3581
	 * The ReleaseAddress operation releases an elastic IP address associated with your account.
3582
	 *
3583
	 * <p class="note">
3584
	 * Releasing an IP address automatically disassociates it from any instance with which it is
3585
	 * associated. For more information, see DisassociateAddress.
3586
	 * </p>
3587
	 * <p class="important"></p>
3588
	 * After releasing an elastic IP address, it is released to the IP address pool and might no
3589
	 * longer be available to your account. Make sure to update your DNS records and any servers or
3590
	 * devices that communicate with the address.
3591
	 *
3592
	 * If you run this operation on an elastic IP address that is already released, the address might
3593
	 * be assigned to another account which will cause Amazon EC2 to return an error.
3594
	 *
3595
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3596
	 * 	<li><code>PublicIp</code> - <code>string</code> - Optional - The elastic IP address that you are releasing from your account.</li>
3597
	 * 	<li><code>AllocationId</code> - <code>string</code> - Optional - The allocation ID that AWS provided when you allocated the address for use with Amazon VPC.</li>
3598
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3599
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3600
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3601
	 */
3602
	public function release_address($opt = null)
3603
	{
3604
		if (!$opt) $opt = array();
3605
 
3606
		return $this->authenticate('ReleaseAddress', $opt);
3607
	}
3608
 
3609
	/**
3610
	 * Changes which network ACL a subnet is associated with. By default when you create a subnet,
3611
	 * it's automatically associated with the default network ACL. For more information about network
3612
	 * ACLs, go to Network ACLs in the Amazon Virtual Private Cloud User Guide.
3613
	 *
3614
	 * @param string $association_id (Required) The ID representing the current association between the original network ACL and the subnet.
3615
	 * @param string $network_acl_id (Required) The ID of the new ACL to associate with the subnet.
3616
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3617
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3618
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3619
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3620
	 */
3621
	public function replace_network_acl_association($association_id, $network_acl_id, $opt = null)
3622
	{
3623
		if (!$opt) $opt = array();
3624
		$opt['AssociationId'] = $association_id;
3625
		$opt['NetworkAclId'] = $network_acl_id;
3626
 
3627
		return $this->authenticate('ReplaceNetworkAclAssociation', $opt);
3628
	}
3629
 
3630
	/**
3631
	 * Replaces an entry (i.e., rule) in a network ACL. For more information about network ACLs, go to
3632
	 * Network ACLs in the Amazon Virtual Private Cloud User Guide.
3633
	 *
3634
	 * @param string $network_acl_id (Required) ID of the ACL where the entry will be replaced.
3635
	 * @param integer $rule_number (Required) Rule number of the entry to replace.
3636
	 * @param string $protocol (Required) IP protocol the rule applies to. Valid Values: <code>tcp</code>, <code>udp</code>, <code>icmp</code> or an IP protocol number.
3637
	 * @param string $rule_action (Required) Whether to allow or deny traffic that matches the rule. [Allowed values: <code>allow</code>, <code>deny</code>]
3638
	 * @param boolean $egress (Required) Whether this rule applies to egress traffic from the subnet (<code>true</code>) or ingress traffic (<code>false</code>).
3639
	 * @param string $cidr_block (Required) The CIDR range to allow or deny, in CIDR notation (e.g., <code>172.16.0.0/24</code>).
3640
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3641
	 * 	<li><code>Icmp</code> - <code>array</code> - Optional - ICMP values. <ul>
3642
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3643
	 * 			<li><code>Type</code> - <code>integer</code> - Optional - For the ICMP protocol, the ICMP type. A value of <code>-1</code> is a wildcard meaning all types. Required if specifying <code>icmp</code> for the protocol.</li>
3644
	 * 			<li><code>Code</code> - <code>integer</code> - Optional - For the ICMP protocol, the ICMP code. A value of <code>-1</code> is a wildcard meaning all codes. Required if specifying <code>icmp</code> for the protocol.</li>
3645
	 * 		</ul></li>
3646
	 * 	</ul></li>
3647
	 * 	<li><code>PortRange</code> - <code>array</code> - Optional - Port ranges. <ul>
3648
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3649
	 * 			<li><code>From</code> - <code>integer</code> - Optional - The first port in the range. Required if specifying <code>tcp</code> or <code>udp</code> for the protocol.</li>
3650
	 * 			<li><code>To</code> - <code>integer</code> - Optional - The last port in the range. Required if specifying <code>tcp</code> or <code>udp</code> for the protocol.</li>
3651
	 * 		</ul></li>
3652
	 * 	</ul></li>
3653
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3654
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3655
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3656
	 */
3657
	public function replace_network_acl_entry($network_acl_id, $rule_number, $protocol, $rule_action, $egress, $cidr_block, $opt = null)
3658
	{
3659
		if (!$opt) $opt = array();
3660
		$opt['NetworkAclId'] = $network_acl_id;
3661
		$opt['RuleNumber'] = $rule_number;
3662
		$opt['Protocol'] = $protocol;
3663
		$opt['RuleAction'] = $rule_action;
3664
		$opt['Egress'] = $egress;
3665
		$opt['CidrBlock'] = $cidr_block;
3666
 
3667
		// Optional map (non-list)
3668
		if (isset($opt['Icmp']))
3669
		{
3670
			$opt = array_merge($opt, CFComplexType::map(array(
3671
				'Icmp' => $opt['Icmp']
3672
			)));
3673
			unset($opt['Icmp']);
3674
		}
3675
 
3676
		// Optional map (non-list)
3677
		if (isset($opt['PortRange']))
3678
		{
3679
			$opt = array_merge($opt, CFComplexType::map(array(
3680
				'PortRange' => $opt['PortRange']
3681
			)));
3682
			unset($opt['PortRange']);
3683
		}
3684
 
3685
		return $this->authenticate('ReplaceNetworkAclEntry', $opt);
3686
	}
3687
 
3688
	/**
3689
	 * Replaces an existing route within a route table in a VPC. For more information about route
3690
	 * tables, go to <a href=
3691
	 * "http://docs.amazonwebservices.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html">Route
3692
	 * Tables</a> in the Amazon Virtual Private Cloud User Guide.
3693
	 *
3694
	 * @param string $route_table_id (Required) The ID of the route table where the route will be replaced.
3695
	 * @param string $destination_cidr_block (Required) The CIDR address block used for the destination match. For example: <code>0.0.0.0/0</code>. The value you provide must match the CIDR of an existing route in the table.
3696
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3697
	 * 	<li><code>GatewayId</code> - <code>string</code> - Optional - The ID of a VPN or Internet gateway attached to your VPC.</li>
3698
	 * 	<li><code>InstanceId</code> - <code>string</code> - Optional - The ID of a NAT instance in your VPC.</li>
3699
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3700
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3701
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3702
	 */
3703
	public function replace_route($route_table_id, $destination_cidr_block, $opt = null)
3704
	{
3705
		if (!$opt) $opt = array();
3706
		$opt['RouteTableId'] = $route_table_id;
3707
		$opt['DestinationCidrBlock'] = $destination_cidr_block;
3708
 
3709
		return $this->authenticate('ReplaceRoute', $opt);
3710
	}
3711
 
3712
	/**
3713
	 * Changes the route table associated with a given subnet in a VPC. After you execute this action,
3714
	 * the subnet uses the routes in the new route table it's associated with. For more information
3715
	 * about route tables, go to <a href=
3716
	 * "http://docs.amazonwebservices.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html">Route
3717
	 * Tables</a> in the Amazon Virtual Private Cloud User Guide.
3718
	 *
3719
	 * You can also use this to change which table is the main route table in the VPC. You just
3720
	 * specify the main route table's association ID and the route table that you want to be the new
3721
	 * main route table.
3722
	 *
3723
	 * @param string $association_id (Required) The ID representing the current association between the original route table and the subnet.
3724
	 * @param string $route_table_id (Required) The ID of the new route table to associate with the subnet.
3725
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3726
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3727
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3728
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3729
	 */
3730
	public function replace_route_table_association($association_id, $route_table_id, $opt = null)
3731
	{
3732
		if (!$opt) $opt = array();
3733
		$opt['AssociationId'] = $association_id;
3734
		$opt['RouteTableId'] = $route_table_id;
3735
 
3736
		return $this->authenticate('ReplaceRouteTableAssociation', $opt);
3737
	}
3738
 
3739
	/**
3740
	 * Creates a Spot Instance request.
3741
	 *
3742
	 * Spot Instances are instances that Amazon EC2 starts on your behalf when the maximum price that
3743
	 * you specify exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price based
3744
	 * on available Spot Instance capacity and current spot instance requests.
3745
	 *
3746
	 * For conceptual information about Spot Instances, refer to the <a href=
3747
	 * "http://docs.amazonwebservices.com/AWSEC2/2009-11-30/DeveloperGuide/">Amazon Elastic Compute
3748
	 * Cloud Developer Guide</a> or <a href=
3749
	 * "http://docs.amazonwebservices.com/AWSEC2/2009-11-30/UserGuide/">Amazon Elastic Compute Cloud
3750
	 * User Guide.</a>
3751
	 *
3752
	 * @param string $spot_price (Required) Specifies the maximum hourly price for any Spot Instance launched to fulfill the request.
3753
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3754
	 * 	<li><code>InstanceCount</code> - <code>integer</code> - Optional - Specifies the maximum number of Spot Instances to launch.</li>
3755
	 * 	<li><code>Type</code> - <code>string</code> - Optional - Specifies the Spot Instance type. [Allowed values: <code>one-time</code>, <code>persistent</code>]</li>
3756
	 * 	<li><code>ValidFrom</code> - <code>string</code> - Optional - Defines the start date of the request. If this is a one-time request, the request becomes active at this date and time and remains active until all instances launch, the request expires, or the request is canceled. If the request is persistent, the request becomes active at this date and time and remains active until it expires or is canceled. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
3757
	 * 	<li><code>ValidUntil</code> - <code>string</code> - Optional - End date of the request. If this is a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
3758
	 * 	<li><code>LaunchGroup</code> - <code>string</code> - Optional - Specifies the instance launch group. Launch groups are Spot Instances that launch and terminate together.</li>
3759
	 * 	<li><code>AvailabilityZoneGroup</code> - <code>string</code> - Optional - Specifies the Availability Zone group. When specifying the same Availability Zone group for all Spot Instance requests, all Spot Instances are launched in the same Availability Zone.</li>
3760
	 * 	<li><code>LaunchSpecification</code> - <code>array</code> - Optional - Specifies additional launch instance information. <ul>
3761
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3762
	 * 			<li><code>ImageId</code> - <code>string</code> - Optional - The AMI ID.</li>
3763
	 * 			<li><code>KeyName</code> - <code>string</code> - Optional - The name of the key pair.</li>
3764
	 * 			<li><code>GroupSet</code> - <code>array</code> - Optional - <p>
3765
 
3766
        </p> <ul>
3767
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3768
	 * 					<li><code>GroupName</code> - <code>string</code> - Optional - </li>
3769
	 * 					<li><code>GroupId</code> - <code>string</code> - Optional - </li>
3770
	 * 				</ul></li>
3771
	 * 			</ul></li>
3772
	 * 			<li><code>SecurityGroup</code> - <code>string|array</code> - Optional - <p>
3773
 
3774
        </p> Pass a string for a single value, or an indexed array for multiple values.</li>
3775
	 * 			<li><code>UserData</code> - <code>string</code> - Optional - Optional data, specific to a user's application, to provide in the launch request. All instances that collectively comprise the launch request have access to this data. User data is never returned through API responses.</li>
3776
	 * 			<li><code>InstanceType</code> - <code>string</code> - Optional - Specifies the instance type. [Allowed values: <code>t1.micro</code>, <code>m1.small</code>, <code>m1.large</code>, <code>m1.xlarge</code>, <code>m2.xlarge</code>, <code>m2.2xlarge</code>, <code>m2.4xlarge</code>, <code>c1.medium</code>, <code>c1.xlarge</code>, <code>cc1.4xlarge</code>, <code>cc2.8xlarge</code>, <code>cg1.4xlarge</code>]</li>
3777
	 * 			<li><code>Placement</code> - <code>array</code> - Optional - Defines a placement item. <ul>
3778
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3779
	 * 					<li><code>AvailabilityZone</code> - <code>string</code> - Optional - The availability zone in which an Amazon EC2 instance runs.</li>
3780
	 * 					<li><code>GroupName</code> - <code>string</code> - Optional - The name of the <code>PlacementGroup</code> in which an Amazon EC2 instance runs. Placement groups are primarily used for launching High Performance Computing instances in the same group to ensure fast connection speeds.</li>
3781
	 * 				</ul></li>
3782
	 * 			</ul></li>
3783
	 * 			<li><code>KernelId</code> - <code>string</code> - Optional - Specifies the ID of the kernel to select.</li>
3784
	 * 			<li><code>RamdiskId</code> - <code>string</code> - Optional - Specifies the ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information on whether or not you need to specify a RAM disk and search for the kernel ID.</li>
3785
	 * 			<li><code>BlockDeviceMapping</code> - <code>array</code> - Optional - Specifies how block devices are exposed to the instance. Each mapping is made up of a virtualName and a deviceName. <ul>
3786
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3787
	 * 					<li><code>VirtualName</code> - <code>string</code> - Optional - Specifies the virtual device name.</li>
3788
	 * 					<li><code>DeviceName</code> - <code>string</code> - Optional - Specifies the device name (e.g., <code>/dev/sdh</code>).</li>
3789
	 * 					<li><code>Ebs</code> - <code>array</code> - Optional - Specifies parameters used to automatically setup Amazon EBS volumes when the instance is launched. <ul>
3790
	 * 						<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3791
	 * 							<li><code>SnapshotId</code> - <code>string</code> - Optional - The ID of the snapshot from which the volume will be created.</li>
3792
	 * 							<li><code>VolumeSize</code> - <code>integer</code> - Optional - The size of the volume, in gigabytes.</li>
3793
	 * 							<li><code>DeleteOnTermination</code> - <code>boolean</code> - Optional - Specifies whether the Amazon EBS volume is deleted on instance termination.</li>
3794
	 * 						</ul></li>
3795
	 * 					</ul></li>
3796
	 * 					<li><code>NoDevice</code> - <code>string</code> - Optional - Specifies the device name to suppress during instance launch.</li>
3797
	 * 				</ul></li>
3798
	 * 			</ul></li>
3799
	 * 			<li><code>Monitoring.Enabled</code> - <code>boolean</code> - Optional - Enables monitoring for the instance.</li>
3800
	 * 			<li><code>SubnetId</code> - <code>string</code> - Optional - Specifies the Amazon VPC subnet ID within which to launch the instance(s) for Amazon Virtual Private Cloud.</li>
3801
	 * 		</ul></li>
3802
	 * 	</ul></li>
3803
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3804
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3805
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3806
	 */
3807
	public function request_spot_instances($spot_price, $opt = null)
3808
	{
3809
		if (!$opt) $opt = array();
3810
		$opt['SpotPrice'] = $spot_price;
3811
 
3812
		// Optional DateTime
3813
		if (isset($opt['ValidFrom']))
3814
		{
3815
			$opt['ValidFrom'] = $this->util->convert_date_to_iso8601($opt['ValidFrom']);
3816
		}
3817
 
3818
		// Optional DateTime
3819
		if (isset($opt['ValidUntil']))
3820
		{
3821
			$opt['ValidUntil'] = $this->util->convert_date_to_iso8601($opt['ValidUntil']);
3822
		}
3823
 
3824
		// Optional map (non-list)
3825
		if (isset($opt['LaunchSpecification']))
3826
		{
3827
			$opt = array_merge($opt, CFComplexType::map(array(
3828
				'LaunchSpecification' => $opt['LaunchSpecification']
3829
			)));
3830
			unset($opt['LaunchSpecification']);
3831
		}
3832
 
3833
		return $this->authenticate('RequestSpotInstances', $opt);
3834
	}
3835
 
3836
	/**
3837
	 * The ResetImageAttribute operation resets an attribute of an AMI to its default value.
3838
	 *
3839
	 * <p class="note">
3840
	 * The productCodes attribute cannot be reset.
3841
	 * </p>
3842
	 *
3843
	 * @param string $image_id (Required) The ID of the AMI whose attribute is being reset.
3844
	 * @param string $attribute (Required) The name of the attribute being reset. Available attribute names: <code>launchPermission</code>
3845
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3846
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3847
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3848
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3849
	 */
3850
	public function reset_image_attribute($image_id, $attribute, $opt = null)
3851
	{
3852
		if (!$opt) $opt = array();
3853
		$opt['ImageId'] = $image_id;
3854
		$opt['Attribute'] = $attribute;
3855
 
3856
		return $this->authenticate('ResetImageAttribute', $opt);
3857
	}
3858
 
3859
	/**
3860
	 * Resets an attribute of an instance to its default value.
3861
	 *
3862
	 * @param string $instance_id (Required) The ID of the Amazon EC2 instance whose attribute is being reset.
3863
	 * @param string $attribute (Required) The name of the attribute being reset. Available attribute names: <code>kernel</code>, <code>ramdisk</code>
3864
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3865
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3866
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3867
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3868
	 */
3869
	public function reset_instance_attribute($instance_id, $attribute, $opt = null)
3870
	{
3871
		if (!$opt) $opt = array();
3872
		$opt['InstanceId'] = $instance_id;
3873
		$opt['Attribute'] = $attribute;
3874
 
3875
		return $this->authenticate('ResetInstanceAttribute', $opt);
3876
	}
3877
 
3878
	/**
3879
	 * Resets permission settings for the specified snapshot.
3880
	 *
3881
	 * @param string $snapshot_id (Required) The ID of the snapshot whose attribute is being reset.
3882
	 * @param string $attribute (Required) The name of the attribute being reset. Available attribute names: <code>createVolumePermission</code>
3883
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3884
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3885
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3886
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3887
	 */
3888
	public function reset_snapshot_attribute($snapshot_id, $attribute, $opt = null)
3889
	{
3890
		if (!$opt) $opt = array();
3891
		$opt['SnapshotId'] = $snapshot_id;
3892
		$opt['Attribute'] = $attribute;
3893
 
3894
		return $this->authenticate('ResetSnapshotAttribute', $opt);
3895
	}
3896
 
3897
	/**
3898
	 * This action applies only to security groups in a VPC. It doesn't work with EC2 security groups.
3899
	 * For information about Amazon Virtual Private Cloud and VPC security groups, go to the Amazon
3900
	 * Virtual Private Cloud User Guide.
3901
	 *
3902
	 * The action removes one or more egress rules from a VPC security group. The values that you
3903
	 * specify in the revoke request (e.g., ports, etc.) must match the existing rule's values in
3904
	 * order for the rule to be revoked.
3905
	 *
3906
	 * Each rule consists of the protocol, and the CIDR range or destination security group. For the
3907
	 * TCP and UDP protocols, you must also specify the destination port or range of ports. For the
3908
	 * ICMP protocol, you must also specify the ICMP type and code.
3909
	 *
3910
	 * Rule changes are propagated to instances within the security group as quickly as possible.
3911
	 * However, a small delay might occur.
3912
	 *
3913
	 * @param string $group_id (Required) ID of the VPC security group to modify.
3914
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3915
	 * 	<li><code>IpPermissions</code> - <code>array</code> - Optional - List of IP permissions to authorize on the specified security group. Specifying permissions through IP permissions is the preferred way of authorizing permissions since it offers more flexibility and control. <ul>
3916
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3917
	 * 			<li><code>IpProtocol</code> - <code>string</code> - Optional - The IP protocol of this permission. Valid protocol values: <code>tcp</code>, <code>udp</code>, <code>icmp</code></li>
3918
	 * 			<li><code>FromPort</code> - <code>integer</code> - Optional - Start of port range for the TCP and UDP protocols, or an ICMP type number. An ICMP type number of <code>-1</code> indicates a wildcard (i.e., any ICMP type number).</li>
3919
	 * 			<li><code>ToPort</code> - <code>integer</code> - Optional - End of port range for the TCP and UDP protocols, or an ICMP code. An ICMP code of <code>-1</code> indicates a wildcard (i.e., any ICMP code).</li>
3920
	 * 			<li><code>Groups</code> - <code>array</code> - Optional - The list of AWS user IDs and groups included in this permission. <ul>
3921
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3922
	 * 					<li><code>UserId</code> - <code>string</code> - Optional - The AWS user ID of an account.</li>
3923
	 * 					<li><code>GroupName</code> - <code>string</code> - Optional - Name of the security group in the specified AWS account. Cannot be used when specifying a CIDR IP address range.</li>
3924
	 * 					<li><code>GroupId</code> - <code>string</code> - Optional - ID of the security group in the specified AWS account. Cannot be used when specifying a CIDR IP address range.</li>
3925
	 * 				</ul></li>
3926
	 * 			</ul></li>
3927
	 * 			<li><code>IpRanges</code> - <code>string|array</code> - Optional - The list of CIDR IP ranges included in this permission. Pass a string for a single value, or an indexed array for multiple values.</li>
3928
	 * 		</ul></li>
3929
	 * 	</ul></li>
3930
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3931
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3932
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3933
	 */
3934
	public function revoke_security_group_egress($group_id, $opt = null)
3935
	{
3936
		if (!$opt) $opt = array();
3937
		$opt['GroupId'] = $group_id;
3938
 
3939
		// Optional list + map
3940
		if (isset($opt['IpPermissions']))
3941
		{
3942
			$opt = array_merge($opt, CFComplexType::map(array(
3943
				'IpPermissions' => $opt['IpPermissions']
3944
			)));
3945
			unset($opt['IpPermissions']);
3946
		}
3947
 
3948
		return $this->authenticate('RevokeSecurityGroupEgress', $opt);
3949
	}
3950
 
3951
	/**
3952
	 * The RevokeSecurityGroupIngress operation revokes permissions from a security group. The
3953
	 * permissions used to revoke must be specified using the same values used to grant the
3954
	 * permissions.
3955
	 *
3956
	 * Permissions are specified by IP protocol (TCP, UDP, or ICMP), the source of the request (by IP
3957
	 * range or an Amazon EC2 user-group pair), the source and destination port ranges (for TCP and
3958
	 * UDP), and the ICMP codes and types (for ICMP).
3959
	 *
3960
	 * Permission changes are quickly propagated to instances within the security group. However,
3961
	 * depending on the number of instances in the group, a small delay might occur.
3962
	 *
3963
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
3964
	 * 	<li><code>GroupName</code> - <code>string</code> - Optional - Name of the standard (EC2) security group to modify. The group must belong to your account. Can be used instead of GroupID for standard (EC2) security groups.</li>
3965
	 * 	<li><code>GroupId</code> - <code>string</code> - Optional - ID of the standard (EC2) or VPC security group to modify. The group must belong to your account. Required for VPC security groups; can be used instead of GroupName for standard (EC2) security groups.</li>
3966
	 * 	<li><code>IpPermissions</code> - <code>array</code> - Optional - List of IP permissions to revoke on the specified security group. For an IP permission to be removed, it must exactly match one of the IP permissions you specify in this list. Specifying permissions through IP permissions is the preferred way of revoking permissions since it offers more flexibility and control. <ul>
3967
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3968
	 * 			<li><code>IpProtocol</code> - <code>string</code> - Optional - The IP protocol of this permission. Valid protocol values: <code>tcp</code>, <code>udp</code>, <code>icmp</code></li>
3969
	 * 			<li><code>FromPort</code> - <code>integer</code> - Optional - Start of port range for the TCP and UDP protocols, or an ICMP type number. An ICMP type number of <code>-1</code> indicates a wildcard (i.e., any ICMP type number).</li>
3970
	 * 			<li><code>ToPort</code> - <code>integer</code> - Optional - End of port range for the TCP and UDP protocols, or an ICMP code. An ICMP code of <code>-1</code> indicates a wildcard (i.e., any ICMP code).</li>
3971
	 * 			<li><code>Groups</code> - <code>array</code> - Optional - The list of AWS user IDs and groups included in this permission. <ul>
3972
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
3973
	 * 					<li><code>UserId</code> - <code>string</code> - Optional - The AWS user ID of an account.</li>
3974
	 * 					<li><code>GroupName</code> - <code>string</code> - Optional - Name of the security group in the specified AWS account. Cannot be used when specifying a CIDR IP address range.</li>
3975
	 * 					<li><code>GroupId</code> - <code>string</code> - Optional - ID of the security group in the specified AWS account. Cannot be used when specifying a CIDR IP address range.</li>
3976
	 * 				</ul></li>
3977
	 * 			</ul></li>
3978
	 * 			<li><code>IpRanges</code> - <code>string|array</code> - Optional - The list of CIDR IP ranges included in this permission. Pass a string for a single value, or an indexed array for multiple values.</li>
3979
	 * 		</ul></li>
3980
	 * 	</ul></li>
3981
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
3982
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
3983
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
3984
	 */
3985
	public function revoke_security_group_ingress($opt = null)
3986
	{
3987
		if (!$opt) $opt = array();
3988
 
3989
		// Optional list + map
3990
		if (isset($opt['IpPermissions']))
3991
		{
3992
			$opt = array_merge($opt, CFComplexType::map(array(
3993
				'IpPermissions' => $opt['IpPermissions']
3994
			)));
3995
			unset($opt['IpPermissions']);
3996
		}
3997
 
3998
		return $this->authenticate('RevokeSecurityGroupIngress', $opt);
3999
	}
4000
 
4001
	/**
4002
	 * The RunInstances operation launches a specified number of instances.
4003
	 *
4004
	 * If Amazon EC2 cannot launch the minimum number AMIs you request, no instances launch. If there
4005
	 * is insufficient capacity to launch the maximum number of AMIs you request, Amazon EC2 launches
4006
	 * as many as possible to satisfy the requested maximum values.
4007
	 *
4008
	 * Every instance is launched in a security group. If you do not specify a security group at
4009
	 * launch, the instances start in your default security group. For more information on creating
4010
	 * security groups, see CreateSecurityGroup.
4011
	 *
4012
	 * An optional instance type can be specified. For information about instance types, see Instance
4013
	 * Types.
4014
	 *
4015
	 * You can provide an optional key pair ID for each image in the launch request (for more
4016
	 * information, see CreateKeyPair). All instances that are created from images that use this key
4017
	 * pair will have access to the associated public key at boot. You can use this key to provide
4018
	 * secure access to an instance of an image on a per-instance basis. Amazon EC2 public images use
4019
	 * this feature to provide secure access without passwords.
4020
	 *
4021
	 * <p class="important"></p>
4022
	 * Launching public images without a key pair ID will leave them inaccessible.
4023
	 *
4024
	 * The public key material is made available to the instance at boot time by placing it in the
4025
	 * <code>openssh_id.pub</code> file on a logical device that is exposed to the instance as
4026
	 * <code>/dev/sda2</code> (the ephemeral store). The format of this file is suitable for use as an
4027
	 * entry within <code>~/.ssh/authorized_keys</code> (the OpenSSH format). This can be done at boot
4028
	 * (e.g., as part of <code>rc.local</code>) allowing for secure access without passwords.
4029
	 *
4030
	 * Optional user data can be provided in the launch request. All instances that collectively
4031
	 * comprise the launch request have access to this data For more information, see Instance
4032
	 * Metadata.
4033
	 *
4034
	 * <p class="note">
4035
	 * If any of the AMIs have a product code attached for which the user has not subscribed, the
4036
	 * RunInstances call will fail.
4037
	 * </p>
4038
	 * <p class="important"></p>
4039
	 * We strongly recommend using the 2.6.18 Xen stock kernel with the <code>c1.medium</code> and
4040
	 * <code>c1.xlarge</code> instances. Although the default Amazon EC2 kernels will work, the new
4041
	 * kernels provide greater stability and performance for these instance types. For more
4042
	 * information about kernels, see Kernels, RAM Disks, and Block Device Mappings.
4043
	 *
4044
	 * @param string $image_id (Required) Unique ID of a machine image, returned by a call to DescribeImages.
4045
	 * @param integer $min_count (Required) Minimum number of instances to launch. If the value is more than Amazon EC2 can launch, no instances are launched at all.
4046
	 * @param integer $max_count (Required) Maximum number of instances to launch. If the value is more than Amazon EC2 can launch, the largest possible number above minCount will be launched instead. Between 1 and the maximum number allowed for your account (default: 20).
4047
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
4048
	 * 	<li><code>KeyName</code> - <code>string</code> - Optional - The name of the key pair.</li>
4049
	 * 	<li><code>SecurityGroup</code> - <code>string|array</code> - Optional - The names of the security groups into which the instances will be launched. Pass a string for a single value, or an indexed array for multiple values.</li>
4050
	 * 	<li><code>SecurityGroupId</code> - <code>string|array</code> - Optional -  Pass a string for a single value, or an indexed array for multiple values.</li>
4051
	 * 	<li><code>UserData</code> - <code>string</code> - Optional - Specifies additional information to make available to the instance(s).</li>
4052
	 * 	<li><code>InstanceType</code> - <code>string</code> - Optional - Specifies the instance type for the launched instances. [Allowed values: <code>t1.micro</code>, <code>m1.small</code>, <code>m1.large</code>, <code>m1.xlarge</code>, <code>m2.xlarge</code>, <code>m2.2xlarge</code>, <code>m2.4xlarge</code>, <code>c1.medium</code>, <code>c1.xlarge</code>, <code>cc1.4xlarge</code>, <code>cc2.8xlarge</code>, <code>cg1.4xlarge</code>]</li>
4053
	 * 	<li><code>Placement</code> - <code>array</code> - Optional - Specifies the placement constraints (Availability Zones) for launching the instances. <ul>
4054
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
4055
	 * 			<li><code>AvailabilityZone</code> - <code>string</code> - Optional - The availability zone in which an Amazon EC2 instance runs.</li>
4056
	 * 			<li><code>GroupName</code> - <code>string</code> - Optional - The name of the <code>PlacementGroup</code> in which an Amazon EC2 instance runs. Placement groups are primarily used for launching High Performance Computing instances in the same group to ensure fast connection speeds.</li>
4057
	 * 			<li><code>Tenancy</code> - <code>string</code> - Optional - The allowed tenancy of instances launched into the VPC. A value of default means instances can be launched with any tenancy; a value of dedicated means instances must be launched with tenancy as dedicated.</li>
4058
	 * 		</ul></li>
4059
	 * 	</ul></li>
4060
	 * 	<li><code>KernelId</code> - <code>string</code> - Optional - The ID of the kernel with which to launch the instance.</li>
4061
	 * 	<li><code>RamdiskId</code> - <code>string</code> - Optional - The ID of the RAM disk with which to launch the instance. Some kernels require additional drivers at launch. Check the kernel requirements for information on whether you need to specify a RAM disk. To find kernel requirements, go to the Resource Center and search for the kernel ID.</li>
4062
	 * 	<li><code>BlockDeviceMapping</code> - <code>array</code> - Optional - Specifies how block devices are exposed to the instance. Each mapping is made up of a virtualName and a deviceName. <ul>
4063
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
4064
	 * 			<li><code>VirtualName</code> - <code>string</code> - Optional - Specifies the virtual device name.</li>
4065
	 * 			<li><code>DeviceName</code> - <code>string</code> - Optional - Specifies the device name (e.g., <code>/dev/sdh</code>).</li>
4066
	 * 			<li><code>Ebs</code> - <code>array</code> - Optional - Specifies parameters used to automatically setup Amazon EBS volumes when the instance is launched. <ul>
4067
	 * 				<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
4068
	 * 					<li><code>SnapshotId</code> - <code>string</code> - Optional - The ID of the snapshot from which the volume will be created.</li>
4069
	 * 					<li><code>VolumeSize</code> - <code>integer</code> - Optional - The size of the volume, in gigabytes.</li>
4070
	 * 					<li><code>DeleteOnTermination</code> - <code>boolean</code> - Optional - Specifies whether the Amazon EBS volume is deleted on instance termination.</li>
4071
	 * 				</ul></li>
4072
	 * 			</ul></li>
4073
	 * 			<li><code>NoDevice</code> - <code>string</code> - Optional - Specifies the device name to suppress during instance launch.</li>
4074
	 * 		</ul></li>
4075
	 * 	</ul></li>
4076
	 * 	<li><code>Monitoring.Enabled</code> - <code>boolean</code> - Optional - Enables monitoring for the instance.</li>
4077
	 * 	<li><code>SubnetId</code> - <code>string</code> - Optional - Specifies the subnet ID within which to launch the instance(s) for Amazon Virtual Private Cloud.</li>
4078
	 * 	<li><code>DisableApiTermination</code> - <code>boolean</code> - Optional - Specifies whether the instance can be terminated using the APIs. You must modify this attribute before you can terminate any "locked" instances from the APIs.</li>
4079
	 * 	<li><code>InstanceInitiatedShutdownBehavior</code> - <code>string</code> - Optional - Specifies whether the instance's Amazon EBS volumes are stopped or terminated when the instance is shut down.</li>
4080
	 * 	<li><code>License</code> - <code>array</code> - Optional - Specifies active licenses in use and attached to an Amazon EC2 instance. <ul>
4081
	 * 		<li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
4082
	 * 			<li><code>Pool</code> - <code>string</code> - Optional - The license pool from which to take a license when starting Amazon EC2 instances in the associated <code>RunInstances</code> request.</li>
4083
	 * 		</ul></li>
4084
	 * 	</ul></li>
4085
	 * 	<li><code>PrivateIpAddress</code> - <code>string</code> - Optional - If you're using Amazon Virtual Private Cloud, you can optionally use this parameter to assign the instance a specific available IP address from the subnet.</li>
4086
	 * 	<li><code>ClientToken</code> - <code>string</code> - Optional - Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, go to How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.</li>
4087
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
4088
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
4089
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
4090
	 */
4091
	public function run_instances($image_id, $min_count, $max_count, $opt = null)
4092
	{
4093
		if (!$opt) $opt = array();
4094
		$opt['ImageId'] = $image_id;
4095
		$opt['MinCount'] = $min_count;
4096
		$opt['MaxCount'] = $max_count;
4097
 
4098
		// Optional list (non-map)
4099
		if (isset($opt['SecurityGroup']))
4100
		{
4101
			$opt = array_merge($opt, CFComplexType::map(array(
4102
				'SecurityGroup' => (is_array($opt['SecurityGroup']) ? $opt['SecurityGroup'] : array($opt['SecurityGroup']))
4103
			)));
4104
			unset($opt['SecurityGroup']);
4105
		}
4106
 
4107
		// Optional list (non-map)
4108
		if (isset($opt['SecurityGroupId']))
4109
		{
4110
			$opt = array_merge($opt, CFComplexType::map(array(
4111
				'SecurityGroupId' => (is_array($opt['SecurityGroupId']) ? $opt['SecurityGroupId'] : array($opt['SecurityGroupId']))
4112
			)));
4113
			unset($opt['SecurityGroupId']);
4114
		}
4115
 
4116
		// Optional map (non-list)
4117
		if (isset($opt['Placement']))
4118
		{
4119
			$opt = array_merge($opt, CFComplexType::map(array(
4120
				'Placement' => $opt['Placement']
4121
			)));
4122
			unset($opt['Placement']);
4123
		}
4124
 
4125
		// Optional list + map
4126
		if (isset($opt['BlockDeviceMapping']))
4127
		{
4128
			$opt = array_merge($opt, CFComplexType::map(array(
4129
				'BlockDeviceMapping' => $opt['BlockDeviceMapping']
4130
			)));
4131
			unset($opt['BlockDeviceMapping']);
4132
		}
4133
 
4134
		// Optional map (non-list)
4135
		if (isset($opt['License']))
4136
		{
4137
			$opt = array_merge($opt, CFComplexType::map(array(
4138
				'License' => $opt['License']
4139
			)));
4140
			unset($opt['License']);
4141
		}
4142
 
4143
		return $this->authenticate('RunInstances', $opt);
4144
	}
4145
 
4146
	/**
4147
	 * Starts an instance that uses an Amazon EBS volume as its root device. Instances that use Amazon
4148
	 * EBS volumes as their root devices can be quickly stopped and started. When an instance is
4149
	 * stopped, the compute resources are released and you are not billed for hourly instance usage.
4150
	 * However, your root partition Amazon EBS volume remains, continues to persist your data, and you
4151
	 * are charged for Amazon EBS volume usage. You can restart your instance at any time.
4152
	 *
4153
	 * <p class="note"></p>
4154
	 * Performing this operation on an instance that uses an instance store as its root device returns
4155
	 * an error.
4156
	 *
4157
	 * @param string|array $instance_id (Required) The list of Amazon EC2 instances to start. Pass a string for a single value, or an indexed array for multiple values.
4158
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
4159
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
4160
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
4161
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
4162
	 */
4163
	public function start_instances($instance_id, $opt = null)
4164
	{
4165
		if (!$opt) $opt = array();
4166
 
4167
		// Required list (non-map)
4168
		$opt = array_merge($opt, CFComplexType::map(array(
4169
			'InstanceId' => (is_array($instance_id) ? $instance_id : array($instance_id))
4170
		)));
4171
 
4172
		return $this->authenticate('StartInstances', $opt);
4173
	}
4174
 
4175
	/**
4176
	 * Stops an instance that uses an Amazon EBS volume as its root device. Instances that use Amazon
4177
	 * EBS volumes as their root devices can be quickly stopped and started. When an instance is
4178
	 * stopped, the compute resources are released and you are not billed for hourly instance usage.
4179
	 * However, your root partition Amazon EBS volume remains, continues to persist your data, and you
4180
	 * are charged for Amazon EBS volume usage. You can restart your instance at any time.
4181
	 *
4182
	 * <p class="note"></p>
4183
	 * Before stopping an instance, make sure it is in a state from which it can be restarted.
4184
	 * Stopping an instance does not preserve data stored in RAM.
4185
	 *
4186
	 * Performing this operation on an instance that uses an instance store as its root device returns
4187
	 * an error.
4188
	 *
4189
	 * @param string|array $instance_id (Required) The list of Amazon EC2 instances to stop. Pass a string for a single value, or an indexed array for multiple values.
4190
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
4191
	 * 	<li><code>Force</code> - <code>boolean</code> - Optional - Forces the instance to stop. The instance will not have an opportunity to flush file system caches nor file system meta data. If you use this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances.</li>
4192
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
4193
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
4194
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
4195
	 */
4196
	public function stop_instances($instance_id, $opt = null)
4197
	{
4198
		if (!$opt) $opt = array();
4199
 
4200
		// Required list (non-map)
4201
		$opt = array_merge($opt, CFComplexType::map(array(
4202
			'InstanceId' => (is_array($instance_id) ? $instance_id : array($instance_id))
4203
		)));
4204
 
4205
		return $this->authenticate('StopInstances', $opt);
4206
	}
4207
 
4208
	/**
4209
	 * The TerminateInstances operation shuts down one or more instances. This operation is
4210
	 * idempotent; if you terminate an instance more than once, each call will succeed.
4211
	 *
4212
	 * Terminated instances will remain visible after termination (approximately one hour).
4213
	 *
4214
	 * @param string|array $instance_id (Required) The list of instances to terminate. Pass a string for a single value, or an indexed array for multiple values.
4215
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
4216
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
4217
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
4218
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
4219
	 */
4220
	public function terminate_instances($instance_id, $opt = null)
4221
	{
4222
		if (!$opt) $opt = array();
4223
 
4224
		// Required list (non-map)
4225
		$opt = array_merge($opt, CFComplexType::map(array(
4226
			'InstanceId' => (is_array($instance_id) ? $instance_id : array($instance_id))
4227
		)));
4228
 
4229
		return $this->authenticate('TerminateInstances', $opt);
4230
	}
4231
 
4232
	/**
4233
	 * Disables monitoring for a running instance.
4234
	 *
4235
	 * @param string|array $instance_id (Required) The list of Amazon EC2 instances on which to disable monitoring. Pass a string for a single value, or an indexed array for multiple values.
4236
	 * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
4237
	 * 	<li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
4238
	 * 	<li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
4239
	 * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
4240
	 */
4241
	public function unmonitor_instances($instance_id, $opt = null)
4242
	{
4243
		if (!$opt) $opt = array();
4244
 
4245
		// Required list (non-map)
4246
		$opt = array_merge($opt, CFComplexType::map(array(
4247
			'InstanceId' => (is_array($instance_id) ? $instance_id : array($instance_id))
4248
		)));
4249
 
4250
		return $this->authenticate('UnmonitorInstances', $opt);
4251
	}
4252
}
4253
 
4254
 
4255
/*%******************************************************************************************%*/
4256
// EXCEPTIONS
4257
 
4258
class EC2_Exception extends Exception {}