PageRenderTime 57ms CodeModel.GetById 25ms 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

Large files files are truncated, but you can click here to view the full file

  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 …

Large files files are truncated, but you can click here to view the full file