PageRenderTime 71ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/services/ec2.class.php

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