Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

1.5.1 release. https://aws.amazon.com/releasenotes/PHP/0724070929559591

  • Loading branch information...
commit 116d4c3fe7e4528089ccff8dbf1f0a3c7be1e3ef 1 parent d584e0a
Ryan Parman skyzyx authored amazonwebservices committed
Showing with 2,067 additions and 547 deletions.
  1. +1 −0  .gitignore
  2. +6 −6 _compatibility_test/sdk_compatibility_test.php
  3. +6 −6 _compatibility_test/sdk_compatibility_test_cli.php
  4. +65 −6 _docs/CHANGELOG.md
  5. +4 −0 _docs/CONTRIBUTORS.md
  6. +1 −1  _docs/NOTICE.md
  7. +1 −1  _samples/cli-ec2_sorting_and_filtering.php
  8. +1 −1  _samples/cli-s3_get_urls_for_uploads.php
  9. +1 −1  _samples/cli-s3_progress_bar.php
  10. +1 −1  _samples/html-sdb_create_domain_data.php
  11. +1 −1  authentication/signable.interface.php
  12. +1 −1  authentication/signature_v2query.class.php
  13. +235 −0 authentication/signature_v3json.class.php
  14. +1 −1  authentication/signature_v3query.class.php
  15. +1 −1  authentication/signer.abstract.php
  16. +1 −1  extensions/s3browserupload.class.php
  17. +6 −4 extensions/s3streamwrapper.class.php
  18. +6 −7 lib/requestcore/requestcore.class.php
  19. +8 −8 package.xml
  20. +121 −81 sdk.class.php
  21. +322 −94 services/as.class.php
  22. +78 −70 services/cloudfront.class.php
  23. +3 −8 services/cloudwatch.class.php
  24. +806 −0 services/dynamodb.class.php
  25. +2 −3 services/ec2.class.php
  26. +32 −34 services/elasticache.class.php
  27. +2 −2 services/elasticbeanstalk.class.php
  28. +4 −4 services/elb.class.php
  29. +3 −3 services/emr.class.php
  30. +2 −2 services/importexport.class.php
  31. +64 −46 services/rds.class.php
  32. +63 −72 services/s3.class.php
  33. +2 −2 services/sdb.class.php
  34. +35 −5 services/ses.class.php
  35. +85 −15 services/sns.class.php
  36. +16 −17 services/sts.class.php
  37. +14 −3 utilities/array.class.php
  38. +1 −1  utilities/batchrequest.class.php
  39. +1 −1  utilities/complextype.class.php
  40. +14 −1 utilities/credential.class.php
  41. +2 −2 utilities/credentials.class.php
  42. +1 −1  utilities/gzipdecode.class.php
  43. +1 −1  utilities/hadoopbase.class.php
  44. +1 −1  utilities/hadoopbootstrap.class.php
  45. +1 −1  utilities/hadoopstep.class.php
  46. +1 −1  utilities/info.class.php
  47. +28 −19 utilities/json.class.php
  48. +1 −1  utilities/manifest.class.php
  49. +1 −1  utilities/mimetypes.class.php
  50. +1 −1  utilities/policy.class.php
  51. +1 −1  utilities/request.class.php
  52. +1 −1  utilities/response.class.php
  53. +2 −2 utilities/simplexml.class.php
  54. +1 −1  utilities/stacktemplate.class.php
  55. +1 −1  utilities/stepconfig.class.php
  56. +6 −1 utilities/utilities.class.php
1  .gitignore
View
@@ -10,4 +10,5 @@ build
*output*
*_coverage_report*
_tests
+_vanity
*~
12 _compatibility_test/sdk_compatibility_test.php
View
@@ -289,14 +289,14 @@
// Other
$int64_ok = (PHP_INT_MAX === 9223372036854775807);
-$ini_memory_limit = get_cfg_var('memory_limit');
-$ini_open_basedir = get_cfg_ini('open_basedir');
-$ini_safe_mode = get_cfg_ini('safe_mode');
-$ini_zend_enable_gc = get_cfg_ini('zend.enable_gc');
+$ini_memory_limit = get_ini('memory_limit');
+$ini_open_basedir = get_ini('open_basedir');
+$ini_safe_mode = get_ini('safe_mode');
+$ini_zend_enable_gc = get_ini('zend.enable_gc');
-function get_cfg_ini($config)
+function get_ini($config)
{
- $cfg_value = get_cfg_var($config);
+ $cfg_value = ini_get($config);
if ($cfg_value === false || $cfg_value === '' || $cfg_value === 0)
{
12 _compatibility_test/sdk_compatibility_test_cli.php
View
@@ -32,14 +32,14 @@
// Other
$int64_ok = (PHP_INT_MAX === 9223372036854775807);
-$ini_memory_limit = get_cfg_var('memory_limit');
-$ini_open_basedir = get_cfg_ini('open_basedir');
-$ini_safe_mode = get_cfg_ini('safe_mode');
-$ini_zend_enable_gc = get_cfg_ini('zend.enable_gc');
+$ini_memory_limit = get_ini('memory_limit');
+$ini_open_basedir = get_ini('open_basedir');
+$ini_safe_mode = get_ini('safe_mode');
+$ini_zend_enable_gc = get_ini('zend.enable_gc');
-function get_cfg_ini($config)
+function get_ini($config)
{
- $cfg_value = get_cfg_var($config);
+ $cfg_value = ini_get($config);
if ($cfg_value === false || $cfg_value === '' || $cfg_value === 0)
{
71 _docs/CHANGELOG.md
View
@@ -1,15 +1,74 @@
+# Changelog: 1.5.1 "Blue"
+Code name for Macintosh System 7. <http://en.wikipedia.org/wiki/System_7>
+
+Launched Wednesday, January 18, 2012.
+
+## Bug fixes and enhancements
+* [Documentation patch](https://github.com/amazonwebservices/aws-sdk-for-php/pull/13)
+* [Removed duplicate comment line.](https://github.com/amazonwebservices/aws-sdk-for-php/pull/17)
+* [CFRuntime credentials handling issue](https://forums.aws.amazon.com/thread.jspa?messageID=310388)
+* [PHP 5.2 bug in AWS SDK for PHP 1.5.x](https://forums.aws.amazon.com/thread.jspa?messageID=311543)
+* [[Bug] Custom Curl Opts Lost During Retry](https://forums.aws.amazon.com/thread.jspa?threadID=84835)
+* [json_last_error doesn't exist before php v 5.3.0](https://github.com/amazonwebservices/aws-sdk-for-php/pull/12)
+* [XML still being parsed when use_cache_flow is false](https://github.com/amazonwebservices/aws-sdk-for-php/pull/15)
+* [Bug ssl_verification option not respected for AmazonS3 ](https://forums.aws.amazon.com/thread.jspa?threadID=83710)
+* [[Bug] Compatibility test for Garbage Collector enabled should use ini_get](https://forums.aws.amazon.com/thread.jspa?threadID=84156)
+
+## Runtime
+* **Fixed:** Corrected an issue where calling `AmazonS3->get_object()` would continue to parse the content if caching was being leveraged. (Thanks [Eric Caron](http://www.ericcaron.com)!)
+* **Fixed:** The autoloader now returns `false` for any class it doesn't match, allowing subsequent autoloaders to catch the class name. (Thanks [Eric Caron](http://www.ericcaron.com)!)
+* **Fixed:** An issue that caused CloudWatch to fail to decompress gzipped data correctly has been resolved.
+* **Fixed:** Resolved an issue with passing explicit credentials without requiring a config file or a `CFCredentials` declaration.
+* **Fixed:** Resolved an issue which causes custom cURL options to be unset from the payload when retrying.
+
+## Services
+### AmazonAS
+* **New:** Support for Amazon SNS notifications and Tagging have been added to the SDK.
+
+### AmazonCloudFront
+* **Fixed:** Resolved an issue with disabling SSL verification.
+* **Fixed:** Resolved an issue where `AmazonCloudFront` were throwing warnings in `E_STRICT` mode.
+
+### AmazonCloudWatch
+* **Fixed:** Resolved an issue with decompressing gzipped data.
+
+### AmazonDynamoDB
+* **New:** Support for Amazon DynamoDB has been added to the SDK.
+* **New:** Amazon DynamoDB requires a default cache configuration to be set in the credential set, otherwise it will not function properly.
+
+### AmazonS3
+* **Fixed:** Resolved an issue with disabling SSL verification.
+* **Fixed:** Resolved multiple documentation issues. (Thanks [Aizat Faiz](http://aizatto.com) and [Jason Ardell](http://ardell.posterous.com/)!)
+* **Fixed:** Resolved an issue where `AmazonS3` were throwing warnings in `E_STRICT` mode.
+
+### AmazonSNS
+* **New:** Support for Short Messaging Service (SMS) endpoints has been added to the SDK.
+* **New:** Support for Subscription Attributes has been added to the SDK.
+
+## Utilities
+### CFJSON
+* **Fixed:** Support for the handling of JSON nulls in PHP 5.2 has been improved. (Thanks [David Chan](http://www.chandeeland.org)!)
+
+## Compatibility Test
+* **Fixed:** The SDK compatibility test now uses `ini_get()` instead of `get_cfg_var()` and `get_cfg_ini()` for more accurate test results.
+
+
+----
+
# Changelog: 1.5 "Allegro"
Code name for Mac OS 8.5. <http://en.wikipedia.org/wiki/Mac_OS_8#Mac_OS_8.5>
+Launched Wednesday, December 14, 2011
+
## Credentials
-!! BACKWARDS-INCOMPATIBLE CHANGE !! - The function signature of all service constructors has changed. Instead of passing a key and secret as the first and second parameters, the constructor now accepts a hash (associative array) containing `key` and `secret` keys. Please see the API reference documentation
+* !! BACKWARDS-INCOMPATIBLE CHANGE !! - The function signature of all service constructors has changed. Instead of passing a key and secret as the first and second parameters, the constructor now accepts a hash (associative array) containing `key` and `secret` keys. Please see the API reference documentation
## Runtime
-!! BACKWARDS-INCOMPATIBLE CHANGE !! - The function signature of all service constructors has changed. Instead of passing a key and secret as the first and second parameters, the constructor now accepts a hash (associative array) containing `key` and `secret` keys. If you are explicitly passing a key and secret to the constructor, you will need to change your code. If you are simply inheriting your default credentials from a config file, you don't need to make any changes beyond upgrading your config file to the new 1.5 format. Please see the API reference documentation for more information.
-!! BACKWARDS-INCOMPATIBLE CHANGE !! - The method by which the `config.inc.php` file maintains its list of credentials has been re-factored and updated to support managing multiple sets of credentials in a single location (e.g., development, staging, production).
-!! BACKWARDS-INCOMPATIBLE CHANGE !! - The `init()` method has been renamed to `factory()` to better reflect what it actually does.
-!! BACKWARDS-INCOMPATIBLE CHANGE !! - The `adjust_offset()` method has been removed. Instead, please ensure that the machine's time is set correctly using an [NTP server](https://secure.wikimedia.org/wikipedia/en/wiki/Network_Time_Protocol).
-!! BACKWARDS-INCOMPATIBLE CHANGE !! - In version 1.4 we enabled a mode where -- for services that supported it -- a set of temporary credentials were fetched and cached before the first request. This functionality has been reverted. The use of short-term credentials must be explicitly enabled by instantiating the `AmazonSTS` class and passing those credentials into the service constructor.
+* !! BACKWARDS-INCOMPATIBLE CHANGE !! - The function signature of all service constructors has changed. Instead of passing a key and secret as the first and second parameters, the constructor now accepts a hash (associative array) containing `key` and `secret` keys. If you are explicitly passing a key and secret to the constructor, you will need to change your code. If you are simply inheriting your default credentials from a config file, you don't need to make any changes beyond upgrading your config file to the new 1.5 format. Please see the API reference documentation for more information.
+* !! BACKWARDS-INCOMPATIBLE CHANGE !! - The method by which the `config.inc.php` file maintains its list of credentials has been re-factored and updated to support managing multiple sets of credentials in a single location (e.g., development, staging, production).
+* !! BACKWARDS-INCOMPATIBLE CHANGE !! - The `init()` method has been renamed to `factory()` to better reflect what it actually does.
+* !! BACKWARDS-INCOMPATIBLE CHANGE !! - The `adjust_offset()` method has been removed. Instead, please ensure that the machine's time is set correctly using an [NTP server](https://secure.wikimedia.org/wikipedia/en/wiki/Network_Time_Protocol).
+* !! BACKWARDS-INCOMPATIBLE CHANGE !! - In version 1.4 we enabled a mode where -- for services that supported it -- a set of temporary credentials were fetched and cached before the first request. This functionality has been reverted. The use of short-term credentials must be explicitly enabled by instantiating the `AmazonSTS` class and passing those credentials into the service constructor.
* **New:** Improved the user directory lookup for the config file.
* **Changed:** Made `set_region()` an alias of `set_hostname()`.
4 _docs/CONTRIBUTORS.md
View
@@ -7,7 +7,11 @@ Contributions were provided under the Apache 2.0 License, as appropriate.
The following people have provided ideas, support and bug fixes:
* [arech8](http://developer.amazonwebservices.com/connect/profile.jspa?userID=154435) (bug fixes)
+* [Aizat Faiz](http://aizatto.com) (bug fixes)
* [Ben Lumley](http://github.com/benlumley) (bug fixes)
+* [David Chan](http://www.chandeeland.org) (bug fixes)
+* [Eric Caron](http://www.ericcaron.com) (bug fixes)
+* [Jason Ardell](http://ardell.posterous.com/) (bug fixes)
* [Jeremy Archuleta](http://code.google.com/u/jeremy.archuleta/) (bug fixes)
* [Paul Voegler](mailto:voegler@gmx.de) (bug fixes, bug reports, patches)
* [Peter Bowen](http://github.com/pzb) (feedback, bug reports)
2  _docs/NOTICE.md
View
@@ -9,7 +9,7 @@ See below for complete copyright and licensing notices.
<http://aws.amazon.com/php>
-Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License").
You may not use this file except in compliance with the License.
2  _samples/cli-ec2_sorting_and_filtering.php
View
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
2  _samples/cli-s3_get_urls_for_uploads.php
View
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
2  _samples/cli-s3_progress_bar.php
View
@@ -1,7 +1,7 @@
#! /usr/bin/env php
<?php
/*
- * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
2  _samples/html-sdb_create_domain_data.php
View
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
2  authentication/signable.interface.php
View
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
2  authentication/signature_v2query.class.php
View
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
235 authentication/signature_v3json.class.php
View
@@ -0,0 +1,235 @@
+<?php
+/*
+ * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+
+/*%******************************************************************************************%*/
+// CLASS
+
+/**
+ * Implements support for Signature v3 (JSON).
+ *
+ * @version 2011.12.08
+ * @license See the included NOTICE.md file for more information.
+ * @copyright See the included NOTICE.md file for more information.
+ * @link http://aws.amazon.com/php/ PHP Developer Center
+ */
+class AuthV3JSON extends Signer implements Signable
+{
+ /**
+ * Constructs a new instance of the <AuthV3JSON> class.
+ *
+ * @param string $endpoint (Required) The endpoint to direct the request to.
+ * @param string $operation (Required) The operation to execute as a result of this request.
+ * @param array $payload (Required) The options to use as part of the payload in the request.
+ * @param CFCredential $credentials (Required) The credentials to use for signing and making requests.
+ * @return void
+ */
+ public function __construct($endpoint, $operation, $payload, CFCredential $credentials)
+ {
+ parent::__construct($endpoint, $operation, $payload, $credentials);
+ }
+
+ /**
+ * Generates a cURL handle with all of the required authentication bits set.
+ *
+ * @return resource A cURL handle ready for executing.
+ */
+ public function authenticate()
+ {
+ // Determine signing values
+ $current_time = time();
+ $date = gmdate(CFUtilities::DATE_FORMAT_RFC2616, $current_time);
+ $timestamp = gmdate(CFUtilities::DATE_FORMAT_ISO8601, $current_time);
+ $nonce = $this->util->generate_guid();
+ $curlopts = array();
+ $signed_headers = array();
+ $return_curl_handle = false;
+ $x_amz_target = null;
+ $query = array('body' => $this->payload);
+
+ // Do we have an authentication token?
+ if ($this->auth_token)
+ {
+ $headers['X-Amz-Security-Token'] = $this->auth_token;
+ $query['SecurityToken'] = $this->auth_token;
+ }
+
+ // Manage the key-value pairs that are used in the query.
+ if (stripos($this->operation, 'x-amz-target') !== false)
+ {
+ $x_amz_target = trim(str_ireplace('x-amz-target:', '', $this->operation));
+ }
+ else
+ {
+ $query['Action'] = $this->operation;
+ }
+
+ // Only add it if it exists.
+ if ($this->api_version)
+ {
+ $query['Version'] = $this->api_version;
+ }
+
+ $curlopts = array();
+
+ // Set custom CURLOPT settings
+ if (is_array($this->payload) && isset($this->payload['curlopts']))
+ {
+ $curlopts = $this->payload['curlopts'];
+ unset($this->payload['curlopts']);
+ }
+
+ // Merge in any options that were passed in
+ if (is_array($this->payload))
+ {
+ $query = array_merge($query, $this->payload);
+ }
+
+ $return_curl_handle = isset($query['returnCurlHandle']) ? $query['returnCurlHandle'] : false;
+ unset($query['returnCurlHandle']);
+
+ // Do a case-sensitive, natural order sort on the array keys.
+ uksort($query, 'strcmp');
+
+ // Normalize JSON input
+ if (isset($query['body']) && $query['body'] === '[]')
+ {
+ $query['body'] = '{}';
+ }
+
+ // Create the string that needs to be hashed.
+ $canonical_query_string = $this->util->encode_signature2($query['body']);
+
+ // Remove the default scheme from the domain.
+ $domain = str_replace(array('http://', 'https://'), '', $this->endpoint);
+
+ // Parse our request.
+ $parsed_url = parse_url('http://' . $domain);
+
+ // Set the proper host header.
+ if (isset($parsed_url['port']) && (integer) $parsed_url['port'] !== 80 && (integer) $parsed_url['port'] !== 443)
+ {
+ $host_header = strtolower($parsed_url['host']) . ':' . $parsed_url['port'];
+ }
+ else
+ {
+ $host_header = strtolower($parsed_url['host']);
+ }
+
+ // Set the proper request URI.
+ $request_uri = isset($parsed_url['path']) ? $parsed_url['path'] : '/';
+
+ // Generate the querystring from $query
+ $this->querystring = $this->util->to_query_string($query);
+
+ // Gather information to pass along to other classes.
+ $helpers = array(
+ 'utilities' => $this->utilities_class,
+ 'request' => $this->request_class,
+ 'response' => $this->response_class,
+ );
+
+ // Compose the request.
+ $request_url = ($this->use_ssl ? 'https://' : 'http://') . $domain;
+ $request_url .= !isset($parsed_url['path']) ? '/' : '';
+
+ // Instantiate the request class
+ $request = new $this->request_class($request_url, $this->proxy, $helpers, $this->credentials);
+ $request->set_method('POST');
+ $request->set_body($this->querystring);
+ $headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8';
+
+ // Signing using X-Amz-Target is handled differently.
+ $headers['X-Amz-Target'] = $x_amz_target;
+ $headers['Content-Type'] = 'application/x-amz-json-1.0';
+ $request->set_body($query['body']);
+ $this->querystring = $query['body'];
+
+ // Pass along registered stream callbacks
+ if ($this->registered_streaming_read_callback)
+ {
+ $request->register_streaming_read_callback($this->registered_streaming_read_callback);
+ }
+
+ if ($this->registered_streaming_write_callback)
+ {
+ $request->register_streaming_write_callback($this->registered_streaming_write_callback);
+ }
+
+ // Add authentication headers
+ // $headers['X-Amz-Nonce'] = $nonce;
+ $headers['Date'] = $date;
+ $headers['Content-Length'] = strlen($this->querystring);
+ $headers['Content-MD5'] = $this->util->hex_to_base64(md5($this->querystring));
+ $headers['Host'] = $host_header;
+
+ // Sort headers
+ uksort($headers, 'strnatcasecmp');
+
+ // Prepare the string to sign (HTTP)
+ $this->string_to_sign = "POST\n$request_uri\n\n";
+
+ // Add headers to request and compute the string to sign
+ foreach ($headers as $header_key => $header_value)
+ {
+ // Strip linebreaks from header values as they're illegal and can allow for security issues
+ $header_value = str_replace(array("\r", "\n"), '', $header_value);
+
+ // Add the header if it has a value
+ if ($header_value !== '')
+ {
+ $request->add_header($header_key, $header_value);
+ }
+
+ // Generate the string to sign
+ if (
+ substr(strtolower($header_key), 0, 8) === 'content-' ||
+ strtolower($header_key) === 'date' ||
+ strtolower($header_key) === 'expires' ||
+ strtolower($header_key) === 'host' ||
+ substr(strtolower($header_key), 0, 6) === 'x-amz-'
+ )
+ {
+ $this->string_to_sign .= strtolower($header_key) . ':' . $header_value . "\n";
+ $signed_headers[] = $header_key;
+ }
+ }
+
+ $this->string_to_sign .= "\n";
+
+ if (isset($query['body']) && $query['body'] !== '')
+ {
+ $this->string_to_sign .= $query['body'];
+ }
+
+ // Convert from string-to-sign to bytes-to-sign
+ $bytes_to_sign = hash('sha256', $this->string_to_sign, true);
+
+ // Hash the AWS secret key and generate a signature for the request.
+ $signature = base64_encode(hash_hmac('sha256', $bytes_to_sign, $this->secret_key, true));
+
+ $headers['X-Amzn-Authorization'] = 'AWS3'
+ . ' AWSAccessKeyId=' . $this->key
+ . ',Algorithm=HmacSHA256'
+ . ',SignedHeaders=' . implode(';', $signed_headers)
+ . ',Signature=' . $signature;
+
+ $request->add_header('X-Amzn-Authorization', $headers['X-Amzn-Authorization']);
+ $request->request_headers = $headers;
+
+ return $request;
+ }
+}
2  authentication/signature_v3query.class.php
View
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
2  authentication/signer.abstract.php
View
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
2  extensions/s3browserupload.class.php
View
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
10 extensions/s3streamwrapper.class.php
View
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
@@ -161,8 +161,10 @@ public function dir_rewinddir()
* @param integer $options (Optional) Regions. [Allowed values: `S3StreamWrapper::REGION_US_E1`, `S3StreamWrapper::REGION_US_W1`, `S3StreamWrapper::REGION_EU_W1`, `S3StreamWrapper::REGION_APAC_NE1`, `S3StreamWrapper::REGION_APAC_SE1`]
* @return boolean Whether the bucket was created successfully or not.
*/
- public function mkdir($path, $mode = 0, $options = 1)
+ public function mkdir($path, $mode, $options)
{
+ $mode = 0;
+ $options = 1;
self::__construct();
$url = parse_url($path);
@@ -283,7 +285,7 @@ public function rename($path_from, $path_to)
* @param boolean $force (Optional) Whether to force-delete the bucket or not. The default value is <code>false</code>.
* @return boolean Whether the bucket was deleted successfully or not.
*/
- public function rmdir($path, $force = false)
+ public function rmdir($path, $options)
{
self::__construct();
@@ -291,7 +293,7 @@ public function rmdir($path, $force = false)
$this->path = $path;
$bucket_name = $url['host'];
- $response = $this->delete_bucket($bucket_name, $force);
+ $response = $this->delete_bucket($bucket_name);
return $response->isOK();
}
13 lib/requestcore/requestcore.class.php
View
@@ -2,7 +2,7 @@
/**
* Handles all HTTP requests using cURL and manages the responses.
*
- * @version 2011.06.07
+ * @version 2012.01.17
* @copyright 2006-2011 Ryan Parman
* @copyright 2006-2010 Foleeo Inc.
* @copyright 2010-2011 Amazon.com, Inc. or its affiliates.
@@ -99,7 +99,7 @@ class RequestCore
/**
* Default useragent string to use.
*/
- public $useragent = 'RequestCore/1.4.3';
+ public $useragent = 'RequestCore/1.4.4';
/**
* File to read from while streaming up.
@@ -821,7 +821,7 @@ public function send_request($parse = false)
if ($this->response === false)
{
- throw new RequestCore_Exception('cURL resource: ' . (string) $curl_handle . '; cURL error: ' . curl_error($curl_handle) . ' (' . curl_errno($curl_handle) . ')');
+ throw new cURL_Exception('cURL resource: ' . (string) $curl_handle . '; cURL error: ' . curl_error($curl_handle) . ' (cURL error code ' . curl_errno($curl_handle) . '). See http://curl.haxx.se/libcurl/c/libcurl-errors.html for an explanation of error codes.');
}
$parsed_response = $this->process_response($curl_handle, $this->response);
@@ -894,7 +894,7 @@ public function send_multi_request($handles, $opt = null)
// Since curl_errno() isn't reliable for handles that were in multirequests, we check the 'result' of the info read, which contains the curl error number, (listed here http://curl.haxx.se/libcurl/c/libcurl-errors.html )
if ($done['result'] > 0)
{
- throw new RequestCore_Exception('cURL resource: ' . (string) $done['handle'] . '; cURL error: ' . curl_error($done['handle']) . ' (' . $done['result'] . ')');
+ throw new cURL_Multi_Exception('cURL resource: ' . (string) $done['handle'] . '; cURL error: ' . curl_error($done['handle']) . ' (cURL error code ' . $done['result'] . '). See http://curl.haxx.se/libcurl/c/libcurl-errors.html for an explanation of error codes.');
}
// Because curl_multi_info_read() might return more than one message about a request, we check to see if this request is already in our array of completed requests
@@ -1023,7 +1023,6 @@ public function isOK($codes = array(200, 201, 204, 206))
}
}
-/**
- * Default RequestCore Exception.
- */
+class cURL_Exception extends Exception {}
+class cURL_Multi_Exception extends cURL_Exception {}
class RequestCore_Exception extends Exception {}
16 package.xml
View
8 additions, 8 deletions not shown
202 sdk.class.php
View
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
@@ -23,6 +23,11 @@
*/
class CFRuntime_Exception extends Exception {}
+/**
+ * Parsing Exception.
+ */
+class Parser_Exception extends Exception {}
+
/*%******************************************************************************************%*/
// DETERMINE WHAT ENVIRONMENT DATA TO ADD TO THE USERAGENT FOR METRIC TRACKING
@@ -81,7 +86,7 @@ function __aws_sdk_ua_callback()
foreach (array('memory_limit', 'date.timezone', 'open_basedir', 'safe_mode', 'zend.enable_gc') as $cfg)
{
- $cfg_value = get_cfg_var($cfg);
+ $cfg_value = ini_get($cfg);
if (in_array($cfg, array('memory_limit', 'date.timezone'), true))
{
@@ -110,9 +115,9 @@ function __aws_sdk_ua_callback()
// INTERMEDIARY CONSTANTS
define('CFRUNTIME_NAME', 'aws-sdk-php');
-define('CFRUNTIME_VERSION', '1.5.0.1');
+define('CFRUNTIME_VERSION', '1.5.1');
// define('CFRUNTIME_BUILD', gmdate('YmdHis', filemtime(__FILE__))); // @todo: Hardcode for release.
-define('CFRUNTIME_BUILD', '20111221014733');
+define('CFRUNTIME_BUILD', '2012011811285200');
define('CFRUNTIME_USERAGENT', CFRUNTIME_NAME . '/' . CFRUNTIME_VERSION . ' PHP/' . PHP_VERSION . ' ' . str_replace(' ', '_', php_uname('s')) . '/' . str_replace(' ', '_', php_uname('r')) . ' Arch/' . php_uname('m') . ' SAPI/' . php_sapi_name() . ' Integer/' . PHP_INT_MAX . ' Build/' . CFRUNTIME_BUILD . __aws_sdk_ua_callback());
@@ -123,7 +128,7 @@ function __aws_sdk_ua_callback()
* Core functionality and default settings shared across all SDK classes. All methods and properties in this
* class are inherited by the service-specific classes.
*
- * @version 2011.11.18
+ * @version 2012.01.17
* @license See the included NOTICE.md file for more information.
* @copyright See the included NOTICE.md file for more information.
* @link http://aws.amazon.com/php/ PHP Developer Center
@@ -218,11 +223,6 @@ class CFRuntime
public $batch_class = 'CFBatchRequest';
/**
- * The number of seconds to adjust the request timestamp by (defaults to 0).
- */
- public $adjust_offset = 0;
-
- /**
* The state of SSL/HTTPS use.
*/
public $use_ssl = true;
@@ -357,6 +357,11 @@ class CFRuntime
*/
public $redirects = 0;
+ /**
+ * The state of whether the response should be parsed or not.
+ */
+ public $parse_the_response = true;
+
/*%******************************************************************************************%*/
// CONSTRUCTOR
@@ -382,31 +387,46 @@ public function __construct(array $options = array())
// Determine the current service.
$this->service = get_class($this);
- // Store the requested credentials
- $this->credentials = CFCredentials::get(
- (isset($options['credentials']) ? $options['credentials'] : CFCredentials::DEFAULT_KEY)
- );
- $this->credentials = new CFCredential(array_merge($this->credentials->to_array(), $options));
-
- // Automatically enable whichever caching mechanism is set to default.
- $this->set_cache_config($this->credentials->default_cache_config);
+ // Create credentials based on the options
+ $instance_credentials = new CFCredential($options);
- if (isset($options['key']) && isset($options['secret']))
+ // Retreive a credential set from config.inc.php if it exists
+ if (isset($options['credentials']))
{
- $this->key = $options['key'];
- $this->secret_key = $options['secret'];
- $this->auth_token = isset($options['token']) ? $options['token'] : null;
-
- return;
+ // Use a specific credential set and merge with the instance credentials
+ $this->credentials = CFCredentials::get($options['credentials'])
+ ->merge($instance_credentials);
}
else
{
- $this->key = $this->credentials->key;
- $this->secret_key = $this->credentials->secret;
- $this->auth_token = $this->credentials->token;
-
- return;
+ try
+ {
+ // Use the default credential set and merge with the instance credentials
+ $this->credentials = CFCredentials::get(CFCredentials::DEFAULT_KEY)
+ ->merge($instance_credentials);
+ }
+ catch (CFCredentials_Exception $e)
+ {
+ if (isset($options['key']) && isset($options['secret']))
+ {
+ // Only the instance credentials were provided
+ $this->credentials = $instance_credentials;
+ }
+ else
+ {
+ // No credentials provided in the config file or constructor
+ throw new CFCredentials_Exception('No credentials were provided to ' . $this->service . '.');
+ }
+ }
}
+
+ // Set internal credentials after they are resolved
+ $this->key = $this->credentials->key;
+ $this->secret_key = $this->credentials->secret;
+ $this->auth_token = $this->credentials->token;
+
+ // Automatically enable whichever caching mechanism is set to default.
+ $this->set_cache_config($this->credentials->default_cache_config);
}
/**
@@ -759,18 +779,22 @@ public function set_batch_class($class = 'CFBatchRequest')
/**
* Default, shared method for authenticating a connection to AWS.
*
+ * @param string $operation (Required) Indicates the operation to perform.
+ * @param array $payload (Required) An associative array of parameters for authenticating. See the individual methods for allowed keys.
* @return CFResponse Object containing a parsed HTTP response.
*/
public function authenticate($operation, $payload)
{
+ $original_payload = $payload;
+ $method_arguments = func_get_args();
+ $curlopts = array();
+ $return_curl_handle = false;
+
if (substr($operation, 0, strlen($this->operation_prefix)) !== $this->operation_prefix)
{
$operation = $this->operation_prefix . $operation;
}
- $method_arguments = func_get_args();
- $curlopts = array();
-
// Extract the custom CURLOPT settings from the payload
if (is_array($payload) && isset($payload['curlopts']))
{
@@ -779,8 +803,11 @@ public function authenticate($operation, $payload)
}
// Determine whether the response or curl handle should be returned
- $return_curl_handle = isset($payload['returnCurlHandle']) ? $payload['returnCurlHandle'] : false;
- unset($payload['returnCurlHandle']);
+ if (is_array($payload) && isset($payload['returnCurlHandle']))
+ {
+ $return_curl_handle = isset($payload['returnCurlHandle']) ? $payload['returnCurlHandle'] : false;
+ unset($payload['returnCurlHandle']);
+ }
// Use the caching flow to determine if we need to do a round-trip to the server.
if ($this->use_cache_flow)
@@ -865,14 +892,19 @@ public function authenticate($operation, $payload)
// Prepare the response.
$headers = $request->get_response_header();
$headers['x-aws-stringtosign'] = $signer->string_to_sign;
+
+ if (isset($signer->canonical_request))
+ {
+ $headers['x-aws-canonicalrequest'] = $signer->canonical_request;
+ }
+
$headers['x-aws-request-headers'] = $request->request_headers;
$headers['x-aws-body'] = $signer->querystring;
- $data = new $this->response_class($headers, $this->parse_callback($request->get_response_body(), $headers), $request->get_response_code());
+ $data = new $this->response_class($headers, ($this->parse_the_response === true) ? $this->parse_callback($request->get_response_body()) : $request->get_response_body(), $request->get_response_code());
// Was it Amazon's fault the request failed? Retry the request until we reach $max_retries.
if (
- ((integer) $request->get_response_code() === 400 && (string) $request->get_response_body() === '{"__type": "com.amazon.coral.availability#ThrottlingException"}') || // Bad Request (throttled)
(integer) $request->get_response_code() === 500 || // Internal Error (presumably transient)
(integer) $request->get_response_code() === 503) // Service Unavailable (presumably transient)
{
@@ -882,7 +914,30 @@ public function authenticate($operation, $payload)
$delay = (integer) (pow(4, $this->redirects) * 100000);
usleep($delay);
$this->redirects++;
- $data = $this->authenticate($operation, $payload);
+ $data = $this->authenticate($operation, $original_payload);
+ }
+ }
+
+ // DynamoDB has custom logic
+ elseif (
+ (integer) $request->get_response_code() === 400 &&
+ stripos((string) $request->get_response_body(), 'com.amazonaws.dynamodb.') !== false && (
+ stripos((string) $request->get_response_body(), 'ProvisionedThroughputExceededException') !== false
+ )
+ )
+ {
+ if ($this->redirects === 0)
+ {
+ $this->redirects++;
+ $data = $this->authenticate($operation, $original_payload);
+ }
+ elseif ($this->redirects <= max($this->max_retries, 10))
+ {
+ // Exponential backoff
+ $delay = (integer) (pow(2, ($this->redirects - 1)) * 50000);
+ usleep($delay);
+ $this->redirects++;
+ $data = $this->authenticate($operation, $original_payload);
}
}
@@ -1022,47 +1077,21 @@ public function parse_callback($response, $headers = null)
{
case 'gzip':
case 'x-gzip':
- if (strpos($headers['_info']['url'], 'monitoring.') !== false)
+ $decoder = new CFGzipDecode($body);
+ if ($decoder->parse())
{
- // CloudWatch incorrectly uses the deflate algorithm when they say gzip.
- if (($uncompressed = gzuncompress($body)) !== false)
- {
- $body = $uncompressed;
- }
- elseif (($uncompressed = gzinflate($body)) !== false)
- {
- $body = $uncompressed;
- }
- break;
- }
- else
- {
- // Everyone else uses gzip correctly.
- $decoder = new CFGzipDecode($body);
- if ($decoder->parse())
- {
- $body = $decoder->data;
- }
- break;
+ $body = $decoder->data;
}
+ break;
case 'deflate':
- if (strpos($headers['_info']['url'], 'monitoring.') !== false)
+ if (($uncompressed = gzuncompress($body)) !== false)
{
- // CloudWatch incorrectly does nothing when they say deflate.
- continue;
+ $body = $uncompressed;
}
- else
+ elseif (($uncompressed = gzinflate($body)) !== false)
{
- // Everyone else uses deflate correctly.
- if (($uncompressed = gzuncompress($body)) !== false)
- {
- $body = $uncompressed;
- }
- elseif (($uncompressed = gzinflate($body)) !== false)
- {
- $body = $uncompressed;
- }
+ $body = $uncompressed;
}
break;
}
@@ -1077,8 +1106,14 @@ public function parse_callback($response, $headers = null)
// Strip the default XML namespace to simplify XPath expressions
$body = str_replace("xmlns=", "ns=", $body);
- // Parse the XML body
- $body = new $this->parser_class($body);
+ try {
+ // Parse the XML body
+ $body = new $this->parser_class($body);
+ }
+ catch (Exception $e)
+ {
+ throw new Parser_Exception($e->getMessage());
+ }
}
// Look for JSON cues
elseif (
@@ -1143,19 +1178,17 @@ public function cache($expires)
* this method is cached. Accepts identical parameters as the <authenticate()> method. Never call this
* method directly -- it is used internally by the caching system.
*
- * @param string $action (Required) Indicates the action to perform.
- * @param array $opt (Optional) An associative array of parameters for authenticating. See the individual methods for allowed keys.
- * @param string $domain (Optional) The URL of the queue to perform the action on.
- * @param integer $signature_version (Optional) The signature version to use. Defaults to 2.
+ * @param string $operation (Required) Indicates the operation to perform.
+ * @param array $payload (Required) An associative array of parameters for authenticating. See the individual methods for allowed keys.
* @return CFResponse A parsed HTTP response.
*/
- public function cache_callback($action, $opt = null, $domain = null, $signature_version = 2)
+ public function cache_callback($operation, $payload)
{
// Disable the cache flow since it's already been handled.
$this->use_cache_flow = false;
// Make the request
- $response = $this->authenticate($action, $opt, $domain, $signature_version);
+ $response = $this->authenticate($operation, $payload);
// If this is an XML document, convert it back to a string.
if (isset($response->body) && ($response->body instanceof SimpleXMLElement))
@@ -1216,30 +1249,35 @@ public static function autoloader($class)
if (strstr($class, 'Amazon'))
{
require_once $path . 'services' . DIRECTORY_SEPARATOR . str_ireplace('Amazon', '', strtolower($class)) . '.class.php';
+ return true;
}
// Utility classes
elseif (strstr($class, 'CF'))
{
require_once $path . 'utilities' . DIRECTORY_SEPARATOR . str_ireplace('CF', '', strtolower($class)) . '.class.php';
+ return true;
}
// Load CacheCore
elseif (strstr($class, 'Cache'))
{
require_once $path . 'lib' . DIRECTORY_SEPARATOR . 'cachecore' . DIRECTORY_SEPARATOR . strtolower($class) . '.class.php';
+ return true;
}
// Load RequestCore
elseif (strstr($class, 'RequestCore') || strstr($class, 'ResponseCore'))
{
require_once $path . 'lib' . DIRECTORY_SEPARATOR . 'requestcore' . DIRECTORY_SEPARATOR . 'requestcore.class.php';
+ return true;
}
// Load Authentication Signers
elseif (strstr($class, 'Auth'))
{
require_once $path . 'authentication' . DIRECTORY_SEPARATOR . str_replace('auth', 'signature_', strtolower($class)) . '.class.php';
+ return true;
}
// Load Signer interface
@@ -1251,15 +1289,17 @@ public static function autoloader($class)
}
require_once $path . 'authentication' . DIRECTORY_SEPARATOR . 'signer.abstract.php';
+ return true;
}
// Load Symfony YAML classes
elseif (strstr($class, 'sfYaml'))
{
require_once $path . 'lib' . DIRECTORY_SEPARATOR . 'yaml' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'sfYaml.php';
+ return true;
}
- return true;
+ return false;
}
}
@@ -1296,7 +1336,7 @@ public static function autoloader($class)
case 'windows':
case 'winnt':
case 'win32':
- $_ENV['HOME'] = 'c:\Documents and Settings' . DIRECTORY_SEPARATOR . get_current_user();
+ $_ENV['HOME'] = 'c:' . DIRECTORY_SEPARATOR . 'Documents and Settings' . DIRECTORY_SEPARATOR . get_current_user();
break;
default:
416 services/as.class.php
View
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
@@ -15,22 +15,20 @@
*/
/**
- * Auto Scaling is a web service designed to automatically launch or terminate EC2 instances based
- * on user-defined policies, schedules, and health checks. Auto Scaling responds automatically to
- * changing conditions. All you need to do is specify how it should respond to those changes.
- *
- * Auto Scaling groups can work across multiple Availability Zones - distinct physical locations
- * for the hosted Amazon EC2 instances - so that if an Availability Zone becomes unavailable, Auto
- * Scaling will automatically redistribute applications to a different Availability Zone.
+ * This is the <em>Auto Scaling API Reference</em>. This guide provides detailed information about
+ * Auto Scaling actions, data types, parameters, and errors. For detailed information about Auto
+ * Scaling features and their associated API calls, go to the <a href=
+ * "http://docs.amazonwebservices.com/AutoScaling/latest/DeveloperGuide/">Auto Scaling Developer
+ * Guide</a>.
*
- * Every API call returns a response meta data object that contains a request identifier.
- * Successful requests return an HTTP 200 status code. Unsuccessful requests return an error
- * object and an HTTP status code of 400 or 500.
+ * Auto Scaling is a web service designed to automatically launch or terminate EC2 instances based
+ * on user-defined policies, schedules, and health checks. This service is used in conjunction
+ * with Amazon CloudWatch and Elastic Load Balancing services.
*
- * The current WSDL is available at:
+ * This reference is based on the current WSDL, which is available at:
*
* <a href=
- * "http://autoscaling.amazonaws.com/doc/2010-08-01/AutoScaling.wsdl">http://autoscaling.amazonaws.com/doc/2010-08-01/AutoScaling.wsdl</a>
+ * "http://autoscaling.amazonaws.com/doc/2011-01-01/AutoScaling.wsdl">http://autoscaling.amazonaws.com/doc/2011-01-01/AutoScaling.wsdl</a>
*
* <strong>Endpoints</strong>
*
@@ -38,7 +36,7 @@
* "http://docs.amazonwebservices.com/general/latest/gr/index.html?rande.html">Regions and
* Endpoints</a> in the Amazon Web Services General Reference.
*
- * @version 2011.11.07
+ * @version 2012.01.17
* @license See the included NOTICE.md file for complete information.
* @copyright See the included NOTICE.md file for complete information.
* @link http://aws.amazon.com/as/ Auto Scaling
@@ -142,7 +140,7 @@ class AmazonAS extends CFRuntime
*/
public function __construct(array $options = array())
{
- $this->api_version = '2010-08-01';
+ $this->api_version = '2011-01-01';
$this->hostname = self::DEFAULT_URL;
$this->auth_class = 'AuthV2Query';
@@ -172,8 +170,8 @@ public function set_region($region)
// SERVICE METHODS
/**
- * Creates a new Auto Scaling group with the specified name. Once the creation request is
- * completed, the AutoScalingGroup is ready to be used in other calls.
+ * Creates a new Auto Scaling group with the specified name and other attributes. When the
+ * creation request is completed, the Auto Scaling group is ready to be used in other calls.
*
* <p class="note">
* The Auto Scaling group name must be unique within the scope of your AWS account, and under the
@@ -184,15 +182,24 @@ public function set_region($region)
* @param string $launch_configuration_name (Required) The name of the launch configuration to use with the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param integer $min_size (Required) The minimum size of the Auto Scaling group.
* @param integer $max_size (Required) The maximum size of the Auto Scaling group.
- * @param string|array $availability_zones (Required) A list of availability zones for the Auto Scaling group. Pass a string for a single value, or an indexed array for multiple values.
+ * @param string|array $availability_zones (Required) A list of Availability Zones for the Auto Scaling group. Pass a string for a single value, or an indexed array for multiple values.
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
- * <li><code>DesiredCapacity</code> - <code>integer</code> - Optional - The number of EC2 instances that should be running in the group. For more information, see <code>SetDesiredCapacity</code>.</li>
+ * <li><code>DesiredCapacity</code> - <code>integer</code> - Optional - The number of Amazon EC2 instances that should be running in the group.</li>
* <li><code>DefaultCooldown</code> - <code>integer</code> - Optional - The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.</li>
- * <li><code>LoadBalancerNames</code> - <code>string|array</code> - Optional - A list of LoadBalancers to use. Pass a string for a single value, or an indexed array for multiple values.</li>
- * <li><code>HealthCheckType</code> - <code>string</code> - Optional - The service you want the health status from, Amazon EC2 or Elastic Load Balancer. Valid values are "EC2" or "ELB." [Constraints: The value must be between 1 and 32 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
- * <li><code>HealthCheckGracePeriod</code> - <code>integer</code> - Optional - Length of time in seconds after a new EC2 instance comes into service that Auto Scaling starts checking its health.</li>
- * <li><code>PlacementGroup</code> - <code>string</code> - Optional - Physical location of your cluster placement group created in Amazon EC2. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
- * <li><code>VPCZoneIdentifier</code> - <code>string</code> - Optional - The subnet identifier of the Virtual Private Cloud. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>LoadBalancerNames</code> - <code>string|array</code> - Optional - A list of load balancers to use. Pass a string for a single value, or an indexed array for multiple values.</li>
+ * <li><code>HealthCheckType</code> - <code>string</code> - Optional - The service you want the health status from, Amazon EC2 or Elastic Load Balancer. Valid values are <code>EC2</code> or <code>ELB</code>. [Constraints: The value must be between 1 and 32 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>HealthCheckGracePeriod</code> - <code>integer</code> - Optional - Length of time in seconds after a new Amazon EC2 instance comes into service that Auto Scaling starts checking its health.</li>
+ * <li><code>PlacementGroup</code> - <code>string</code> - Optional - Physical location of your cluster placement group created in Amazon EC2. For more information about cluster placement group, see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/using_cluster_computing.html">Using Cluster Instances</a> [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>VPCZoneIdentifier</code> - <code>string</code> - Optional - A comma-separated list of subnet identifiers of Amazon Virtual Private Clouds (Amazon VPCs). When you specify subnets and Availability Zones with this call, ensure that the subnets' Availability Zones match the Availability Zones specified. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>Tags</code> - <code>array</code> - Optional - The tag to be created. Each tag should be defined by its resource ID, resource type, key, value, and a propagate flag. The <code>PropagateAtLaunch</code> flag defines whether the new tag will be applied to instances launched after the tag is created. <ul>
+ * <li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
+ * <li><code>ResourceId</code> - <code>string</code> - Optional - The name of the tag. [Constraints: The value must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>ResourceType</code> - <code>string</code> - Optional - The kind of resource to which the tag is applied. [Constraints: The value must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>Key</code> - <code>string</code> - Required - The key of the tag. [Constraints: The value must be between 1 and 128 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>Value</code> - <code>string</code> - Optional - The value of the tag. [Constraints: The value must be between 0 and 256 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>PropagateAtLaunch</code> - <code>boolean</code> - Optional - Specifies whether the new tag will be applied to instances launched after the tag is created. The same behavior applies to updates: If you change a tag, the changed tag will be applied to all instances launched after you made the change.</li>
+ * </ul></li>
+ * </ul></li>
* <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>
* <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>
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
@@ -218,44 +225,58 @@ public function create_auto_scaling_group($auto_scaling_group_name, $launch_conf
), 'member'));
unset($opt['LoadBalancerNames']);
}
+
+ // Optional list + map
+ if (isset($opt['Tags']))
+ {
+ $opt = array_merge($opt, CFComplexType::map(array(
+ 'Tags' => $opt['Tags']
+ ), 'member'));
+ unset($opt['Tags']);
+ }
return $this->authenticate('CreateAutoScalingGroup', $opt);
}
/**
- * Creates a new launch configuration. Once created, the new launch configuration is available for
- * immediate use.
+ * Creates a new launch configuration. The launch configuration name must be unique within the
+ * scope of the client's AWS account. The maximum limit of launch configurations, which by default
+ * is 100, must not yet have been met; otherwise, the call will fail. When created, the new launch
+ * configuration is available for immediate use.
+ *
+ * You can create a launch configuration with Amazon EC2 security groups or with Amazon VPC
+ * security groups. However, you can't use Amazon EC2 security groups together with Amazon VPC
+ * security groups, or vice versa.
*
* <p class="note">
- * The launch configuration name used must be unique, within the scope of the client's AWS
- * account, and the maximum limit of launch configurations must not yet have been met, or else the
- * call will fail.
+ * At this time, Auto Scaling launch configurations don't support compressed (e.g. zipped) user
+ * data files.
* </p>
*
* @param string $launch_configuration_name (Required) The name of the launch configuration to create. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
- * @param string $image_id (Required) Unique ID of the <em>Amazon Machine Image</em> (AMI) which was assigned during registration. For more information about Amazon EC2 images, please go to <a href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/AMIs.html">Using AMIs</a> in the <em>Amazon EC2 User Guide</em> [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
- * @param string $instance_type (Required) The instance type of the EC2 instance. For more information about Amazon EC2 instance types, please go to <a href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/Instances.html">Using Instances</a> in the <em>Amazon EC2 User Guide</em>. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
- * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
- * <li><code>KeyName</code> - <code>string</code> - Optional - The name of the EC2 key pair. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
- * <li><code>SecurityGroups</code> - <code>string|array</code> - Optional - The names of the security groups with which to associate EC2 instances. For more information about Amazon EC2 security groups, go to <a href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/using-network-security.html">Using Security Groups</a> in the <em>Amazon EC2 User Guide</em>. Pass a string for a single value, or an indexed array for multiple values.</li>
- * <li><code>UserData</code> - <code>string</code> - Optional - The user data available to the launched EC2 instances. For more information about Amazon EC2 user data, please go to <a href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/Instances.html">Using Instances</a> in the <em>Amazon EC2 User Guide</em>. [Constraints: The value must be between 0 and 21847 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
- * <li><code>KernelId</code> - <code>string</code> - Optional - The ID of the kernel associated with the EC2 AMI. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
- * <li><code>RamdiskId</code> - <code>string</code> - Optional - The ID of the RAM disk associated with the EC2 AMI. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
- * <li><code>BlockDeviceMappings</code> - <code>array</code> - Optional - A list of mappings that specify how block devices are exposed to the instance. Each mapping is made up of a <em>VirtualName</em>, a <em>DeviceName</em>, and an <em>ebs</em> data structure that contains information about the associated Elastic Block Storage volume. For more information about Amazon EC2 BlockDeviceMappings, please go to <a href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html">Block Device Mapping</a> in the <em>Amazon EC2 User Guide</em>. <ul>
+ * @param string $image_id (Required) Unique ID of the <em>Amazon Machine Image</em> (AMI) which was assigned during registration. For more information about Amazon EC2 images, please see <a href="http://aws.amazon.com/ec2/">Amazon EC2 product documentation</a>. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
+ * @param string $instance_type (Required) The instance type of the Amazon EC2 instance. For more information about Amazon EC2 instance types, please see <a href="http://aws.amazon.com/ec2/">Amazon EC2 product documentation</a> [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
+ * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
+ * <li><code>KeyName</code> - <code>string</code> - Optional - The name of the Amazon EC2 key pair. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>SecurityGroups</code> - <code>string|array</code> - Optional - The names of the security groups with which to associate Amazon EC2 or Amazon VPC instances. Specify Amazon EC2 security groups using security group names, such as <code>websrv</code>. Specify Amazon VPC security groups using security group IDs, such as <code>sg-12345678</code>. For more information about Amazon EC2 security groups, go to <a href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/index.html?using-network-security.html">Using Security Groups</a> in the Amazon EC2 product documentation. For more information about Amazon VPC security groups, go to <a href="http://docs.amazonwebservices.com/AmazonVPC/latest/UserGuide/index.html?VPC_SecurityGroups.html">Security Groups</a> in the Amazon VPC product documentation. Pass a string for a single value, or an indexed array for multiple values.</li>
+ * <li><code>UserData</code> - <code>string</code> - Optional - The user data available to the launched Amazon EC2 instances. For more information about Amazon EC2 user data, please see <a href="http://aws.amazon.com/ec2/">Amazon EC2 product documentation</a>. [Constraints: The value must be between 0 and 21847 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>KernelId</code> - <code>string</code> - Optional - The ID of the kernel associated with the Amazon EC2 AMI. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>RamdiskId</code> - <code>string</code> - Optional - The ID of the RAM disk associated with the Amazon EC2 AMI. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>BlockDeviceMappings</code> - <code>array</code> - Optional - A list of mappings that specify how block devices are exposed to the instance. Each mapping is made up of a <em>VirtualName</em>, a <em>DeviceName</em>, and an <em>ebs</em> data structure that contains information about the associated Elastic Block Storage volume. For more information about Amazon EC2 BlockDeviceMappings, go to <a href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/index.html?block-device-mapping-concepts.html">Block Device Mapping</a> in the Amazon EC2 product documentation. <ul>
* <li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
* <li><code>VirtualName</code> - <code>string</code> - Optional - The virtual name associated with the device. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
* <li><code>DeviceName</code> - <code>string</code> - Required - The name of the device within Amazon EC2. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
* <li><code>Ebs</code> - <code>array</code> - Optional - The Elastic Block Storage volume information. <ul>
* <li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
- * <li><code>SnapshotId</code> - <code>string</code> - Optional - The Snapshot ID. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
- * <li><code>VolumeSize</code> - <code>integer</code> - Optional - The volume size, in GigaBytes.</li>
+ * <li><code>SnapshotId</code> - <code>string</code> - Optional - The snapshot ID. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>VolumeSize</code> - <code>integer</code> - Optional - The volume size, in gigabytes.</li>
* </ul></li>
* </ul></li>
* </ul></li>
* </ul></li>
- * <li><code>InstanceMonitoring</code> - <code>array</code> - Optional - Enables detailed monitoring. <ul>
+ * <li><code>InstanceMonitoring</code> - <code>array</code> - Optional - Enables detailed monitoring, which is enabled by default. When detailed monitoring is enabled, CloudWatch will generate metrics every minute and your account will be charged a fee. When you disable detailed monitoring, by specifying <code>False</code>, Cloudwatch will generate metrics every 5 minutes. For information about monitoring, see the <a href="http://aws.amazon.com/cloudwatch/">Amazon CloudWatch</a> product page. <ul>
* <li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
- * <li><code>Enabled</code> - <code>boolean</code> - Optional - If true, instance monitoring is enabled.</li>
+ * <li><code>Enabled</code> - <code>boolean</code> - Optional - If <code>True</code>, instance monitoring is enabled.</li>
* </ul></li>
* </ul></li>
* <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>
@@ -300,7 +321,42 @@ public function create_launch_configuration($launch_configuration_name, $image_i
}
/**
- * Deletes the specified auto scaling group if the group has no instances and no scaling
+ * Creates new tags or updates existing tags for an Auto Scaling group.
+ *
+ * When you use the <code>PropagateAtLaunch</code> flag, the tag you create will be applied to new
+ * instances launched by the Auto Scaling group. However, instances already running will not get
+ * the new or updated tag. Likewise, when you modify a tag, the updated version will be applied to
+ * new instances launched by the Auto Scaling group after the change. Instances that are already
+ * running that had the previous version of the tag will continue to have the older tag.
+ *
+ * @param array $tags (Required) The tag to be created or updated. Each tag should be defined by its resource ID, resource type, key, value, and a propagate flag. The <code>PropagateAtLaunch</code> flag defines whether the new tag will be applied to instances launched after the tag is created. <ul>
+ * <li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
+ * <li><code>ResourceId</code> - <code>string</code> - Optional - The name of the tag. [Constraints: The value must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>ResourceType</code> - <code>string</code> - Optional - The kind of resource to which the tag is applied. [Constraints: The value must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>Key</code> - <code>string</code> - Required - The key of the tag. [Constraints: The value must be between 1 and 128 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>Value</code> - <code>string</code> - Optional - The value of the tag. [Constraints: The value must be between 0 and 256 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>PropagateAtLaunch</code> - <code>boolean</code> - Optional - Specifies whether the new tag will be applied to instances launched after the tag is created. The same behavior applies to updates: If you change a tag, the changed tag will be applied to all instances launched after you made the change.</li>
+ * </ul></li>
+ * </ul>
+ * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
+ * <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>
+ * <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>
+ * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
+ */
+ public function create_or_update_tags($tags, $opt = null)
+ {
+ if (!$opt) $opt = array();
+
+ // Required list + map
+ $opt = array_merge($opt, CFComplexType::map(array(
+ 'Tags' => (is_array($tags) ? $tags : array($tags))
+ ), 'member'));
+
+ return $this->authenticate('CreateOrUpdateTags', $opt);
+ }
+
+ /**
+ * Deletes the specified Auto Scaling group if the group has no instances and no scaling
* activities in progress.
*
* <p class="note">
@@ -311,6 +367,7 @@ public function create_launch_configuration($launch_configuration_name, $image_i
*
* @param string $auto_scaling_group_name (Required) The name of the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
+ * <li><code>ForceDelete</code> - <code>boolean</code> - Optional - Starting with API version 2011-01-01, specifies that the Auto Scaling group will be deleted along with all instances associated with the group, without waiting for all instances to be terminated.</li>
* <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>
* <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>
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
@@ -326,7 +383,7 @@ public function delete_auto_scaling_group($auto_scaling_group_name, $opt = null)
/**
* Deletes the specified <code>LaunchConfiguration</code>.
*
- * The specified launch configuration must not be attached to an Auto Scaling group. Once this
+ * The specified launch configuration must not be attached to an Auto Scaling group. When this
* call completes, the launch configuration is no longer available for use.
*
* @param string $launch_configuration_name (Required) The name of the launch configuration. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
@@ -344,9 +401,28 @@ public function delete_launch_configuration($launch_configuration_name, $opt = n
}
/**
- * Deletes a policy created by <code>PutScalingPolicy</code>
+ * Deletes notifications created by <code>PutNotificationConfiguration</code>.
*
- * @param string $policy_name (Required) The name or PolicyARN of the policy you want to delete [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
+ * @param string $auto_scaling_group_name (Required) The name of the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
+ * @param string $topic_arn (Required) The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
+ * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
+ * <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>
+ * <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>
+ * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
+ */
+ public function delete_notification_configuration($auto_scaling_group_name, $topic_arn, $opt = null)
+ {
+ if (!$opt) $opt = array();
+ $opt['AutoScalingGroupName'] = $auto_scaling_group_name;
+ $opt['TopicARN'] = $topic_arn;
+
+ return $this->authenticate('DeleteNotificationConfiguration', $opt);
+ }
+
+ /**
+ * Deletes a policy created by <code>PutScalingPolicy</code>.
+ *
+ * @param string $policy_name (Required) The name or PolicyARN of the policy you want to delete. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>AutoScalingGroupName</code> - <code>string</code> - Optional - The name of the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
* <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
@@ -367,7 +443,7 @@ public function delete_policy($policy_name, $opt = null)
*
* @param string $scheduled_action_name (Required) The name of the action you want to delete. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
- * <li><code>AutoScalingGroupName</code> - <code>string</code> - Optional - The name of the Auto Scaling group [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>AutoScalingGroupName</code> - <code>string</code> - Optional - The name of the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
* <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>
* <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>
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
@@ -381,6 +457,35 @@ public function delete_scheduled_action($scheduled_action_name, $opt = null)
}
/**
+ * Removes the specified tags or a set of tags from a set of resources.
+ *
+ * @param array $tags (Required) The tag to be deleted. Each tag should be defined by its resource ID, resource type, key, value, and a propagate flag. The <code>PropagateAtLaunch</code> flag defines whether the new tag will be applied to instances launched after the tag is created. <ul>
+ * <li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
+ * <li><code>ResourceId</code> - <code>string</code> - Optional - The name of the tag. [Constraints: The value must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>ResourceType</code> - <code>string</code> - Optional - The kind of resource to which the tag is applied. [Constraints: The value must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>Key</code> - <code>string</code> - Required - The key of the tag. [Constraints: The value must be between 1 and 128 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>Value</code> - <code>string</code> - Optional - The value of the tag. [Constraints: The value must be between 0 and 256 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>PropagateAtLaunch</code> - <code>boolean</code> - Optional - Specifies whether the new tag will be applied to instances launched after the tag is created. The same behavior applies to updates: If you change a tag, the changed tag will be applied to all instances launched after you made the change.</li>
+ * </ul></li>
+ * </ul>
+ * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
+ * <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>
+ * <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>
+ * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
+ */
+ public function delete_tags($tags, $opt = null)
+ {
+ if (!$opt) $opt = array();
+
+ // Required list + map
+ $opt = array_merge($opt, CFComplexType::map(array(
+ 'Tags' => (is_array($tags) ? $tags : array($tags))
+ ), 'member'));
+
+ return $this->authenticate('DeleteTags', $opt);
+ }
+
+ /**
* Returns policy adjustment types for use in the <code>PutScalingPolicy</code> action.
*
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
@@ -401,7 +506,8 @@ public function describe_adjustment_types($opt = null)
* service returns the full details of all Auto Scaling groups.
*
* This action supports pagination by returning a token if there are more pages to retrieve. To
- * get the next page, call this action again with the returned token as the NextToken parameter.
+ * get the next page, call this action again with the returned token as the <code>NextToken</code>
+ * parameter.
*
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>AutoScalingGroupNames</code> - <code>string|array</code> - Optional - A list of Auto Scaling group names. Pass a string for a single value, or an indexed array for multiple values.</li>
@@ -428,11 +534,13 @@ public function describe_auto_scaling_groups($opt = null)
}
/**
- * Returns a description of each Auto Scaling instance in the InstanceIds list. If a list is not
- * provided, the service returns the full details of all instances up to a maximum of fifty.
+ * Returns a description of each Auto Scaling instance in the <code>InstanceIds</code> list. If a
+ * list is not provided, the service returns the full details of all instances up to a maximum of
+ * 50. By default, the service returns a list of 20 items.
*
* This action supports pagination by returning a token if there are more pages to retrieve. To
- * get the next page, call this action again with the returned token as the NextToken parameter.
+ * get the next page, call this action again with the returned token as the <code>NextToken</code>
+ * parameter.
*
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>InstanceIds</code> - <code>string|array</code> - Optional - The list of Auto Scaling instances to describe. If this list is omitted, all auto scaling instances are described. The list of requested instances cannot contain more than 50 items. If unknown instances are requested, they are ignored with no error. Pass a string for a single value, or an indexed array for multiple values.</li>
@@ -459,14 +567,30 @@ public function describe_auto_scaling_instances($opt = null)
}
/**
- * Returns a full description of the launch configurations given the specified names.
+ * Returns a list of all notification types that are supported by Auto Scaling.
+ *
+ * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
+ * <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>
+ * <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>
+ * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
+ */
+ public function describe_auto_scaling_notification_types($opt = null)
+ {
+ if (!$opt) $opt = array();
+
+ return $this->authenticate('DescribeAutoScalingNotificationTypes', $opt);
+ }
+
+ /**
+ * Returns a full description of the launch configurations, or the specified launch
+ * configurations, if they exist.
*
- * If no names are specified, then the full details of all launch configurations are returned.
+ * If no name is specified, then the full details of all launch configurations are returned.
*
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>LaunchConfigurationNames</code> - <code>string|array</code> - Optional - A list of launch configuration names. Pass a string for a single value, or an indexed array for multiple values.</li>
* <li><code>NextToken</code> - <code>string</code> - Optional - A string that marks the start of the next batch of returned results. [Constraints: The value must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
- * <li><code>MaxRecords</code> - <code>integer</code> - Optional - The maximum number of launch configurations.</li>
+ * <li><code>MaxRecords</code> - <code>integer</code> - Optional - The maximum number of launch configurations. The default is 100.</li>
* <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>
* <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>
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
@@ -503,13 +627,41 @@ public function describe_metric_collection_types($opt = null)
}
/**
+ * Returns a list of notification actions associated with Auto Scaling groups for specified
+ * events.
+ *
+ * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
+ * <li><code>AutoScalingGroupNames</code> - <code>string|array</code> - Optional - The name of the Auto Scaling group. Pass a string for a single value, or an indexed array for multiple values.</li>
+ * <li><code>NextToken</code> - <code>string</code> - Optional - A string that is used to mark the start of the next batch of returned results for pagination. [Constraints: The value must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>MaxRecords</code> - <code>integer</code> - Optional - Maximum number of records to be returned.</li>
+ * <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>
+ * <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>
+ * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
+ */
+ public function describe_notification_configurations($opt = null)
+ {
+ if (!$opt) $opt = array();
+
+ // Optional list (non-map)
+ if (isset($opt['AutoScalingGroupNames']))
+ {
+ $opt = array_merge($opt, CFComplexType::map(array(
+ 'AutoScalingGroupNames' => (is_array($opt['AutoScalingGroupNames']) ? $opt['AutoScalingGroupNames'] : array($opt['AutoScalingGroupNames']))
+ ), 'member'));
+ unset($opt['AutoScalingGroupNames']);
+ }
+
+ return $this->authenticate('DescribeNotificationConfigurations', $opt);
+ }
+
+ /**
* Returns descriptions of what each policy does. This action supports pagination. If the response
* includes a token, there are more records available. To get the additional records, repeat the
- * request with the response token as the NextToken parameter.
+ * request with the response token as the <code>NextToken</code> parameter.
*
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>AutoScalingGroupName</code> - <code>string</code> - Optional - The name of the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
- * <li><code>PolicyNames</code> - <code>string|array</code> - Optional - A list of policy names or policy ARNs to be described. If this list is omitted, all policy names are described. If an auto scaling group name is provided, the results are limited to that group.The list of requested policy names cannot contain more than 50 items. If unknown policy names are requested, they are ignored with no error. Pass a string for a single value, or an indexed array for multiple values.</li>
+ * <li><code>PolicyNames</code> - <code>string|array</code> - Optional - A list of policy names or policy ARNs to be described. If this list is omitted, all policy names are described. If an auto scaling group name is provided, the results are limited to that group. The list of requested policy names cannot contain more than 50 items. If unknown policy names are requested, they are ignored with no error. Pass a string for a single value, or an indexed array for multiple values.</li>
* <li><code>NextToken</code> - <code>string</code> - Optional - A string that is used to mark the start of the next batch of returned results for pagination. [Constraints: The value must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
* <li><code>MaxRecords</code> - <code>integer</code> - Optional - The maximum number of policies that will be described with each call.</li>
* <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>
@@ -535,16 +687,16 @@ public function describe_policies($opt = null)
/**
* Returns the scaling activities for the specified Auto Scaling group.
*
- * If the specified <em>ActivityIds</em> list is empty, all the activities from the past six weeks
- * are returned. Activities are sorted by completion time. Activities still in progress appear
- * first on the list.
+ * If the specified <code>ActivityIds</code> list is empty, all the activities from the past six
+ * weeks are returned. Activities are sorted by completion time. Activities still in progress
+ * appear first on the list.
*
* This action supports pagination. If the response includes a token, there are more records
* available. To get the additional records, repeat the request with the response token as the
- * NextToken parameter.
+ * <code>NextToken</code> parameter.
*
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
- * <li><code>ActivityIds</code> - <code>string|array</code> - Optional - A list containing the activity IDs of the desired scaling activities. If this list is omitted, all activities are described. If an AutoScalingGroupName is provided, the results are limited to that group. The list of requested activities cannot contain more than 50 items. If unknown activities are requested, they are ignored with no error. Pass a string for a single value, or an indexed array for multiple values.</li>
+ * <li><code>ActivityIds</code> - <code>string|array</code> - Optional - A list containing the activity IDs of the desired scaling activities. If this list is omitted, all activities are described. If an <code>AutoScalingGroupName</code> is provided, the results are limited to that group. The list of requested activities cannot contain more than 50 items. If unknown activities are requested, they are ignored with no error. Pass a string for a single value, or an indexed array for multiple values.</li>
* <li><code>AutoScalingGroupName</code> - <code>string</code> - Optional - The name of the <code>AutoScalingGroup</code>. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
* <li><code>MaxRecords</code> - <code>integer</code> - Optional - The maximum number of scaling activities to return.</li>
* <li><code>NextToken</code> - <code>string</code> - Optional - A string that marks the start of the next batch of returned results for pagination. [Constraints: The value must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
@@ -586,14 +738,14 @@ public function describe_scaling_process_types($opt = null)
/**
* Lists all the actions scheduled for your Auto Scaling group that haven't been executed. To see
- * a list of action already executed, see the activity record returned in
+ * a list of actions already executed, see the activity record returned in
* <code>DescribeScalingActivities</code>.
*
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>AutoScalingGroupName</code> - <code>string</code> - Optional - The name of the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
* <li><code>ScheduledActionNames</code> - <code>string|array</code> - Optional - A list of scheduled actions to be described. If this list is omitted, all scheduled actions are described. The list of requested scheduled actions cannot contain more than 50 items. If an auto scaling group name is provided, the results are limited to that group. If unknown scheduled actions are requested, they are ignored with no error. Pass a string for a single value, or an indexed array for multiple values.</li>
* <li><code>StartTime</code> - <code>string</code> - Optional - The earliest scheduled start time to return. If scheduled action names are provided, this field will be ignored. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
- * <li><code>EndTime</code> - <code>string</code> - Optional - The latest scheduled start time to return. If scheduled action names are provided, this field will be ignored. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
+ * <li><code>EndTime</code> - <code>string</code> - Optional - The latest scheduled start time to return. If scheduled action names are provided, this field is ignored. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
* <li><code>NextToken</code> - <code>string</code> - Optional - A string that marks the start of the next batch of returned results. [Constraints: The value must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
* <li><code>MaxRecords</code> - <code>integer</code> - Optional - The maximum number of scheduled actions to return.</li>
* <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,8 +781,48 @@ public function describe_scheduled_actions($opt = null)
}
/**
+ * Lists the Auto Scaling tags.
+ *
+ * You can use filters to limit results when describing tags. For example, you can query for tags
+ * of a particular Auto Scaling group. You can specify multiple values for a filter. A tag must
+ * match at least one of the specified values for it to be included in the results.
+ *
+ * You can also specify multiple filters. The result includes information for a particular tag
+ * only if it matches all your filters. If there's no match, no special message is returned.
+ *
+ * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
+ * <li><code>Filters</code> - <code>array</code> - Optional - The value of the filter type used to identify the tags to be returned. For example, you can filter so that<c>DescribeTags</c>returns tags according to Auto Scaling group, the key and value, or whether the new tag will be applied to instances launched after the tag is created (PropagateAtLaunch). <ul>
+ * <li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
+ * <li><code>Name</code> - <code>string</code> - Optional - The name of the filter. [Constraints: The value must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>Values</code> - <code>string|array</code> - Optional - The value of the filter. Pass a string for a single value, or an indexed array for multiple values.</li>
+ * </ul></li>
+ * </ul></li>
+ * <li><code>NextToken</code> - <code>string</code> - Optional - A string that marks the start of the next batch of returned results. [Constraints: The value must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>MaxRecords</code> - <code>integer</code> - Optional - The maximum number of records to return.</li>
+ * <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>
+ * <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>
+ * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
+ */
+ public function describe_tags($opt = null)
+ {
+ if (!$opt) $opt = array();
+
+ // Optional list + map
+ if (isset($opt['Filters']))
+ {
+ $opt = array_merge($opt, CFComplexType::map(array(
+ 'Filters' => $opt['Filters']
+ ), 'member'));
+ unset($opt['Filters']);
+ }
+
+ return $this->authenticate('DescribeTags', $opt);
+ }
+
+ /**
* Disables monitoring of group metrics for the Auto Scaling group specified in
- * AutoScalingGroupName. You can specify the list of affected metrics with the Metrics parameter.
+ * <code>AutoScalingGroupName</code>. You can specify the list of affected metrics with the
+ * <code>Metrics</code> parameter.
*
* @param string $auto_scaling_group_name (Required) The name or ARN of the Auto Scaling Group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
@@ -658,13 +850,13 @@ public function disable_metrics_collection($auto_scaling_group_name, $opt = null
/**
* Enables monitoring of group metrics for the Auto Scaling group specified in
- * AutoScalingGroupName. You can specify the list of enabled metrics with the Metrics parameter.
+ * <code>AutoScalingGroupName</code>. You can specify the list of enabled metrics with the
+ * <code>Metrics</code> parameter.
*
- * Auto scaling metrics collection can be turned on only if the
- * <code>InstanceMonitoring.Enabled</code> flag, in the Auto Scaling group's launch configuration,
- * is set to <code>true</code>.
+ * Auto scaling metrics collection can be turned on only if the <code>InstanceMonitoring</code>
+ * flag, in the Auto Scaling group's launch configuration, is set to <code>True</code>.
*
- * @param string $auto_scaling_group_name (Required) The name or ARN of the Auto Scaling Group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
+ * @param string $auto_scaling_group_name (Required) The name or ARN of the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param string $granularity (Required) The granularity to associate with the metrics to collect. Currently, the only legal granularity is "1Minute". [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>Metrics</code> - <code>string|array</code> - Optional - The list of metrics to collect. If no metrics are specified, all metrics are enabled. The following metrics are supported:<ul><li>GroupMinSize</li><li>GroupMaxSize</li><li>GroupDesiredCapacity</li><li>GroupInServiceInstances</li><li>GroupPendingInstances</li><li>GroupTerminatingInstances</li><li>GroupTotalInstances</li></ul> Pass a string for a single value, or an indexed array for multiple values.</li>
@@ -695,8 +887,8 @@ public function enable_metrics_collection($auto_scaling_group_name, $granularity
*
* @param string $policy_name (Required) The name or PolicyARN of the policy you want to run. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
- * <li><code>AutoScalingGroupName</code> - <code>string</code> - Optional - The name or ARN of the Auto Scaling Group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
- * <li><code>HonorCooldown</code> - <code>boolean</code> - Optional - Set to True if you want Auto Scaling to reject this request if the Auto Scaling group is in cooldown.</li>
+ * <li><code>AutoScalingGroupName</code> - <code>string</code> - Optional - The name or ARN of the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>HonorCooldown</code> - <code>boolean</code> - Optional - Set to <code>True</code> if you want Auto Scaling to reject this request when the Auto Scaling group is in cooldown.</li>
* <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>
* <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>
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
@@ -710,13 +902,42 @@ public function execute_policy($policy_name, $opt = null)
}
/**
+ * Configures an Auto Scaling group to send notifications when specified events take place.
+ * Subscribers to this topic can have messages for events delivered to an endpoint such as a web
+ * server or email address.
+ *
+ * A new <code>PutNotificationConfiguration</code> overwrites an existing configuration.
+ *
+ * @param string $auto_scaling_group_name (Required) The name of the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
+ * @param string $topic_arn (Required) The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
+ * @param string|array $notification_types (Required) The type of events that will trigger the notification. For more information, go to <code>DescribeAutoScalingNotificationTypes</code>. Pass a string for a single value, or an indexed array for multiple values.
+ * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
+ * <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>
+ * <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>
+ * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
+ */
+ public function put_notification_configuration($auto_scaling_group_name, $topic_arn, $notification_types, $opt = null)
+ {
+ if (!$opt) $opt = array();
+ $opt['AutoScalingGroupName'] = $auto_scaling_group_name;
+ $opt['TopicARN'] = $topic_arn;
+
+ // Required list (non-map)
+ $opt = array_merge($opt, CFComplexType::map(array(
+ 'NotificationTypes' => (is_array($notification_types) ? $notification_types : array($notification_types))
+ ), 'member'));
+
+ return $this->authenticate('PutNotificationConfiguration', $opt);
+ }
+
+ /**
* Creates or updates a policy for an Auto Scaling group. To update an existing policy, use the
* existing policy name and set the parameter(s) you want to change. Any existing parameter not
* changed in an update to an existing policy is not changed in this update request.
*
- * @param string $auto_scaling_group_name (Required) The name or ARN of the Auto Scaling Group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
+ * @param string $auto_scaling_group_name (Required) The name or ARN of the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param string $policy_name (Required) The name of the policy you want to create or update. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
- * @param integer $scaling_adjustment (Required) The number of instances by which to scale. AdjustmentType determines the interpretation of this number (e.g., as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity.
+ * @param integer $scaling_adjustment (Required) The number of instances by which to scale. <code>AdjustmentType</code> determines the interpretation of this number (e.g., as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity.
* @param string $adjustment_type (Required) Specifies whether the <code>ScalingAdjustment</code> is an absolute number or a percentage of the current capacity. Valid values are <code>ChangeInCapacity</code>, <code>ExactCapacity</code>, and <code>PercentChangeInCapacity</code>. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>Cooldown</code> - <code>integer</code> - Optional - The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.</li>
@@ -736,18 +957,19 @@ public function put_scaling_policy($auto_scaling_group_name, $policy_name, $scal
}
/**
- * Creates a scheduled scaling action for a Auto Scaling group. If you leave a parameter
+ * Creates a scheduled scaling action for an Auto Scaling group. If you leave a parameter
* unspecified, the corresponding value remains unchanged in the affected Auto Scaling group.
*
- * @param string $auto_scaling_group_name (Required) The name or ARN of the Auto Scaling Group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
+ * @param string $auto_scaling_group_name (Required) The name or ARN of the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param string $scheduled_action_name (Required) The name of this scaling action. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
- * <li><code>Time</code> - <code>string</code> - Optional - The time for this action to start. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
- * <li><code>EndTime</code> - <code>string</code> - Optional - May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
- * <li><code>Recurrence</code> - <code>string</code> - Optional - [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>Time</code> - <code>string</code> - Optional - <code>Time</code> is deprecated. The time for this action to start. <code>Time</code> is an alias for <code>StartTime</code> and can be specified instead of <code>StartTime</code>, or vice versa. If both <code>Time</code> and <code>StartTime</code> are specified, their values should be identical. Otherwise, <code>PutScheduledUpdateGroupAction</code> will return an error. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
+ * <li><code>StartTime</code> - <code>string</code> - Optional - The time for this action to start, as in <code>--start-time 2010-06-01T00:00:00Z</code>. When <code>StartTime</code> and <code>EndTime</code> are specified with <code>Recurrence</code>, they form the boundaries of when the recurring action will start and stop. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
+ * <li><code>EndTime</code> - <code>string</code> - Optional - The time for this action to end. May be passed as a number of seconds since UNIX Epoch, or any string compatible with <php:strtotime()>.</li>
+ * <li><code>Recurrence</code> - <code>string</code> - Optional - The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format. For information about cron syntax, go to <a href="http://en.wikipedia.org/wiki/Cron">Wikipedia, The Free Encyclopedia</a>. When <code>StartTime</code> and <code>EndTime</code> are specified with <code>Recurrence</code>, they form the boundaries of when the recurring action will start and stop. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
* <li><code>MinSize</code> - <code>integer</code> - Optional - The minimum size for the new Auto Scaling group.</li>
* <li><code>MaxSize</code> - <code>integer</code> - Optional - The maximum size for the Auto Scaling group.</li>
- * <li><code>DesiredCapacity</code> - <code>integer</code> - Optional - The number of EC2 instances that should be running in the group.</li>
+ * <li><code>DesiredCapacity</code> - <code>integer</code> - Optional - The number of Amazon EC2 instances that should be running in the group.</li>
* <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>
* <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>
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
@@ -765,6 +987,12 @@ public function put_scheduled_update_group_action($auto_scaling_group_name, $sch
}
// Optional DateTime
+ if (isset($opt['StartTime']))
+ {
+ $opt['StartTime'] = $this->util->convert_date_to_iso8601($opt['StartTime']);
+ }
+
+ // Optional DateTime
if (isset($opt['EndTime']))
{
$opt['EndTime'] = $this->util->convert_date_to_iso8601($opt['EndTime']);
@@ -779,7 +1007,7 @@ public function put_scheduled_update_group_action($auto_scaling_group_name, $sch
*
* @param string $auto_scaling_group_name (Required) The name or Amazon Resource Name (ARN) of the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
- * <li><code>ScalingProcesses</code> - <code>string|array</code> - Optional - The processes that you want to suspend or resume, which can include one or more of the following:<ul><li>Launch</li><li>Terminate</li><li>HealthCheck</li><li>ReplaceUnhealthy</li><li>AZRebalance</li><li>AlarmNotifications</li><li>ScheduledActions</li></ul>To suspend all process types, omit this parameter. Pass a string for a single value, or an indexed array for multiple values.</li>
+ * <li><code>ScalingProcesses</code> - <code>string|array</code> - Optional - The processes that you want to suspend or resume, which can include one or more of the following:<ul><li>Launch</li><li>Terminate</li><li>HealthCheck</li><li>ReplaceUnhealthy</li><li>AZRebalance</li><li>AlarmNotifications</li><li>ScheduledActions</li><li>AddToLoadBalancer</li></ul>To suspend all process types, omit this parameter. Pass a string for a single value, or an indexed array for multiple values.</li>
* <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>
* <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>
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
@@ -803,8 +1031,8 @@ public function resume_processes($auto_scaling_group_name, $opt = null)
/**
* Adjusts the desired size of the <code>AutoScalingGroup</code> by initiating scaling activities.
- * When reducing the size of the group, it is not possible to define which EC2 instances will be
- * terminated. This applies to any auto-scaling decisions that might result in terminating
+ * When reducing the size of the group, it is not possible to define which Amazon EC2 instances
+ * will be terminated. This applies to any Auto Scaling decisions that might result in terminating
* instances.
*
* There are two common use cases for <code>SetDesiredCapacity</code>: one for users of the Auto
@@ -815,7 +1043,7 @@ public function resume_processes($auto_scaling_group_name, $opt = null)
* <code>SetDesiredCapacity</code> changes the size of your Auto Scaling group without regard to
* the cooldown period. This could be useful, for example, if Auto Scaling did something
* unexpected for some reason. If your cooldown period is 10 minutes, Auto Scaling would normally
- * reject requests to change the size of the group for that entire 10 minute period. The
+ * reject requests to change the size of the group for that entire 10-minute period. The
* <code>SetDesiredCapacity</code> command allows you to circumvent this restriction and change
* the size of the group before the end of the cooldown period.
*
@@ -825,10 +1053,10 @@ public function resume_processes($auto_scaling_group_name, $opt = null)
* <code>SetDesiredCapacity</code> to honor cooldown by setting the <code>HonorCooldown</code>
* parameter to <code>true</code>.
*
- * @param string $auto_scaling_group_name (Required) The name of the AutoScalingGroup. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
- * @param integer $desired_capacity (Required) The new capacity setting for the AutoScalingGroup.
+ * @param string $auto_scaling_group_name (Required) The name of the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
+ * @param integer $desired_capacity (Required) The new capacity setting for the Auto Scaling group.
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
- * <li><code>HonorCooldown</code> - <code>boolean</code> - Optional - By default, <code>SetDesiredCapacity</code> overrides any cooldown period. Set to True if you want Auto Scaling to reject this request if the Auto Scaling group is in cooldown.</li>
+ * <li><code>HonorCooldown</code> - <code>boolean</code> - Optional - By default, <code>SetDesiredCapacity</code> overrides any cooldown period. Set to <code>True</code> if you want Auto Scaling to reject this request when the Auto Scaling group is in cooldown.</li>
* <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>
* <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>
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
@@ -845,7 +1073,7 @@ public function set_desired_capacity($auto_scaling_group_name, $desired_capacity
/**
* Sets the health status of an instance.
*
- * @param string $instance_id (Required) The identifier of the EC2 instance. [Constraints: The value must be between 1 and 16 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
+ * @param string $instance_id (Required) The identifier of the Amazon EC2 instance. [Constraints: The value must be between 1 and 16 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param string $health_status (Required) The health status of the instance. "Healthy" means that the instance is healthy and should remain in service. "Unhealthy" means that the instance is unhealthy. Auto Scaling should terminate and replace it. [Constraints: The value must be between 1 and 32 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>ShouldRespectGracePeriod</code> - <code>boolean</code> - Optional - If True, this call should respect the grace period associated with the group.</li>
@@ -876,7 +1104,7 @@ public function set_instance_health($instance_id, $health_status, $opt = null)
*
* @param string $auto_scaling_group_name (Required) The name or Amazon Resource Name (ARN) of the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
- * <li><code>ScalingProcesses</code> - <code>string|array</code> - Optional - The processes that you want to suspend or resume, which can include one or more of the following:<ul><li>Launch</li><li>Terminate</li><li>HealthCheck</li><li>ReplaceUnhealthy</li><li>AZRebalance</li><li>AlarmNotifications</li><li>ScheduledActions</li></ul>To suspend all process types, omit this parameter. Pass a string for a single value, or an indexed array for multiple values.</li>
+ * <li><code>ScalingProcesses</code> - <code>string|array</code> - Optional - The processes that you want to suspend or resume, which can include one or more of the following:<ul><li>Launch</li><li>Terminate</li><li>HealthCheck</li><li>ReplaceUnhealthy</li><li>AZRebalance</li><li>AlarmNotifications</li><li>ScheduledActions</li><li>AddToLoadBalancer</li></ul>To suspend all process types, omit this parameter. Pass a string for a single value, or an indexed array for multiple values.</li>
* <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>
* <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>
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
@@ -906,7 +1134,7 @@ public function suspend_processes($auto_scaling_group_name, $opt = null)
* immediately.
* </p>
*
- * @param string $instance_id (Required) The ID of the EC2 instance to be terminated. [Constraints: The value must be between 1 and 16 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
+ * @param string $instance_id (Required) The ID of the Amazon EC2 instance to be terminated. [Constraints: The value must be between 1 and 16 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]
* @param boolean $should_decrement_desired_capacity (Required) Specifies whether (<em>true</em>) or not (<em>false</em>) terminating this instance should also decrement the size of the <code>AutoScalingGroup</code>.
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <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>
@@ -927,8 +1155,8 @@ public function terminate_instance_in_auto_scaling_group($instance_id, $should_d
*
* <p class="note"></p>
* To update an Auto Scaling group with a launch configuration that has the
- * <code>InstanceMonitoring.enabled</code> flag set to <code>false</code>, you must first ensure
- * that collection of group metrics is disabled. Otherwise, calls to
+ * <code>InstanceMonitoring</code> flag set to <code>False</code>, you must first ensure that
+ * collection of group metrics is disabled. Otherwise, calls to
* <code>UpdateAutoScalingGroup</code> will fail. If you have previously enabled group metrics
* collection, you can disable collection of all group metrics by calling
* <code>DisableMetricsCollection</code>.
@@ -950,11 +1178,11 @@ public function terminate_instance_in_auto_scaling_group($instance_id, $should_d
* <li><code>MaxSize</code> - <code>integer</code> - Optional - The maximum size of the Auto Scaling group.</li>
* <li><code>DesiredCapacity</code> - <code>integer</code> - Optional - The desired capacity for the Auto Scaling group.</li>
* <li><code>DefaultCooldown</code> - <code>integer</code> - Optional - The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.</li>
- * <li><code>AvailabilityZones</code> - <code>string|array</code> - Optional - Availability zones for the group. Pass a string for a single value, or an indexed array for multiple values.</li>
+ * <li><code>AvailabilityZones</code> - <code>string|array</code> - Optional - Availability Zones for the group. Pass a string for a single value, or an indexed array for multiple values.</li>
* <li><code>HealthCheckType</code> - <code>string</code> - Optional - The service of interest for the health status check, either "EC2" for Amazon EC2 or "ELB" for Elastic Load Balancing. [Constraints: The value must be between 1 and 32 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
* <li><code>HealthCheckGracePeriod</code> - <code>integer</code> - Optional - The length of time that Auto Scaling waits before checking an instance's health status. The grace period begins when an instance comes into service.</li>
- * <li><code>PlacementGroup</code> - <code>string</code> - Optional - The name of the cluster placement group, if applicable. For more information, go to <a href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/using_cluster_computing.html">Using Cluster Instances</a> in the <em>Amazon EC2 User Guide</em>. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
- * <li><code>VPCZoneIdentifier</code> - <code>string</code> - Optional - The identifier for the VPC connection, if applicable. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>PlacementGroup</code> - <code>string</code> - Optional - The name of the cluster placement group, if applicable. For more information, go to <a href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/using_cluster_computing.html">Using Cluster Instances</a> in the Amazon EC2 User Guide. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
+ * <li><code>VPCZoneIdentifier</code> - <code>string</code> - Optional - The subnet identifier for the Amazon VPC connection, if applicable. You can specify several subnets in a comma-separated list. When you specify <code>VPCZoneIdentifier</code> with <code>AvailabilityZones</code>, ensure that the subnets' Availability Zones match the values you specify for <code>AvailabilityZones</code>. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>]</li>
* <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>
* <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>
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
148 services/cloudfront.class.php
View
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@ class CloudFront_Exception extends Exception {}
* seamlessly with the Amazon Simple Storage Service, which durably stores the original, definitive versions
* of your files.
*
- * @version 2011.11.16
+ * @version 2012.01.17
* @license See the included NOTICE.md file for more information.
* @copyright See the included NOTICE.md file for more information.
* @link http://aws.amazon.com/cloudfront/ Amazon CloudFront
@@ -103,19 +103,11 @@ public function __construct(array $options = array())
$this->base_xml = '<?xml version="1.0" encoding="UTF-8"?><%s xmlns="http://cloudfront.amazonaws.com/doc/' . $this->api_version . '/"></%1$s>';
- // Set a default key pair ID and private key
- if (isset($options['credentials']))
- {
- $this->key_pair_id = CFCredentials::get($options['credentials'])->cloudfront_keypair;
- $this->private_key = CFCredentials::get($options['credentials'])->cloudfront_pem;
- }
- else
- {
- $this->key_pair_id = CFCredentials::get()->cloudfront_keypair;
- $this->private_key = CFCredentials::get()->cloudfront_pem;
- }
+ parent::__construct($options);
- return parent::__construct($options);
+ // Set a default key pair ID and private key
+ $this->key_pair_id = $this->credentials->cloudfront_keypair;
+ $this->private_key = $this->credentials->cloudfront_pem;
}
@@ -126,19 +118,20 @@ public function __construct(array $options = array())
* Authenticates a connection to Amazon CloudFront. This method should not be used directly unless
* you're writing custom methods for this class.
*
- * @param string $method (Required) The HTTP method to use to connect. Accepts <code>GET</code>, <code>POST</code>, <code>PUT</code>, <code>DELETE</code>, and <code>HEAD</code>.
- * @param string $path (Optional) The endpoint path to make requests to.
- * @param array $opt (Optional) An associative array of parameters for authenticating. See the individual methods for allowed keys.
- * @param string $xml (Optional) The XML body content to send along in the request.
- * @param string $etag (Optional) The ETag value to pass along with the If-Match HTTP header.
- * @param integer $redirects (Do Not Use) Used internally by this function on occasions when Amazon S3 returns a redirect code and it needs to call itself recursively.
+ * @param string $operation (Required) The HTTP method to use to connect. Accepts <code>GET</code>, <code>POST</code>, <code>PUT</code>, <code>DELETE</code>, and <code>HEAD</code>.
+ * @param array $payload (Required) An associative array of parameters for authenticating. See the individual methods for allowed keys.
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
* @link http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/RESTAuthentication.html Authentication
*/
- public function authenticate($method = 'GET', $path = null, $opt = null, $xml = null, $etag = null, $redirects = 0)
+ public function authenticate($operation, $payload)
{
- if (!$opt) $opt = array();
+ // Extract data from payload
$querystring = null;
+ $opt = ($payload) ? $payload : array();
+ $method = $operation;
+ $path = isset($opt['path']) ? $opt['path'] : null;
+ $xml = isset($opt['xml']) ? $opt['xml'] : null;
+ $etag = isset($opt['etag']) ? $opt['etag'] : null;
$method_arguments = func_get_args();
@@ -192,6 +185,7 @@ public function authenticate($method = 'GET', $path = null, $opt = null, $xml =
// Update RequestCore settings
$request->request_class = $this->request_class;
$request->response_class = $this->response_class;
+ $request->ssl_verification = $this->ssl_verification;
// Pass along registered stream callbacks
if ($this->registered_streaming_read_callback)
@@ -231,7 +225,6 @@ public function authenticate($method = 'GET', $path = null, $opt = null, $xml =
if (isset($opt['curlopts']))
{
$curlopts = $opt['curlopts'];
- unset($opt['curlopts']);
}
// Debug mode
@@ -271,46 +264,20 @@ public function authenticate($method = 'GET', $path = null, $opt = null, $xml =
// Was it Amazon's fault the request failed? Retry the request until we reach $max_retries.
if ((integer) $request->get_response_code() === 500 || (integer) $request->get_response_code() === 503)
{
- if ($redirects <= $this->max_retries)
+ if ($this->redirects <= $this->max_retries)
{
// Exponential backoff
- $delay = (integer) (pow(4, $redirects) * 100000);
+ $delay = (integer) (pow(4, $this->redirects) * 100000);
usleep($delay);
- $data = $this->authenticate($method, $path, $opt, $xml, $etag, ++$redirects);
+ $this->redirects++;
+ $data = $this->authenticate($method, $opt);
}
}
+ $this->redirects = 0;
return $data;
}
- /**
- * When caching is enabled, this method fires the request to the server, and the response is cached.
- * Accepts identical parameters as <authenticate()>. You should never call this method directly—it is
- * used internally by the caching system.
- *
- * @param string $method (Required) The HTTP method to use to connect. Accepts <code>GET</code>, <code>POST</code>, <code>PUT</code>, <code>DELETE</code>, and <code>HEAD</code>.
- * @param string $path (Optional) The endpoint path to make requests to.
- * @param array $opt (Optional) An associative array of parameters for authenticating. See the individual methods for allowed keys.
- * @param string $xml (Optional) The XML body content to send along in the request.
- * @param string $etag (Optional) The ETag value to pass along with the If-Match HTTP header.
- * @return CFResponse A <CFResponse> object containing a parsed HTTP response.
- */
- public function cache_callback($method = 'GET', $path = null, $opt = null, $xml = null, $etag = null)
- {
- // Disable the cache flow since it's already been handled.
- $this->use_cache_flow = false;
-
- // Make the request
- $response = $this->authenticate($method, $path, $opt, $xml, $etag);
-
- if (isset($response->body) && ($response->body instanceof SimpleXMLElement))
- {
- $response->body = $response->body->asXML();
- }
-
- return $response;
- }
-
/*%******************************************************************************************%*/
// SETTERS
@@ -545,14 +512,25 @@ public function update_config_xml($xml, $opt = null)
}
elseif (isset($xml->S3Origin->OriginAccessIdentity))
{
- $origin->addChild('OriginAccessIdentity', $xml->OriginAccessIdentity);
+ $o