From 116d4c3fe7e4528089ccff8dbf1f0a3c7be1e3ef Mon Sep 17 00:00:00 2001 From: Ryan Parman Date: Wed, 18 Jan 2012 04:19:52 -0800 Subject: [PATCH] 1.5.1 release. https://aws.amazon.com/releasenotes/PHP/0724070929559591 --- .gitignore | 1 + .../sdk_compatibility_test.php | 12 +- .../sdk_compatibility_test_cli.php | 12 +- _docs/CHANGELOG.md | 71 +- _docs/CONTRIBUTORS.md | 4 + _docs/NOTICE.md | 2 +- _samples/cli-ec2_sorting_and_filtering.php | 2 +- _samples/cli-s3_get_urls_for_uploads.php | 2 +- _samples/cli-s3_progress_bar.php | 2 +- _samples/html-sdb_create_domain_data.php | 2 +- authentication/signable.interface.php | 2 +- authentication/signature_v2query.class.php | 2 +- authentication/signature_v3json.class.php | 235 +++++ authentication/signature_v3query.class.php | 2 +- authentication/signer.abstract.php | 2 +- extensions/s3browserupload.class.php | 2 +- extensions/s3streamwrapper.class.php | 10 +- lib/requestcore/requestcore.class.php | 13 +- package.xml | 16 +- sdk.class.php | 202 +++-- services/as.class.php | 416 +++++++-- services/cloudfront.class.php | 148 ++-- services/cloudwatch.class.php | 11 +- services/dynamodb.class.php | 806 ++++++++++++++++++ services/ec2.class.php | 5 +- services/elasticache.class.php | 66 +- services/elasticbeanstalk.class.php | 4 +- services/elb.class.php | 8 +- services/emr.class.php | 6 +- services/importexport.class.php | 4 +- services/rds.class.php | 110 ++- services/s3.class.php | 135 ++- services/sdb.class.php | 4 +- services/ses.class.php | 40 +- services/sns.class.php | 100 ++- services/sts.class.php | 33 +- utilities/array.class.php | 17 +- utilities/batchrequest.class.php | 2 +- utilities/complextype.class.php | 2 +- utilities/credential.class.php | 15 +- utilities/credentials.class.php | 4 +- utilities/gzipdecode.class.php | 2 +- utilities/hadoopbase.class.php | 2 +- utilities/hadoopbootstrap.class.php | 2 +- utilities/hadoopstep.class.php | 2 +- utilities/info.class.php | 2 +- utilities/json.class.php | 47 +- utilities/manifest.class.php | 2 +- utilities/mimetypes.class.php | 2 +- utilities/policy.class.php | 2 +- utilities/request.class.php | 2 +- utilities/response.class.php | 2 +- utilities/simplexml.class.php | 4 +- utilities/stacktemplate.class.php | 2 +- utilities/stepconfig.class.php | 2 +- utilities/utilities.class.php | 7 +- 56 files changed, 2067 insertions(+), 547 deletions(-) create mode 100644 authentication/signature_v3json.class.php create mode 100644 services/dynamodb.class.php diff --git a/.gitignore b/.gitignore index 9e5b632..c0556ed 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ build *output* *_coverage_report* _tests +_vanity *~ diff --git a/_compatibility_test/sdk_compatibility_test.php b/_compatibility_test/sdk_compatibility_test.php index 03a54e3..2a0c33f 100644 --- a/_compatibility_test/sdk_compatibility_test.php +++ b/_compatibility_test/sdk_compatibility_test.php @@ -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) { diff --git a/_compatibility_test/sdk_compatibility_test_cli.php b/_compatibility_test/sdk_compatibility_test_cli.php index 6bbaab1..b8bae49 100755 --- a/_compatibility_test/sdk_compatibility_test_cli.php +++ b/_compatibility_test/sdk_compatibility_test_cli.php @@ -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) { diff --git a/_docs/CHANGELOG.md b/_docs/CHANGELOG.md index 0299926..ad8b0fd 100644 --- a/_docs/CHANGELOG.md +++ b/_docs/CHANGELOG.md @@ -1,15 +1,74 @@ +# Changelog: 1.5.1 "Blue" +Code name for Macintosh 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. +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()`. diff --git a/_docs/CONTRIBUTORS.md b/_docs/CONTRIBUTORS.md index 34c341e..66e5c4f 100644 --- a/_docs/CONTRIBUTORS.md +++ b/_docs/CONTRIBUTORS.md @@ -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) diff --git a/_docs/NOTICE.md b/_docs/NOTICE.md index 23aac97..20de73d 100644 --- a/_docs/NOTICE.md +++ b/_docs/NOTICE.md @@ -9,7 +9,7 @@ See below for complete copyright and licensing notices. -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. diff --git a/_samples/cli-ec2_sorting_and_filtering.php b/_samples/cli-ec2_sorting_and_filtering.php index 6dc1537..d040a49 100755 --- a/_samples/cli-ec2_sorting_and_filtering.php +++ b/_samples/cli-ec2_sorting_and_filtering.php @@ -1,6 +1,6 @@ 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; + } +} diff --git a/authentication/signature_v3query.class.php b/authentication/signature_v3query.class.php index 9b3ae26..04565f9 100644 --- a/authentication/signature_v3query.class.php +++ b/authentication/signature_v3query.class.php @@ -1,6 +1,6 @@ false. * @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(); } diff --git a/lib/requestcore/requestcore.class.php b/lib/requestcore/requestcore.class.php index b9c084b..3aa9eab 100755 --- a/lib/requestcore/requestcore.class.php +++ b/lib/requestcore/requestcore.class.php @@ -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 {} diff --git a/package.xml b/package.xml index 49d6fe3..6cf33f8 100644 --- a/package.xml +++ b/package.xml @@ -10,11 +10,11 @@ rparman@amazon.com yes - 2011-12-21 - + 2012-01-18 + - 1.5.0.1 - 1.5.0.1 + 1.5.1 + 1.5.1 stable @@ -23,7 +23,7 @@ Apache 2.0 - - + @@ -39,14 +39,14 @@ - 1.5.0.1 - 1.5.0.1 + 1.5.1 + 1.5.1 stable stable - 2011-12-21 + 2012-01-18 Apache 2.0 - diff --git a/sdk.class.php b/sdk.class.php index efce1b6..d1dc900 100755 --- a/sdk.class.php +++ b/sdk.class.php @@ -1,6 +1,6 @@ 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 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: diff --git a/services/as.class.php b/services/as.class.php index 174d886..a71c831 100644 --- a/services/as.class.php +++ b/services/as.class.php @@ -1,6 +1,6 @@ Auto Scaling API Reference. 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 Auto Scaling Developer + * Guide. * - * 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: * * http://autoscaling.amazonaws.com/doc/2010-08-01/AutoScaling.wsdl + * "http://autoscaling.amazonaws.com/doc/2011-01-01/AutoScaling.wsdl">http://autoscaling.amazonaws.com/doc/2011-01-01/AutoScaling.wsdl * * Endpoints * @@ -38,7 +36,7 @@ * "http://docs.amazonwebservices.com/general/latest/gr/index.html?rande.html">Regions and * Endpoints 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. * *

* 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @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:

    - *
  • DesiredCapacity - integer - Optional - The number of EC2 instances that should be running in the group. For more information, see SetDesiredCapacity.
  • + *
  • DesiredCapacity - integer - Optional - The number of Amazon EC2 instances that should be running in the group.
  • *
  • DefaultCooldown - integer - Optional - The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.
  • - *
  • LoadBalancerNames - string|array - Optional - A list of LoadBalancers to use. Pass a string for a single value, or an indexed array for multiple values.
  • - *
  • HealthCheckType - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
  • - *
  • HealthCheckGracePeriod - integer - Optional - Length of time in seconds after a new EC2 instance comes into service that Auto Scaling starts checking its health.
  • - *
  • PlacementGroup - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
  • - *
  • VPCZoneIdentifier - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
  • + *
  • LoadBalancerNames - string|array - Optional - A list of load balancers to use. Pass a string for a single value, or an indexed array for multiple values.
  • + *
  • HealthCheckType - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
  • + *
  • HealthCheckGracePeriod - integer - Optional - Length of time in seconds after a new Amazon EC2 instance comes into service that Auto Scaling starts checking its health.
  • + *
  • PlacementGroup - string - Optional - Physical location of your cluster placement group created in Amazon EC2. For more information about cluster placement group, see Using Cluster Instances [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
  • + *
  • VPCZoneIdentifier - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
  • + *
  • Tags - array - Optional - The tag to be created. Each tag should be defined by its resource ID, resource type, key, value, and a propagate flag. The PropagateAtLaunch flag defines whether the new tag will be applied to instances launched after the tag is created.
      + *
    • x - array - Optional - This represents a simple array index.
        + *
      • ResourceId - string - Optional - The name of the tag. [Constraints: The value must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
      • + *
      • ResourceType - string - Optional - The kind of resource to which the tag is applied. [Constraints: The value must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
      • + *
      • Key - string - Required - The key of the tag. [Constraints: The value must be between 1 and 128 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
      • + *
      • Value - string - Optional - The value of the tag. [Constraints: The value must be between 0 and 256 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
      • + *
      • PropagateAtLaunch - boolean - 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.
      • + *
    • + *
  • *
  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • *
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
* @return CFResponse A 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. * *

- * 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. *

* * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] - * @param string $image_id (Required) Unique ID of the Amazon Machine Image (AMI) which was assigned during registration. For more information about Amazon EC2 images, please go to Using AMIs in the Amazon EC2 User Guide [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] - * @param string $instance_type (Required) The instance type of the EC2 instance. For more information about Amazon EC2 instance types, please go to Using Instances in the Amazon EC2 User Guide. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] - * @param array $opt (Optional) An associative array of parameters that can have the following keys:
    - *
  • KeyName - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
  • - *
  • SecurityGroups - string|array - Optional - The names of the security groups with which to associate EC2 instances. For more information about Amazon EC2 security groups, go to Using Security Groups in the Amazon EC2 User Guide. Pass a string for a single value, or an indexed array for multiple values.
  • - *
  • UserData - string - Optional - The user data available to the launched EC2 instances. For more information about Amazon EC2 user data, please go to Using Instances in the Amazon EC2 User Guide. [Constraints: The value must be between 0 and 21847 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
  • - *
  • KernelId - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
  • - *
  • RamdiskId - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
  • - *
  • BlockDeviceMappings - array - Optional - A list of mappings that specify how block devices are exposed to the instance. Each mapping is made up of a VirtualName, a DeviceName, and an ebs data structure that contains information about the associated Elastic Block Storage volume. For more information about Amazon EC2 BlockDeviceMappings, please go to Block Device Mapping in the Amazon EC2 User Guide.
      + * @param string $image_id (Required) Unique ID of the Amazon Machine Image (AMI) which was assigned during registration. For more information about Amazon EC2 images, please see Amazon EC2 product documentation. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] + * @param string $instance_type (Required) The instance type of the Amazon EC2 instance. For more information about Amazon EC2 instance types, please see Amazon EC2 product documentation [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
        + *
      • KeyName - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
      • + *
      • SecurityGroups - string|array - 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 websrv. Specify Amazon VPC security groups using security group IDs, such as sg-12345678. For more information about Amazon EC2 security groups, go to Using Security Groups in the Amazon EC2 product documentation. For more information about Amazon VPC security groups, go to Security Groups in the Amazon VPC product documentation. Pass a string for a single value, or an indexed array for multiple values.
      • + *
      • UserData - string - Optional - The user data available to the launched Amazon EC2 instances. For more information about Amazon EC2 user data, please see Amazon EC2 product documentation. [Constraints: The value must be between 0 and 21847 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
      • + *
      • KernelId - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
      • + *
      • RamdiskId - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
      • + *
      • BlockDeviceMappings - array - Optional - A list of mappings that specify how block devices are exposed to the instance. Each mapping is made up of a VirtualName, a DeviceName, and an ebs data structure that contains information about the associated Elastic Block Storage volume. For more information about Amazon EC2 BlockDeviceMappings, go to Block Device Mapping in the Amazon EC2 product documentation.
          *
        • x - array - Optional - This represents a simple array index.
            *
          • VirtualName - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
          • *
          • DeviceName - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
          • *
          • Ebs - array - Optional - The Elastic Block Storage volume information.
              *
            • x - array - Optional - This represents a simple array index.
                - *
              • SnapshotId - string - Optional - The Snapshot ID. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
              • - *
              • VolumeSize - integer - Optional - The volume size, in GigaBytes.
              • + *
              • SnapshotId - string - Optional - The snapshot ID. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
              • + *
              • VolumeSize - integer - Optional - The volume size, in gigabytes.
              • *
            • *
          • *
        • *
      • - *
      • InstanceMonitoring - array - Optional - Enables detailed monitoring.
          + *
        • InstanceMonitoring - array - 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 False, Cloudwatch will generate metrics every 5 minutes. For information about monitoring, see the Amazon CloudWatch product page.
            *
          • x - array - Optional - This represents a simple array index.
              - *
            • Enabled - boolean - Optional - If true, instance monitoring is enabled.
            • + *
            • Enabled - boolean - Optional - If True, instance monitoring is enabled.
            • *
          • *
        • *
        • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
        • @@ -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 PropagateAtLaunch 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 PropagateAtLaunch flag defines whether the new tag will be applied to instances launched after the tag is created.
            + *
          • x - array - Optional - This represents a simple array index.
              + *
            • ResourceId - string - Optional - The name of the tag. [Constraints: The value must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
            • + *
            • ResourceType - string - Optional - The kind of resource to which the tag is applied. [Constraints: The value must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
            • + *
            • Key - string - Required - The key of the tag. [Constraints: The value must be between 1 and 128 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
            • + *
            • Value - string - Optional - The value of the tag. [Constraints: The value must be between 0 and 256 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
            • + *
            • PropagateAtLaunch - boolean - 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.
            • + *
          • + *
          + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
            + *
          • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
          • + *
          • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
          + * @return CFResponse A 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. * *

          @@ -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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @param array $opt (Optional) An associative array of parameters that can have the following keys:

            + *
          • ForceDelete - boolean - 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.
          • *
          • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
          • *
          • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
          * @return CFResponse A 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 LaunchConfiguration. * - * 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] @@ -344,9 +401,28 @@ public function delete_launch_configuration($launch_configuration_name, $opt = n } /** - * Deletes a policy created by PutScalingPolicy + * Deletes notifications created by PutNotificationConfiguration. * - * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] + * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] + * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
            + *
          • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
          • + *
          • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
          + * @return CFResponse A 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 PutScalingPolicy. + * + * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @param array $opt (Optional) An associative array of parameters that can have the following keys:
            *
          • AutoScalingGroupName - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
          • *
          • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
          • @@ -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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @param array $opt (Optional) An associative array of parameters that can have the following keys:
              - *
            • AutoScalingGroupName - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
            • + *
            • AutoScalingGroupName - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
            • *
            • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
            • *
            • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
            * @return CFResponse A object containing a parsed HTTP response. @@ -380,6 +456,35 @@ public function delete_scheduled_action($scheduled_action_name, $opt = null) return $this->authenticate('DeleteScheduledAction', $opt); } + /** + * 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 PropagateAtLaunch flag defines whether the new tag will be applied to instances launched after the tag is created.
              + *
            • x - array - Optional - This represents a simple array index.
                + *
              • ResourceId - string - Optional - The name of the tag. [Constraints: The value must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
              • + *
              • ResourceType - string - Optional - The kind of resource to which the tag is applied. [Constraints: The value must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
              • + *
              • Key - string - Required - The key of the tag. [Constraints: The value must be between 1 and 128 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
              • + *
              • Value - string - Optional - The value of the tag. [Constraints: The value must be between 0 and 256 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
              • + *
              • PropagateAtLaunch - boolean - 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.
              • + *
            • + *
            + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
              + *
            • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
            • + *
            • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
            + * @return CFResponse A 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 PutScalingPolicy action. * @@ -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 NextToken + * parameter. * * @param array $opt (Optional) An associative array of parameters that can have the following keys:
              *
            • AutoScalingGroupNames - string|array - Optional - A list of Auto Scaling group names. Pass a string for a single value, or an indexed array for multiple values.
            • @@ -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 InstanceIds 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 NextToken + * parameter. * * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                *
              • InstanceIds - string|array - 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.
              • @@ -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:
                  + *
                • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                • + *
                • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                + * @return CFResponse A 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:
                  *
                • LaunchConfigurationNames - string|array - Optional - A list of launch configuration names. Pass a string for a single value, or an indexed array for multiple values.
                • *
                • NextToken - string - Optional - A string that marks the start of the next batch of returned results. [Constraints: The value must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                • - *
                • MaxRecords - integer - Optional - The maximum number of launch configurations.
                • + *
                • MaxRecords - integer - Optional - The maximum number of launch configurations. The default is 100.
                • *
                • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                • *
                • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                * @return CFResponse A object containing a parsed HTTP response. @@ -502,14 +626,42 @@ public function describe_metric_collection_types($opt = null) return $this->authenticate('DescribeMetricCollectionTypes', $opt); } + /** + * 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:
                  + *
                • AutoScalingGroupNames - string|array - Optional - The name of the Auto Scaling group. Pass a string for a single value, or an indexed array for multiple values.
                • + *
                • NextToken - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                • + *
                • MaxRecords - integer - Optional - Maximum number of records to be returned.
                • + *
                • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                • + *
                • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                + * @return CFResponse A 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 NextToken parameter. * * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                  *
                • AutoScalingGroupName - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                • - *
                • PolicyNames - string|array - 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.
                • + *
                • PolicyNames - string|array - 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.
                • *
                • NextToken - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                • *
                • MaxRecords - integer - Optional - The maximum number of policies that will be described with each call.
                • *
                • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                • @@ -535,16 +687,16 @@ public function describe_policies($opt = null) /** * Returns the scaling activities for the specified Auto Scaling group. * - * If the specified ActivityIds 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 ActivityIds 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. + * NextToken parameter. * * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                    - *
                  • ActivityIds - string|array - 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.
                  • + *
                  • ActivityIds - string|array - 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.
                  • *
                  • AutoScalingGroupName - string - Optional - The name of the AutoScalingGroup. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                  • *
                  • MaxRecords - integer - Optional - The maximum number of scaling activities to return.
                  • *
                  • NextToken - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                  • @@ -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 * DescribeScalingActivities. * * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                      *
                    • AutoScalingGroupName - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                    • *
                    • ScheduledActionNames - string|array - 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.
                    • *
                    • StartTime - string - 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 .
                    • - *
                    • EndTime - string - 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 .
                    • + *
                    • EndTime - string - 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 .
                    • *
                    • NextToken - string - Optional - A string that marks the start of the next batch of returned results. [Constraints: The value must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                    • *
                    • MaxRecords - integer - Optional - The maximum number of scheduled actions to return.
                    • *
                    • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                    • @@ -628,9 +780,49 @@ public function describe_scheduled_actions($opt = null) return $this->authenticate('DescribeScheduledActions', $opt); } + /** + * 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:
                        + *
                      • Filters - array - Optional - The value of the filter type used to identify the tags to be returned. For example, you can filter so thatDescribeTagsreturns 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).
                          + *
                        • x - array - Optional - This represents a simple array index.
                            + *
                          • Name - string - Optional - The name of the filter. [Constraints: The value must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                          • + *
                          • Values - string|array - Optional - The value of the filter. Pass a string for a single value, or an indexed array for multiple values.
                          • + *
                        • + *
                      • + *
                      • NextToken - string - Optional - A string that marks the start of the next batch of returned results. [Constraints: The value must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                      • + *
                      • MaxRecords - integer - Optional - The maximum number of records to return.
                      • + *
                      • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                      • + *
                      • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                      + * @return CFResponse A 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. + * AutoScalingGroupName. You can specify the list of affected metrics with the + * Metrics 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                        @@ -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. + * AutoScalingGroupName. You can specify the list of enabled metrics with the + * Metrics parameter. * - * Auto scaling metrics collection can be turned on only if the - * InstanceMonitoring.Enabled flag, in the Auto Scaling group's launch configuration, - * is set to true. + * Auto scaling metrics collection can be turned on only if the InstanceMonitoring + * flag, in the Auto Scaling group's launch configuration, is set to True. * - * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] + * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                          *
                        • Metrics - string|array - Optional - The list of metrics to collect. If no metrics are specified, all metrics are enabled. The following metrics are supported:
                          • GroupMinSize
                          • GroupMaxSize
                          • GroupDesiredCapacity
                          • GroupInServiceInstances
                          • GroupPendingInstances
                          • GroupTerminatingInstances
                          • GroupTotalInstances
                          Pass a string for a single value, or an indexed array for multiple values.
                        • @@ -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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                            - *
                          • AutoScalingGroupName - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                          • - *
                          • HonorCooldown - boolean - Optional - Set to True if you want Auto Scaling to reject this request if the Auto Scaling group is in cooldown.
                          • + *
                          • AutoScalingGroupName - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                          • + *
                          • HonorCooldown - boolean - Optional - Set to True if you want Auto Scaling to reject this request when the Auto Scaling group is in cooldown.
                          • *
                          • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                          • *
                          • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                          * @return CFResponse A object containing a parsed HTTP response. @@ -709,14 +901,43 @@ public function execute_policy($policy_name, $opt = null) return $this->authenticate('ExecutePolicy', $opt); } + /** + * 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 PutNotificationConfiguration 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] + * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] + * @param string|array $notification_types (Required) The type of events that will trigger the notification. For more information, go to DescribeAutoScalingNotificationTypes. 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:
                            + *
                          • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                          • + *
                          • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                          + * @return CFResponse A 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] + * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] - * @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. 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 string $adjustment_type (Required) Specifies whether the ScalingAdjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                            *
                          • Cooldown - integer - Optional - The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.
                          • @@ -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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] + * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                              - *
                            • Time - string - Optional - The time for this action to start. May be passed as a number of seconds since UNIX Epoch, or any string compatible with .
                            • - *
                            • EndTime - string - Optional - May be passed as a number of seconds since UNIX Epoch, or any string compatible with .
                            • - *
                            • Recurrence - string - Optional - [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                            • + *
                            • Time - string - Optional - Time is deprecated. The time for this action to start. Time is an alias for StartTime and can be specified instead of StartTime, or vice versa. If both Time and StartTime are specified, their values should be identical. Otherwise, PutScheduledUpdateGroupAction will return an error. May be passed as a number of seconds since UNIX Epoch, or any string compatible with .
                            • + *
                            • StartTime - string - Optional - The time for this action to start, as in --start-time 2010-06-01T00:00:00Z. When StartTime and EndTime are specified with Recurrence, 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 .
                            • + *
                            • EndTime - string - Optional - The time for this action to end. May be passed as a number of seconds since UNIX Epoch, or any string compatible with .
                            • + *
                            • Recurrence - string - 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 Wikipedia, The Free Encyclopedia. When StartTime and EndTime are specified with Recurrence, 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                            • *
                            • MinSize - integer - Optional - The minimum size for the new Auto Scaling group.
                            • *
                            • MaxSize - integer - Optional - The maximum size for the Auto Scaling group.
                            • - *
                            • DesiredCapacity - integer - Optional - The number of EC2 instances that should be running in the group.
                            • + *
                            • DesiredCapacity - integer - Optional - The number of Amazon EC2 instances that should be running in the group.
                            • *
                            • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                            • *
                            • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                            * @return CFResponse A object containing a parsed HTTP response. @@ -764,6 +986,12 @@ public function put_scheduled_update_group_action($auto_scaling_group_name, $sch $opt['Time'] = $this->util->convert_date_to_iso8601($opt['Time']); } + // Optional DateTime + if (isset($opt['StartTime'])) + { + $opt['StartTime'] = $this->util->convert_date_to_iso8601($opt['StartTime']); + } + // Optional DateTime if (isset($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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                              - *
                            • ScalingProcesses - string|array - Optional - The processes that you want to suspend or resume, which can include one or more of the following:
                              • Launch
                              • Terminate
                              • HealthCheck
                              • ReplaceUnhealthy
                              • AZRebalance
                              • AlarmNotifications
                              • ScheduledActions
                              To suspend all process types, omit this parameter. Pass a string for a single value, or an indexed array for multiple values.
                            • + *
                            • ScalingProcesses - string|array - Optional - The processes that you want to suspend or resume, which can include one or more of the following:
                              • Launch
                              • Terminate
                              • HealthCheck
                              • ReplaceUnhealthy
                              • AZRebalance
                              • AlarmNotifications
                              • ScheduledActions
                              • AddToLoadBalancer
                              To suspend all process types, omit this parameter. Pass a string for a single value, or an indexed array for multiple values.
                            • *
                            • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                            • *
                            • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                            * @return CFResponse A 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 AutoScalingGroup 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 SetDesiredCapacity: one for users of the Auto @@ -815,7 +1043,7 @@ public function resume_processes($auto_scaling_group_name, $opt = null) * SetDesiredCapacity 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 * SetDesiredCapacity 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) * SetDesiredCapacity to honor cooldown by setting the HonorCooldown * parameter to true. * - * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] - * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] + * @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:
                              - *
                            • HonorCooldown - boolean - Optional - By default, SetDesiredCapacity overrides any cooldown period. Set to True if you want Auto Scaling to reject this request if the Auto Scaling group is in cooldown.
                            • + *
                            • HonorCooldown - boolean - Optional - By default, SetDesiredCapacity overrides any cooldown period. Set to True if you want Auto Scaling to reject this request when the Auto Scaling group is in cooldown.
                            • *
                            • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                            • *
                            • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                            * @return CFResponse A 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] + * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                              *
                            • ShouldRespectGracePeriod - boolean - Optional - If True, this call should respect the grace period associated with the group.
                            • @@ -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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                - *
                              • ScalingProcesses - string|array - Optional - The processes that you want to suspend or resume, which can include one or more of the following:
                                • Launch
                                • Terminate
                                • HealthCheck
                                • ReplaceUnhealthy
                                • AZRebalance
                                • AlarmNotifications
                                • ScheduledActions
                                To suspend all process types, omit this parameter. Pass a string for a single value, or an indexed array for multiple values.
                              • + *
                              • ScalingProcesses - string|array - Optional - The processes that you want to suspend or resume, which can include one or more of the following:
                                • Launch
                                • Terminate
                                • HealthCheck
                                • ReplaceUnhealthy
                                • AZRebalance
                                • AlarmNotifications
                                • ScheduledActions
                                • AddToLoadBalancer
                                To suspend all process types, omit this parameter. Pass a string for a single value, or an indexed array for multiple values.
                              • *
                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                              • *
                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                              * @return CFResponse A object containing a parsed HTTP response. @@ -906,7 +1134,7 @@ public function suspend_processes($auto_scaling_group_name, $opt = null) * immediately. *

                              * - * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] + * @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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*] * @param boolean $should_decrement_desired_capacity (Required) Specifies whether (true) or not (false) terminating this instance should also decrement the size of the AutoScalingGroup. * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                *
                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                              • @@ -927,8 +1155,8 @@ public function terminate_instance_in_auto_scaling_group($instance_id, $should_d * *

                                * To update an Auto Scaling group with a launch configuration that has the - * InstanceMonitoring.enabled flag set to false, you must first ensure - * that collection of group metrics is disabled. Otherwise, calls to + * InstanceMonitoring flag set to False, you must first ensure that + * collection of group metrics is disabled. Otherwise, calls to * UpdateAutoScalingGroup will fail. If you have previously enabled group metrics * collection, you can disable collection of all group metrics by calling * DisableMetricsCollection. @@ -950,11 +1178,11 @@ public function terminate_instance_in_auto_scaling_group($instance_id, $should_d *
                              • MaxSize - integer - Optional - The maximum size of the Auto Scaling group.
                              • *
                              • DesiredCapacity - integer - Optional - The desired capacity for the Auto Scaling group.
                              • *
                              • DefaultCooldown - integer - Optional - The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.
                              • - *
                              • AvailabilityZones - string|array - Optional - Availability zones for the group. Pass a string for a single value, or an indexed array for multiple values.
                              • + *
                              • AvailabilityZones - string|array - Optional - Availability Zones for the group. Pass a string for a single value, or an indexed array for multiple values.
                              • *
                              • HealthCheckType - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                              • *
                              • HealthCheckGracePeriod - integer - 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.
                              • - *
                              • PlacementGroup - string - Optional - The name of the cluster placement group, if applicable. For more information, go to Using Cluster Instances in the Amazon EC2 User Guide. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                              • - *
                              • VPCZoneIdentifier - string - 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: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                              • + *
                              • PlacementGroup - string - Optional - The name of the cluster placement group, if applicable. For more information, go to Using Cluster Instances in the Amazon EC2 User Guide. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                              • + *
                              • VPCZoneIdentifier - string - Optional - The subnet identifier for the Amazon VPC connection, if applicable. You can specify several subnets in a comma-separated list. When you specify VPCZoneIdentifier with AvailabilityZones, ensure that the subnets' Availability Zones match the values you specify for AvailabilityZones. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                              • *
                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                              • *
                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                              * @return CFResponse A object containing a parsed HTTP response. diff --git a/services/cloudfront.class.php b/services/cloudfront.class.php index a8e3285..8293943 100755 --- a/services/cloudfront.class.php +++ b/services/cloudfront.class.php @@ -1,6 +1,6 @@ base_xml = '<%s xmlns="http://cloudfront.amazonaws.com/doc/' . $this->api_version . '/">'; - // 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 GET, POST, PUT, DELETE, and HEAD. - * @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 GET, POST, PUT, DELETE, and HEAD. + * @param array $payload (Required) An associative array of parameters for authenticating. See the individual methods for allowed keys. * @return CFResponse A 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 . 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 GET, POST, PUT, DELETE, and HEAD. - * @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 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); + $origin->addChild('OriginAccessIdentity', $xml->S3Origin->OriginAccessIdentity); } } elseif (isset($xml->CustomOrigin)) { $origin = $update->addChild('CustomOrigin'); $origin->addChild('DNSName', $xml->CustomOrigin->DNSName); + + // origin access identity + if (isset($opt['OriginAccessIdentity'])) + { + $origin->addChild('OriginAccessIdentity', 'origin-access-identity/cloudfront/' . $opt['OriginAccessIdentity']); + } + elseif (isset($xml->CustomOrigin->OriginAccessIdentity)) + { + $origin->addChild('OriginAccessIdentity', $xml->CustomOrigin->OriginAccessIdentity); + } } + $update->addChild('CallerReference', $xml->CallerReference); // Add existing CNAME values @@ -858,7 +836,9 @@ public function create_distribution($origin, $caller_reference, $opt = null) $xml = $this->generate_config_xml($origin, $caller_reference, $opt); $path = '/' . ((isset($opt['Streaming']) && $opt['Streaming'] == (bool) true) ? 'streaming-distribution' : 'distribution'); - return $this->authenticate('POST', $path, $opt, $xml, null); + $opt = array_merge($opt, array('path' => $path, 'xml' => $xml)); + + return $this->authenticate('POST', $opt); } /** @@ -894,7 +874,9 @@ public function list_distributions($opt = null) $path = '/' . ((isset($opt['Streaming']) && $opt['Streaming'] == (bool) true) ? 'streaming-distribution' : 'distribution'); - return $this->authenticate('GET', $path, $opt, null, null); + $opt = array_merge($opt, array('path' => $path)); + + return $this->authenticate('GET', $opt); } /** @@ -919,7 +901,9 @@ public function get_distribution_info($distribution_id, $opt = null) $path = '/' . ((isset($opt['Streaming']) && $opt['Streaming'] == (bool) true) ? 'streaming-distribution' : 'distribution'); $path .= '/' . $distribution_id; - return $this->authenticate('GET', $path, $opt, null, null); + $opt = array_merge($opt, array('path' => $path)); + + return $this->authenticate('GET', $opt); } /** @@ -947,7 +931,9 @@ public function delete_distribution($distribution_id, $etag, $opt = null) $path = '/' . ((isset($opt['Streaming']) && $opt['Streaming'] == (bool) true) ? 'streaming-distribution' : 'distribution'); $path .= '/' . $distribution_id; - return $this->authenticate('DELETE', $path, $opt, null, $etag); + $opt = array_merge($opt, array('path' => $path, 'etag' => $etag)); + + return $this->authenticate('DELETE', $opt); } /** @@ -972,7 +958,9 @@ public function get_distribution_config($distribution_id, $opt = null) $path = '/' . ((isset($opt['Streaming']) && $opt['Streaming'] == (bool) true) ? 'streaming-distribution' : 'distribution'); $path .= '/' . $distribution_id . '/config'; - return $this->authenticate('GET', $path, $opt, null, null); + $opt = array_merge($opt, array('path' => $path)); + + return $this->authenticate('GET', $opt); } /** @@ -999,7 +987,9 @@ public function set_distribution_config($distribution_id, $xml, $etag, $opt = nu $path = '/' . ((isset($opt['Streaming']) && $opt['Streaming'] == (bool) true) ? 'streaming-distribution' : 'distribution'); $path .= '/' . $distribution_id . '/config'; - return $this->authenticate('PUT', $path, $opt, $xml, $etag); + $opt = array_merge($opt, array('path' => $path, 'xml' => $xml, 'etag' => $etag)); + + return $this->authenticate('PUT', $opt); } @@ -1025,7 +1015,9 @@ public function create_oai($caller_reference, $opt = null) $path = '/origin-access-identity/cloudfront'; $xml = $this->generate_oai_xml($caller_reference, $opt); - return $this->authenticate('POST', $path, $opt, $xml, null); + $opt = array_merge($opt, array('path' => $path, 'xml' => $xml)); + + return $this->authenticate('POST', $opt); } /** @@ -1057,7 +1049,9 @@ public function list_oais($opt = null) $path = '/origin-access-identity/cloudfront'; - return $this->authenticate('GET', $path, $opt, null, null); + $opt = array_merge($opt, array('path' => $path)); + + return $this->authenticate('GET', $opt); } /** @@ -1076,7 +1070,9 @@ public function get_oai($identity_id, $opt = null) $path = '/origin-access-identity/cloudfront/' . $identity_id; - return $this->authenticate('GET', $path, $opt, null, null); + $opt = array_merge($opt, array('path' => $path)); + + return $this->authenticate('GET', $opt); } /** @@ -1099,7 +1095,9 @@ public function delete_oai($identity_id, $etag, $opt = null) $path = '/origin-access-identity/cloudfront/' . $identity_id; - return $this->authenticate('DELETE', $path, $opt, null, $etag); + $opt = array_merge($opt, array('path' => $path, 'etag' => $etag)); + + return $this->authenticate('DELETE', $opt); } /** @@ -1118,7 +1116,9 @@ public function get_oai_config($identity_id, $opt = null) $path = '/origin-access-identity/cloudfront/' . $identity_id . '/config'; - return $this->authenticate('GET', $path, $opt, null, null); + $opt = array_merge($opt, array('path' => $path)); + + return $this->authenticate('GET', $opt); } /** @@ -1145,7 +1145,9 @@ public function set_oai_config($identity_id, $xml, $etag, $opt = null) $path = '/origin-access-identity/cloudfront/' . $identity_id . '/config'; - return $this->authenticate('PUT', $path, $opt, $xml, $etag); + $opt = array_merge($opt, array('path' => $path, 'xml' => $xml, 'etag' => $etag)); + + return $this->authenticate('PUT', $opt); } @@ -1172,7 +1174,9 @@ public function create_invalidation($distribution_id, $caller_reference, $paths, $path = '/distribution/' . $distribution_id . '/invalidation'; $xml = $this->generate_invalidation_xml($caller_reference, $opt); - return $this->authenticate('POST', $path, $opt, $xml, null); + $opt = array_merge($opt, array('path' => $path, 'xml' => $xml)); + + return $this->authenticate('POST', $opt); } /** @@ -1204,7 +1208,9 @@ public function list_invalidations($distribution_id, $opt = null) $path = '/distribution/' . $distribution_id . '/invalidation'; - return $this->authenticate('GET', $path, $opt, null, null); + $opt = array_merge($opt, array('path' => $path)); + + return $this->authenticate('GET', $opt); } /** @@ -1224,7 +1230,9 @@ public function get_invalidation($distribution_id, $invalidation_id, $opt = null $path = '/distribution/' . $distribution_id . '/invalidation/' . $invalidation_id; - return $this->authenticate('GET', $path, $opt, null, null); + $opt = array_merge($opt, array('path' => $path)); + + return $this->authenticate('GET', $opt); } diff --git a/services/cloudwatch.class.php b/services/cloudwatch.class.php index fbf69f1..cc59410 100644 --- a/services/cloudwatch.class.php +++ b/services/cloudwatch.class.php @@ -1,6 +1,6 @@ *
                            * - * @version 2011.12.13 + * @version 2012.01.16 * @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/cloudwatch/ Amazon CloudWatch @@ -386,18 +386,13 @@ public function enable_alarm_actions($alarm_names, $opt = null) *
                          • Statistics for up to 35 instances over a span of 24 hours
                          • *
                          • Statistics for up to 2 instances over a span of 2 weeks
                          • *
                          - * - * For information about the namespace, metric names, and dimensions that other Amazon Web - * Services products use to send metrics to Cloudwatch, go to - * CloudWatch Support for AWS Products in the Amazon CloudWatch Developer Guide. * * @param string $namespace (Required) The namespace of the metric. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: [^:].*] * @param string $metric_name (Required) The name of the metric. * @param string $start_time (Required) The time stamp to use for determining the first datapoint to return. The value specified is inclusive; results include datapoints with the time stamp specified.

                          The specified start time is rounded down to the nearest value. Datapoints are returned for start times up to two weeks in the past. Specified start times that are more than two weeks in the past will not return datapoints for metrics that are older than two weeks.

                          May be passed as a number of seconds since UNIX Epoch, or any string compatible with . * @param string $end_time (Required) The time stamp to use for determining the last datapoint to return. The value specified is exclusive; results will include datapoints up to the time stamp specified. May be passed as a number of seconds since UNIX Epoch, or any string compatible with . * @param integer $period (Required) The granularity, in seconds, of the returned datapoints. Period must be at least 60 seconds and must be a multiple of 60. The default value is 60. - * @param string|array $statistics (Required) The metric statistics to return. For information about specific statistics returned by GetMetricStatistics, go to Statistics in the Amazon CloudWatch Developer Guide. Valid Values: Average | Sum | SampleCount | Maximum | Minimum Pass a string for a single value, or an indexed array for multiple values. + * @param string|array $statistics (Required) The metric statistics to return. Pass a string for a single value, or an indexed array for multiple values. * @param string $unit (Required) The unit for the metric. [Allowed values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None] * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                            *
                          • Dimensions - array - Optional - A list of dimensions describing qualities of the metric.
                              diff --git a/services/dynamodb.class.php b/services/dynamodb.class.php new file mode 100644 index 0000000..6a9074a --- /dev/null +++ b/services/dynamodb.class.php @@ -0,0 +1,806 @@ +. + * + * @param array $options (Optional) An associative array of parameters that can have the following keys:
                                + *
                              • certificate_authority - boolean - Optional - Determines which Cerificate Authority file to use. A value of boolean false will use the Certificate Authority file available on the system. A value of boolean true will use the Certificate Authority provided by the SDK. Passing a file system path to a Certificate Authority file (chmodded to 0755) will use that. Leave this set to false if you're not sure.
                              • + *
                              • credentials - string - Optional - The name of the credential set to use for authentication.
                              • + *
                              • default_cache_config - string - Optional - This option allows a preferred storage type to be configured for long-term caching. This can be changed later using the method. Valid values are: apc, xcache, or a file system path such as ./cache or /tmp/cache/.
                              • + *
                              • key - string - Optional - Your AWS key, or a session key. If blank, the default credential set will be used.
                              • + *
                              • secret - string - Optional - Your AWS secret key, or a session secret key. If blank, the default credential set will be used.
                              • + *
                              • token - string - Optional - An AWS session token.
                              + * @return void + */ + public function __construct(array $options = array()) + { + $this->api_version = '2011-12-05'; + $this->hostname = self::DEFAULT_URL; + $this->auth_class = 'AuthV3JSON'; + $this->operation_prefix = 'x-amz-target:DynamoDB_20111205.'; + + parent::__construct($options); + + // Default caching mechanism is required + if (!$this->credentials->default_cache_config) + { + // @codeCoverageIgnoreStart + throw new DynamoDB_Exception('The DynamoDB class requires the "default_cache_config" configuration to be set in the config.inc.php file.'); + // @codeCoverageIgnoreEnd + } + + $token = new AmazonSTS($options); + $token->set_cache_config($this->credentials->default_cache_config); + $response = $token->cache(3600)->get_session_token(); + + $this->key = (string) $response->body->GetSessionTokenResult->Credentials->AccessKeyId; + $this->secret_key = (string) $response->body->GetSessionTokenResult->Credentials->SecretAccessKey; + $this->auth_token = (string) $response->body->GetSessionTokenResult->Credentials->SessionToken; + } + + + /*%******************************************************************************************%*/ + // SETTERS + + /** + * This allows you to explicitly sets the region for the service to use. + * + * @param string $region (Required) The region to explicitly set. Available options are . + * @return $this A reference to the current instance. + */ + public function set_region($region) + { + // @codeCoverageIgnoreStart + $this->set_hostname($region); + return $this; + // @codeCoverageIgnoreEnd + } + + + /*%******************************************************************************************%*/ + // SERVICE METHODS + + /** + * Retrieves the attributes for multiple items from multiple tables using their primary keys. + * + * The maximum number of item attributes that can be retrieved for a single operation is 100. + * Also, the number of items retrieved is constrained by a 1 MB the size limit. If the response + * size limit is exceeded or a partial result is returned due to an internal processing failure, + * Amazon DynamoDB returns an UnprocessedKeys value so you can retry the operation + * starting with the next item to get. + * + * Amazon DynamoDB automatically adjusts the number of items returned per page to enforce this + * limit. For example, even if you ask to retrieve 100 items, but each individual item is 50k in + * size, the system returns 20 items and an appropriate UnprocessedKeys value so you + * can get the next page of results. If necessary, your application needs its own logic to + * assemble the pages of results into one set. + * + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                + *
                              • RequestItems - array - Required - A map of the table name and corresponding items to get by primary key. While requesting items, each table name can be invoked only once per operation.
                                  + *
                                • [table_name] - array - Optional - The name of the table to use for the lookup.
                                    + *
                                  • Keys - array - Required -

                                    The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.

                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • HashKeyElement - array - Required - A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
                                          + *
                                        • x - array - Optional - This represents a simple array index.
                                            + *
                                          • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                          • + *
                                          • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                          • + *
                                          • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                          • + *
                                          • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                          • + *
                                        • + *
                                      • + *
                                      • RangeKeyElement - array - Optional - A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
                                          + *
                                        • x - array - Optional - This represents a simple array index.
                                            + *
                                          • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                          • + *
                                          • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                          • + *
                                          • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                          • + *
                                          • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                          • + *
                                        • + *
                                      • + *
                                    • + *
                                  • + *
                                  • AttributesToGet - string|array - Optional - List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result. Pass a string for a single value, or an indexed array for multiple values.
                                  • + *
                                • + *
                              • + *
                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                              • + *
                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                              + * @return CFResponse A object containing a parsed HTTP response. + */ + public function batch_get_item($opt = null) + { + if (!$opt) $opt = array(); + + $opt = json_encode($opt); + return $this->authenticate('BatchGetItem', $opt); + } + + /** + * Adds a new table to your account. + * + * The table name must be unique among those associated with the AWS Account issuing the request, + * and the AWS Region that receives the request (e.g. us-east-1). + * + * The CreateTable operation triggers an asynchronous workflow to begin creating the + * table. Amazon DynamoDB immediately returns the state of the table (CREATING) until + * the table is in the ACTIVE state. Once the table is in the ACTIVE + * state, you can perform data plane operations. + * + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                + *
                              • TableName - string - Required - The name of the table you want to create. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: [a-zA-Z0-9_.-]+]
                              • + *
                              • KeySchema - array - Required - The KeySchema identifies the primary key as a one attribute primary key (hash) or a composite two attribute (hash-and-range) primary key. Single attribute primary keys have one index value: a HashKeyElement. A composite hash-and-range primary key contains two attribute values: a HashKeyElement and a RangeKeyElement.
                                  + *
                                • x - array - Optional - This represents a simple array index.
                                    + *
                                  • HashKeyElement - array - Required - A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • AttributeName - string - Required - The AttributeName of the KeySchemaElement.
                                      • + *
                                      • AttributeType - string - Required - The AttributeType of the KeySchemaElement which can be a String or a Number. [Allowed values: S, N]
                                      • + *
                                    • + *
                                  • + *
                                  • RangeKeyElement - array - Optional - A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • AttributeName - string - Required - The AttributeName of the KeySchemaElement.
                                      • + *
                                      • AttributeType - string - Required - The AttributeType of the KeySchemaElement which can be a String or a Number. [Allowed values: S, N]
                                      • + *
                                    • + *
                                  • + *
                                • + *
                              • + *
                              • ProvisionedThroughput - array - Required - Provisioned throughput reserves the required read and write resources for your table in terms of ReadCapacityUnits and WriteCapacityUnits. Values for provisioned throughput depend upon your expected read/write rates, item size, and consistency. Provide the expected number of read and write operations, assuming an item size of 1k and strictly consistent reads. For 2k item size, double the value. For 3k, triple the value, etc. Eventually-consistent reads consume half the resources of strictly consistent reads.
                                  + *
                                • x - array - Optional - This represents a simple array index.
                                    + *
                                  • ReadCapacityUnits - long - Required - ReadCapacityUnits are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the ReadCapacityUnits. Eventually-consistent reads only require half the ReadCapacityUnits of stirctly consistent reads.
                                  • + *
                                  • WriteCapacityUnits - long - Required - WriteCapacityUnits are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the WriteCapacityUnits.
                                  • + *
                                • + *
                              • + *
                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                              • + *
                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                              + * @return CFResponse A object containing a parsed HTTP response. + */ + public function create_table($opt = null) + { + if (!$opt) $opt = array(); + + $opt = json_encode($opt); + return $this->authenticate('CreateTable', $opt); + } + + /** + * Deletes a single item in a table by primary key. + * + * You can perform a conditional delete operation that deletes the item if it exists, or if it has + * an expected attribute value. + * + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                + *
                              • TableName - string - Required - The name of the table in which you want to delete an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: [a-zA-Z0-9_.-]+]
                              • + *
                              • Key - array - Required - The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.
                                  + *
                                • x - array - Optional - This represents a simple array index.
                                    + *
                                  • HashKeyElement - array - Required - A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                      • + *
                                      • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                      • + *
                                      • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                      • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                    • + *
                                  • + *
                                  • RangeKeyElement - array - Optional - A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                      • + *
                                      • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                      • + *
                                      • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                      • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                    • + *
                                  • + *
                                • + *
                              • + *
                              • Expected - array - Optional - Designates an attribute for a conditional modification. The Expected parameter allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute has a particular value before modifying it.
                                  + *
                                • x - array - Optional - This represents a simple array index.
                                    + *
                                  • key - string - Optional -
                                  • + *
                                  • value - array - Optional - Allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute value already exists; or if the attribute value exists and has a particular value before changing it.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • Value - array - Optional - Specify whether or not a value already exists and has a specific content for the attribute name-value pair.
                                          + *
                                        • x - array - Optional - This represents a simple array index.
                                            + *
                                          • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                          • + *
                                          • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                          • + *
                                          • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                          • + *
                                          • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                          • + *
                                        • + *
                                      • + *
                                      • Exists - boolean - Optional - Specify whether or not a value already exists for the attribute name-value pair.
                                      • + *
                                    • + *
                                  • + *
                                • + *
                              • + *
                              • ReturnValues - string - Optional - Use this parameter if you want to get the attribute name-value pairs before or after they are modified. For PUT operations, the possible parameter values are NONE (default) or ALL_OLD. For update operations, the possible parameter values are NONE (default) or ALL_OLD, UPDATED_OLD, ALL_NEW or UPDATED_NEW.
                                • NONE: Nothing is returned.
                                • ALL_OLD: Returns the attributes of the item as they were before the operation.
                                • UPDATED_OLD: Returns the values of the updated attributes, only, as they were before the operation.
                                • ALL_NEW: Returns all the attributes and their new values after the operation.
                                • UPDATED_NEW: Returns the values of the updated attributes, only, as they are after the operation.
                                [Allowed values: NONE, ALL_OLD, UPDATED_OLD, ALL_NEW, UPDATED_NEW]
                              • + *
                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                              • + *
                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                              + * @return CFResponse A object containing a parsed HTTP response. + */ + public function delete_item($opt = null) + { + if (!$opt) $opt = array(); + + $opt = json_encode($opt); + return $this->authenticate('DeleteItem', $opt); + } + + /** + * Deletes a table and all of its items. + * + * If the table is in the ACTIVE state, you can delete it. If a table is in + * CREATING or UPDATING states then DeleteTable returns a + * ResourceInUseException. If the specified table does not exist, Amazon DynamoDB + * returns a ResourceNotFoundException. + * + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                + *
                              • TableName - string - Required - The name of the table you want to delete. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: [a-zA-Z0-9_.-]+]
                              • + *
                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                              • + *
                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                              + * @return CFResponse A object containing a parsed HTTP response. + */ + public function delete_table($opt = null) + { + if (!$opt) $opt = array(); + + $opt = json_encode($opt); + return $this->authenticate('DeleteTable', $opt); + } + + /** + * Retrieves information about the table, including the current status of the table, the primary + * key schema and when the table was created. + * + * If the table does not exist, the server returns a ResourceNotFoundException. + * + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                + *
                              • TableName - string - Required - The name of the table you want to describe. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: [a-zA-Z0-9_.-]+]
                              • + *
                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                              • + *
                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                              + * @return CFResponse A object containing a parsed HTTP response. + */ + public function describe_table($opt = null) + { + if (!$opt) $opt = array(); + + $opt = json_encode($opt); + return $this->authenticate('DescribeTable', $opt); + } + + /** + * Retrieves a set of Attributes for an item that matches the primary key. + * + * The GetItem operation provides an eventually-consistent read by default. If + * eventually-consistent reads are not acceptable for your application, use + * ConsistentRead. Although this operation might take longer than a standard read, it + * always returns the last updated value. + * + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                + *
                              • TableName - string - Required - The name of the table in which you want to get an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: [a-zA-Z0-9_.-]+]
                              • + *
                              • Key - array - Required - The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.
                                  + *
                                • x - array - Optional - This represents a simple array index.
                                    + *
                                  • HashKeyElement - array - Required - A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                      • + *
                                      • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                      • + *
                                      • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                      • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                    • + *
                                  • + *
                                  • RangeKeyElement - array - Optional - A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                      • + *
                                      • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                      • + *
                                      • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                      • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                    • + *
                                  • + *
                                • + *
                              • + *
                              • AttributesToGet - string|array - Optional - List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result. Pass a string for a single value, or an indexed array for multiple values.
                              • + *
                              • ConsistentRead - boolean - Optional - If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.
                              • + *
                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                              • + *
                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                              + * @return CFResponse A object containing a parsed HTTP response. + */ + public function get_item($opt = null) + { + if (!$opt) $opt = array(); + + // List (non-map) + if (isset($opt['AttributesToGet'])) + { + $opt['AttributesToGet'] = (is_array($opt['AttributesToGet']) ? $opt['AttributesToGet'] : array($opt['AttributesToGet'])); + } + + $opt = json_encode($opt); + return $this->authenticate('GetItem', $opt); + } + + /** + * Retrieves a paginated list of table names created by the AWS Account of the caller in the AWS + * Region (e.g. us-east-1). + * + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                + *
                              • ExclusiveStartTableName - string - Optional - The name of the table that starts the list. If you already ran a ListTables operation and received a LastEvaluatedTableName value in the response, use that value here to continue the list. [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: [a-zA-Z0-9_.-]+]
                              • + *
                              • Limit - integer - Optional - A number of maximum table names to return.
                              • + *
                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                              • + *
                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                              + * @return CFResponse A object containing a parsed HTTP response. + */ + public function list_tables($opt = null) + { + if (!$opt) $opt = array(); + + $opt = json_encode($opt); + return $this->authenticate('ListTables', $opt); + } + + /** + * Creates a new item, or replaces an old item with a new item (including all the attributes). + * + * If an item already exists in the specified table with the same primary key, the new item + * completely replaces the existing item. You can perform a conditional put (insert a new item if + * one with the specified primary key doesn't exist), or replace an existing item if it has + * certain attribute values. + * + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                + *
                              • TableName - string - Required - The name of the table in which you want to put an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: [a-zA-Z0-9_.-]+]
                              • + *
                              • Item - array - Required - A map of the attributes for the item, and must include the primary key values that define the item. Other attribute name-value pairs can be provided for the item.
                                  + *
                                • [attribute_name] - array - Optional - The name of the attribute to use for the lookup.
                                    + *
                                  • x - array - Optional - This represents a simple array index.
                                      + *
                                    • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                    • + *
                                    • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                    • + *
                                    • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                    • + *
                                    • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                    • + *
                                  • + *
                                • + *
                              • + *
                              • Expected - array - Optional - Designates an attribute for a conditional modification. The Expected parameter allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute has a particular value before modifying it.
                                  + *
                                • [attribute_name] - array - Optional - Allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute value already exists; or if the attribute value exists and has a particular value before changing it.
                                    + *
                                  • x - array - Optional - This represents a simple array index.
                                      + *
                                    • Value - array - Optional - Specify whether or not a value already exists and has a specific content for the attribute name-value pair.
                                        + *
                                      • x - array - Optional - This represents a simple array index.
                                          + *
                                        • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                        • + *
                                        • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                        • + *
                                        • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                        • + *
                                        • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                        • + *
                                      • + *
                                    • + *
                                    • Exists - boolean - Optional - Specify whether or not a value already exists for the attribute name-value pair.
                                    • + *
                                  • + *
                                • + *
                              • + *
                              • ReturnValues - string - Optional - Use this parameter if you want to get the attribute name-value pairs before or after they are modified. For PUT operations, the possible parameter values are NONE (default) or ALL_OLD. For update operations, the possible parameter values are NONE (default) or ALL_OLD, UPDATED_OLD, ALL_NEW or UPDATED_NEW.
                                • NONE: Nothing is returned.
                                • ALL_OLD: Returns the attributes of the item as they were before the operation.
                                • UPDATED_OLD: Returns the values of the updated attributes, only, as they were before the operation.
                                • ALL_NEW: Returns all the attributes and their new values after the operation.
                                • UPDATED_NEW: Returns the values of the updated attributes, only, as they are after the operation.
                                [Allowed values: NONE, ALL_OLD, UPDATED_OLD, ALL_NEW, UPDATED_NEW]
                              • + *
                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                              • + *
                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                              + * @return CFResponse A object containing a parsed HTTP response. + */ + public function put_item($opt = null) + { + if (!$opt) $opt = array(); + + $opt = json_encode($opt); + return $this->authenticate('PutItem', $opt); + } + + /** + * Gets the values of one or more items and its attributes by primary key (composite primary key, + * only). + * + * Narrow the scope of the query using comparison operators on the RangeKeyValue of + * the composite key. Use the ScanIndexForward parameter to get results in forward or + * reverse order by range key. + * + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                + *
                              • TableName - string - Required - The name of the table in which you want to query. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: [a-zA-Z0-9_.-]+]
                              • + *
                              • AttributesToGet - string|array - Optional - List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result. Pass a string for a single value, or an indexed array for multiple values.
                              • + *
                              • Limit - integer - Optional - The maximum number of items to return. If Amazon DynamoDB hits this limit while querying the table, it stops the query and returns the matching values up to the limit, and a LastEvaluatedKey to apply in a subsequent operation to continue the query. Also, if the result set size exceeds 1MB before Amazon DynamoDB hits this limit, it stops the query and returns the matching values, and a LastEvaluatedKey to apply in a subsequent operation to continue the query.
                              • + *
                              • ConsistentRead - boolean - Optional - If set to true, then a consistent read is issued. Otherwise eventually-consistent is used.
                              • + *
                              • Count - boolean - Optional - If set to true, Amazon DynamoDB returns a total number of items that match the query parameters, instead of a list of the matching items and their attributes. Do not set Count to true while providing a list of AttributesToGet, otherwise Amazon DynamoDB returns a validation error.
                              • + *
                              • HashKeyValue - array - Required - Attribute value of the hash component of the composite primary key.
                                  + *
                                • x - array - Optional - This represents a simple array index.
                                    + *
                                  • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                  • + *
                                  • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                  • + *
                                  • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                  • + *
                                  • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                  • + *
                                • + *
                              • + *
                              • RangeKeyCondition - array - Optional - A container for the attribute values and comparison operators to use for the query.
                                  + *
                                • x - array - Optional - This represents a simple array index.
                                    + *
                                  • AttributeValueList - array - Optional - A list of attribute values to be used with a comparison operator for a scan or query operation. For comparisons that require more than one value, such as a BETWEEN comparison, the AttributeValueList contains two attribute values and the comparison operator.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                      • + *
                                      • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                      • + *
                                      • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                      • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                    • + *
                                  • + *
                                  • ComparisonOperator - string - Required - A comparison operator is an enumeration of several operations:
                                    • EQ for equal
                                    • NE for not equal
                                    • IN checks for exact matches
                                    • LE for less than or equal to
                                    • LT for less than
                                    • GE for greater than or equal to
                                    • GT for greater than
                                    • BETWEEN for between
                                    • NOT_NULL for exists
                                    • NULL for not exists
                                    • CONTAINS for substring or value in a set
                                    • NOT_CONTAINS for absence of a substring or absence of a value in a set
                                    • BEGINS_WITH for a substring prefix.
                                    [Allowed values: EQ, NE, IN, LE, LT, GE, GT, BETWEEN, NOT_NULL, NULL, CONTAINS, NOT_CONTAINS, BEGINS_WITH]
                                  • + *
                                • + *
                              • + *
                              • ScanIndexForward - boolean - Optional - Specifies forward or backward traversal of the index. Amazon DynamoDB returns results reflecting the requested order, determined by the range key. The default value is true (forward).
                              • + *
                              • ExclusiveStartKey - array - Optional - Primary key of the item from which to continue an earlier query. An earlier query might provide this value as the LastEvaluatedKey if that query operation was interrupted before completing the query; either because of the result set size or the Limit parameter. The LastEvaluatedKey can be passed back in a new query request to continue the operation from that point.
                                  + *
                                • x - array - Optional - This represents a simple array index.
                                    + *
                                  • HashKeyElement - array - Required - A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                      • + *
                                      • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                      • + *
                                      • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                      • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                    • + *
                                  • + *
                                  • RangeKeyElement - array - Optional - A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                      • + *
                                      • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                      • + *
                                      • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                      • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                    • + *
                                  • + *
                                • + *
                              • + *
                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                              • + *
                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                              + * @return CFResponse A object containing a parsed HTTP response. + */ + public function query($opt = null) + { + if (!$opt) $opt = array(); + + // List (non-map) + if (isset($opt['AttributesToGet'])) + { + $opt['AttributesToGet'] = (is_array($opt['AttributesToGet']) ? $opt['AttributesToGet'] : array($opt['AttributesToGet'])); + } + + $opt = json_encode($opt); + return $this->authenticate('Query', $opt); + } + + /** + * Retrieves one or more items and its attributes by performing a full scan of a table. + * + * Limit the returned results by specifying a filter. + * + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                + *
                              • TableName - string - Required - The name of the table in which you want to scan. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: [a-zA-Z0-9_.-]+]
                              • + *
                              • AttributesToGet - string|array - Optional - List of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result. Pass a string for a single value, or an indexed array for multiple values.
                              • + *
                              • Limit - integer - Optional - The maximum number of items to return. If Amazon DynamoDB hits this limit while scanning the table, it stops the scan and returns the matching values up to the limit, and a LastEvaluatedKey to apply in a subsequent operation to continue the scan. Also, if the scanned data set size exceeds 1 MB before Amazon DynamoDB hits this limit, it stops the scan and returns the matching values up to the limit, and a LastEvaluatedKey to apply in a subsequent operation to continue the scan.
                              • + *
                              • Count - boolean - Optional - If set to true, Amazon DynamoDB returns a total number of items for the Scan operation, even if the operation has no matching items for the assigned filter. Do not set Count to true while providing a list of AttributesToGet, otherwise Amazon DynamoDB returns a validation error.
                              • + *
                              • ScanFilter - array - Optional - Evaluates the scan results and returns only the desired values.
                                  + *
                                • [attribute_name] - array - Optional - The name of the attribute to use for the lookup.
                                    + *
                                  • AttributeValueList - array - Optional - A list of attribute values to be used with a comparison operator for a scan or query operation. For comparisons that require more than one value, such as a BETWEEN comparison, the AttributeValueList contains two attribute values and the comparison operator.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                      • + *
                                      • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                      • + *
                                      • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                      • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                    • + *
                                  • + *
                                  • ComparisonOperator - string - Required - A comparison operator is an enumeration of several operations:
                                    • EQ for equal
                                    • NE for not equal
                                    • IN checks for exact matches
                                    • LE for less than or equal to
                                    • LT for less than
                                    • GE for greater than or equal to
                                    • GT for greater than
                                    • BETWEEN for between
                                    • NOT_NULL for exists
                                    • NULL for not exists
                                    • CONTAINS for substring or value in a set
                                    • NOT_CONTAINS for absence of a substring or absence of a value in a set
                                    • BEGINS_WITH for a substring prefix.
                                    [Allowed values: EQ, NE, IN, LE, LT, GE, GT, BETWEEN, NOT_NULL, NULL, CONTAINS, NOT_CONTAINS, BEGINS_WITH]
                                  • + *
                                • + *
                              • + *
                              • ExclusiveStartKey - array - Optional - Primary key of the item from which to continue an earlier scan. An earlier scan might provide this value if that scan operation was interrupted before scanning the entire table; either because of the result set size or the Limit parameter. The LastEvaluatedKey can be passed back in a new scan request to continue the operation from that point.
                                  + *
                                • x - array - Optional - This represents a simple array index.
                                    + *
                                  • HashKeyElement - array - Required - A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                      • + *
                                      • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                      • + *
                                      • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                      • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                    • + *
                                  • + *
                                  • RangeKeyElement - array - Optional - A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                      • + *
                                      • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                      • + *
                                      • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                      • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                    • + *
                                  • + *
                                • + *
                              • + *
                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                              • + *
                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                              + * @return CFResponse A object containing a parsed HTTP response. + */ + public function scan($opt = null) + { + if (!$opt) $opt = array(); + + // List (non-map) + if (isset($opt['AttributesToGet'])) + { + $opt['AttributesToGet'] = (is_array($opt['AttributesToGet']) ? $opt['AttributesToGet'] : array($opt['AttributesToGet'])); + } + + $opt = json_encode($opt); + return $this->authenticate('Scan', $opt); + } + + /** + * Edits an existing item's attributes. + * + * You can perform a conditional update (insert a new attribute name-value pair if it doesn't + * exist, or replace an existing name-value pair if it has certain expected attribute values). + * + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                + *
                              • TableName - string - Required - The name of the table in which you want to update an item. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: [a-zA-Z0-9_.-]+]
                              • + *
                              • Key - array - Required - The primary key that uniquely identifies each item in a table. A primary key can be a one attribute (hash) primary key or a two attribute (hash-and-range) primary key.
                                  + *
                                • x - array - Optional - This represents a simple array index.
                                    + *
                                  • HashKeyElement - array - Required - A hash key element is treated as the primary key, and can be a string or a number. Single attribute primary keys have one index value. The value can be String, Number, StringSet, NumberSet.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                      • + *
                                      • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                      • + *
                                      • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                      • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                    • + *
                                  • + *
                                  • RangeKeyElement - array - Optional - A range key element is treated as a secondary key (used in conjunction with the primary key), and can be a string or a number, and is only used for hash-and-range primary keys. The value can be String, Number, StringSet, NumberSet.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                      • + *
                                      • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                      • + *
                                      • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                      • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                    • + *
                                  • + *
                                • + *
                              • + *
                              • AttributeUpdates - array - Required - Map of attribute name to the new value and action for the update. The attribute names specify the attributes to modify, and cannot contain any primary key attributes.
                                  + *
                                • [attribute_name] - array - Optional - The name of the attribute to use for the lookup.
                                    + *
                                  • Action - string - Optional - The type of action for an item update operation. Only use the add action for numbers or sets; the specified value is added to the existing value. If a set of values is specified, the values are added to the existing set. Adds the specified attribute. If the attribute exists, it is replaced by the new value. If no value is specified, this removes the attribute and its value. If a set of values is specified, then the values in the specified set are removed from the old set. [Allowed values: ADD, PUT, DELETE]
                                  • + *
                                  • Value - array - Optional - AttributeValue can be String, Number, StringSet, NumberSet.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                      • + *
                                      • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                      • + *
                                      • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                      • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                    • + *
                                  • + *
                                • + *
                              • + *
                              • Expected - array - Optional - Designates an attribute for a conditional modification. The Expected parameter allows you to provide an attribute name, and whether or not Amazon DynamoDB should check to see if the attribute has a particular value before modifying it.
                                  + *
                                • [attribute_name] - array - Optional - The name of the attribute to use for the lookup.
                                    + *
                                  • Value - array - Optional - Specify whether or not a value already exists and has a specific content for the attribute name-value pair.
                                      + *
                                    • x - array - Optional - This represents a simple array index.
                                        + *
                                      • S - string - Optional - Strings are Unicode with UTF-8 binary encoding. The maximum size is limited by the size of the primary key (1024 bytes as a range part of a key or 2048 bytes as a single part hash key) or the item size (64k).
                                      • + *
                                      • N - string - Optional - Numbers are positive or negative exact-value decimals and integers. A number can have up to 38 digits precision and can be between 10^-128 to 10^+126.
                                      • + *
                                      • SS - string|array - Optional - A set of strings. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                      • NS - string|array - Optional - A set of numbers. Pass a string for a single value, or an indexed array for multiple values.
                                      • + *
                                    • + *
                                  • + *
                                  • Exists - boolean - Optional - Specify whether or not a value already exists for the attribute name-value pair.
                                  • + *
                                • + *
                              • + *
                              • ReturnValues - string - Optional - Use this parameter if you want to get the attribute name-value pairs before or after they are modified. For PUT operations, the possible parameter values are NONE (default) or ALL_OLD. For update operations, the possible parameter values are NONE (default) or ALL_OLD, UPDATED_OLD, ALL_NEW or UPDATED_NEW.
                                • NONE: Nothing is returned.
                                • ALL_OLD: Returns the attributes of the item as they were before the operation.
                                • UPDATED_OLD: Returns the values of the updated attributes, only, as they were before the operation.
                                • ALL_NEW: Returns all the attributes and their new values after the operation.
                                • UPDATED_NEW: Returns the values of the updated attributes, only, as they are after the operation.
                                [Allowed values: NONE, ALL_OLD, UPDATED_OLD, ALL_NEW, UPDATED_NEW]
                              • + *
                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                              • + *
                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                              + * @return CFResponse A object containing a parsed HTTP response. + */ + public function update_item($opt = null) + { + if (!$opt) $opt = array(); + + $opt = json_encode($opt); + return $this->authenticate('UpdateItem', $opt); + } + + /** + * Updates the provisioned throughput for the given table. + * + * Setting the throughput for a table helps you manage performance and is part of the Provisioned + * Capacity feature of Amazon DynamoDB. + * + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                + *
                              • TableName - string - Required - The name of the table you want to update. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period). [Constraints: The value must be between 3 and 255 characters, and must match the following regular expression pattern: [a-zA-Z0-9_.-]+]
                              • + *
                              • ProvisionedThroughput - array - Required - Provisioned throughput reserves the required read and write resources for your table in terms of ReadCapacityUnits and WriteCapacityUnits. Values for provisioned throughput depend upon your expected read/write rates, item size, and consistency. Provide the expected number of read and write operations, assuming an item size of 1k and strictly consistent reads. For 2k item size, double the value. For 3k, triple the value, etc. Eventually-consistent reads consume half the resources of strictly consistent reads.
                                  + *
                                • x - array - Optional - This represents a simple array index.
                                    + *
                                  • ReadCapacityUnits - long - Required - ReadCapacityUnits are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the ReadCapacityUnits. Eventually-consistent reads only require half the ReadCapacityUnits of stirctly consistent reads.
                                  • + *
                                  • WriteCapacityUnits - long - Required - WriteCapacityUnits are in terms of strictly consistent reads, assuming items of 1k. 2k items require twice the WriteCapacityUnits.
                                  • + *
                                • + *
                              • + *
                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                              • + *
                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                              + * @return CFResponse A object containing a parsed HTTP response. + */ + public function update_table($opt = null) + { + if (!$opt) $opt = array(); + + $opt = json_encode($opt); + return $this->authenticate('UpdateTable', $opt); + } +} + + +/*%******************************************************************************************%*/ +// EXCEPTIONS + +class DynamoDB_Exception extends Exception {} diff --git a/services/ec2.class.php b/services/ec2.class.php index d8e415a..38c0de6 100644 --- a/services/ec2.class.php +++ b/services/ec2.class.php @@ -1,6 +1,6 @@ http://aws.amazon.com/ec2/ for more information. * - * @version 2011.12.13 + * @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/ec2/ Amazon EC2 @@ -4084,7 +4084,6 @@ public function revoke_security_group_ingress($opt = null) *
                          • *
                          • PrivateIpAddress - string - Optional - If you're using Amazon Virtual Private Cloud, you can optionally use this parameter to assign the instance a specific available IP address from the subnet.
                          • *
                          • ClientToken - string - Optional - Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, go to How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.
                          • - *
                          • AdditionalInfo - string - Optional -
                          • *
                          • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                          • *
                          • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                          * @return CFResponse A object containing a parsed HTTP response. diff --git a/services/elasticache.class.php b/services/elasticache.class.php index 47417ce..a68e146 100644 --- a/services/elasticache.class.php +++ b/services/elasticache.class.php @@ -1,6 +1,6 @@ PreferredAvailabilityZone - string - Optional - The EC2 Availability Zone that the Cache Cluster will be created in. In normal use, all CacheNodes belonging to a CacheCluster are placed in the preferred availability zone. In rare circumstances, some of the CacheNodes might temporarily be in a different availability zone. Default: System chosen (random) availability zone. *
                        • PreferredMaintenanceWindow - string - Optional - The weekly time range (in UTC) during which system maintenance can occur. Example: sun:05:00-sun:09:00
                        • *
                        • Port - integer - Optional - The port number on which each of the Cache Nodes will accept connections.
                        • - *
                        • NotificationTopicArn - string - Optional - The Amazon Resource Name (ARN) of the SNS topic to which notifications will be sent.

                          The SNS topic owner must be same as the Cache Cluster owner.

                        • + *
                        • NotificationTopicArn - string - Optional - The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic to which notifications will be sent.

                          The Amazon SNS topic owner must be the same as the Cache Cluster owner.

                        • *
                        • AutoMinorVersionUpgrade - boolean - Optional - Indicates that minor engine upgrades will be applied automatically to the Cache Cluster during the maintenance window. Default: true
                        • *
                        • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                        • *
                        • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                        @@ -267,8 +267,8 @@ public function delete_cache_cluster($cache_cluster_id, $opt = null) } /** - * This API deletes a particular CacheParameterGroup. The CacheParameterGroup cannot be deleted if - * it is associated with any cache clusters. + * Deletes the specified CacheParameterGroup. The CacheParameterGroup cannot be deleted if it is + * associated with any cache clusters. * * @param string $cache_parameter_group_name (Required) The name of the Cache Parameter Group to delete.

                        The specified cache security group must not be associated with any Cache clusters.

                        * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                          @@ -313,10 +313,10 @@ public function delete_cache_security_group($cache_security_group_name, $opt = n * used to retrieve detailed information about the Cache Nodes associated with the Cache Cluster. * Details include the DNS address and port for the Cache Node endpoint. * - * If the cluster is in CREATING state, only cluster level information will be displayed until all - * of the nodes are successfully provisioned. + * If the cluster is in the CREATING state, only cluster level information will be displayed until + * all of the nodes are successfully provisioned. * - * If the cluster is in DELETING state, only cluster level information will be displayed. + * If the cluster is in the DELETING state, only cluster level information will be displayed. * * While adding Cache Nodes, node endpoint information and creation time for the additional nodes * will not be displayed until they are completely provisioned. The cluster lifecycle tells the @@ -344,8 +344,8 @@ public function describe_cache_clusters($opt = null) } /** - * This API returns a list of CacheParameterGroup descriptions. If a CacheParameterGroupName is - * specified, the list will contain only the descriptions of the specified CacheParameterGroup. + * Returns a list of CacheParameterGroup descriptions. If a CacheParameterGroupName is specified, + * the list will contain only the descriptions of the specified CacheParameterGroup. * * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                            *
                          • CacheParameterGroupName - string - Optional - The name of a specific cache parameter group to return details for.
                          • @@ -402,8 +402,7 @@ public function describe_cache_security_groups($opt = null) } /** - * This API returns the default engine and system parameter information for the specified cache - * engine. + * Returns the default engine and system parameter information for the specified cache engine. * * @param string $cache_parameter_group_family (Required) The name of the Cache Parameter Group Family.

                            Currently, memcached1.4 is the only cache parameter group family supported by the service.

                            * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                              @@ -422,10 +421,10 @@ public function describe_engine_default_parameters($cache_parameter_group_family } /** - * This API returns events related to Cache Clusters, Cache Security Groups, and Cache Parameter - * Groups for the past 14 days. Events specific to a particular Cache Cluster, cache security - * group, or cache parameter group can be obtained by providing the name as a parameter. By - * default, the past hour of events are returned. + * Returns events related to Cache Clusters, Cache Security Groups, and Cache Parameter Groups for + * the past 14 days. Events specific to a particular Cache Cluster, Cache Security Group, or Cache + * Parameter Group can be obtained by providing the name as a parameter. By default, the past hour + * of events are returned. * * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                *
                              • SourceIdentifier - string - Optional - The identifier of the event source for which events will be returned. If not specified, then all sources are included in the response.
                              • @@ -459,7 +458,7 @@ public function describe_events($opt = null) } /** - * Modifies Cache Cluster settings. You can change one or more Cache Cluster configuration + * Modifies the Cache Cluster settings. You can change one or more Cache Cluster configuration * parameters by specifying the parameters and the new values in the request. * * @param string $cache_cluster_id (Required) The Cache Cluster identifier. This value is stored as a lowercase string. @@ -468,10 +467,10 @@ public function describe_events($opt = null) *
                              • CacheNodeIdsToRemove - string|array - Optional - The list of Cache Node IDs to be removed. This parameter is only valid when NumCacheNodes is less than the existing number of Cache Nodes. The number of Cache Node Ids supplied in this parameter must match the difference between the existing number of Cache Nodes in the cluster and the new NumCacheNodes requested. Pass a string for a single value, or an indexed array for multiple values.
                              • *
                              • CacheSecurityGroupNames - string|array - Optional - A list of Cache Security Group Names to authorize on this Cache Cluster. This change is asynchronously applied as soon as possible. Constraints: Must contain no more than 255 alphanumeric characters. Must not be "Default". Pass a string for a single value, or an indexed array for multiple values.
                              • *
                              • PreferredMaintenanceWindow - string - Optional - The weekly time range (in UTC) during which system maintenance can occur, which may result in an outage. This change is made immediately. If moving this window to the current time, there must be at least 120 minutes between the current time and end of the window to ensure pending changes are applied.
                              • - *
                              • NotificationTopicArn - string - Optional - The Amazon resource name(ARN) of the SNS topic to which notifications will be sent.

                                The SNS topic owner must be same as the Cache Cluster owner.

                              • + *
                              • NotificationTopicArn - string - Optional - The Amazon Resource Name (ARN) of the SNS topic to which notifications will be sent.

                                The SNS topic owner must be same as the Cache Cluster owner.

                              • *
                              • CacheParameterGroupName - string - Optional - The name of the Cache Parameter Group to apply to this Cache Cluster. This change is asynchronously applied as soon as possible for parameters when the ApplyImmediately parameter is specified as true for this request.
                              • - *
                              • NotificationTopicStatus - string - Optional - The status of the SNS notification topic. The value can be active or inactive. Notifications are sent only if the status is active.
                              • - *
                              • ApplyImmediately - boolean - Optional - Specifies whether or not the modifications in this request and any pending modifications are asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow setting for the Cache Cluster. If this parameter is passed as false, changes to the Cache Cluster are applied on the next maintenance reboot, or the next failure reboot, whichever occurs first. The default value for this parameter is false.
                              • + *
                              • NotificationTopicStatus - string - Optional - The status of the Amazon SNS notification topic. The value can be active or inactive. Notifications are sent only if the status is active.
                              • + *
                              • ApplyImmediately - boolean - Optional - Specifies whether or not the modifications in this request and any pending modifications are asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow setting for the Cache Cluster. If this parameter is passed as false, changes to the Cache Cluster are applied on the next maintenance reboot, or the next failure reboot, whichever occurs first. Default: false
                              • *
                              • EngineVersion - string - Optional - The version of the cache engine to upgrade this cluster to.
                              • *
                              • AutoMinorVersionUpgrade - boolean - Optional - Indicates that minor engine upgrades will be applied automatically to the Cache Cluster during the maintenance window. Default: true
                              • *
                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                              • @@ -505,9 +504,9 @@ public function modify_cache_cluster($cache_cluster_id, $opt = null) } /** - * This API modifies the parameters of a CacheParameterGroup. To modify more than one parameter - * submit a list of the following: ParameterName and ParameterValue. A maximum of 20 parameters - * can be modified in a single request. + * Modifies the parameters of a CacheParameterGroup. To modify more than one parameter, submit a + * list of ParameterName and ParameterValue parameters. A maximum of 20 parameters can be modified + * in a single request. * * @param string $cache_parameter_group_name (Required) The name of the cache parameter group to modify. * @param array $parameter_name_values (Required) An array of parameter names and values for the parameter update. At least one parameter name and value must be supplied; subsequent arguments are optional. A maximum of 20 parameters may be modified in a single request.
                                  @@ -535,16 +534,15 @@ public function modify_cache_parameter_group($cache_parameter_group_name, $param } /** - * The RebootCacheCluster API reboots some (or all) of the cache cluster nodes within a previously - * provisioned ElastiCache cluster. This API results in the application of modified - * CacheParameterGroup parameters to the cache cluster. This action is taken as soon as possible, - * and results in a momentary outage to the cache cluster during which the cache cluster status is - * set to rebooting. During that momentary outage the contents of the cache (for each cache - * cluster node being rebooted) are lost. A CacheCluster event is created when the reboot is - * completed. + * Reboots some (or all) of the cache cluster nodes within a previously provisioned ElastiCache + * cluster. This API results in the application of modified CacheParameterGroup parameters to the + * cache cluster. This action is taken as soon as possible, and results in a momentary outage to + * the cache cluster during which the cache cluster status is set to rebooting. During that + * momentary outage, the contents of the cache (for each cache cluster node being rebooted) are + * lost. A CacheCluster event is created when the reboot is completed. * * @param string $cache_cluster_id (Required) The Cache Cluster identifier. This parameter is stored as a lowercase string. - * @param string|array $cache_node_ids_to_reboot (Required) A list of Cache Cluster Node ids to reboot. To reboot an entire cache cluster, specify all cache cluster node ids. Pass a string for a single value, or an indexed array for multiple values. + * @param string|array $cache_node_ids_to_reboot (Required) A list of Cache Cluster Node Ids to reboot. To reboot an entire cache cluster, specify all cache cluster node Ids. 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:
                                    *
                                  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                  • *
                                  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                  @@ -564,9 +562,9 @@ public function reboot_cache_cluster($cache_cluster_id, $cache_node_ids_to_reboo } /** - * This API modifies the parameters of a CacheParameterGroup to the engine/system default value. - * To reset specific parameters submit a list of the parameter names. To reset the entire - * CacheParameterGroup specify the CacheParameterGroup name and ResetAllParameters parameters. + * Modifies the parameters of a CacheParameterGroup to the engine or system default value. To + * reset specific parameters submit a list of the parameter names. To reset the entire + * CacheParameterGroup, specify the CacheParameterGroup name and ResetAllParameters parameters. * * @param string $cache_parameter_group_name (Required) The name of the Cache Parameter Group. * @param array $parameter_name_values (Required) An array of parameter names which should be reset. If not resetting the entire CacheParameterGroup, at least one parameter name must be supplied.
                                    diff --git a/services/elasticbeanstalk.class.php b/services/elasticbeanstalk.class.php index c399bb4..fb9739b 100644 --- a/services/elasticbeanstalk.class.php +++ b/services/elasticbeanstalk.class.php @@ -1,6 +1,6 @@ https://elasticbeanstalk.us-east-1.amazonaws.com *
                                  * - * @version 2011.12.13 + * @version 2012.01.16 * @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/elasticbeanstalk/ AWS ElasticBeanstalk diff --git a/services/elb.class.php b/services/elb.class.php index 3d475ee..548e220 100644 --- a/services/elb.class.php +++ b/services/elb.class.php @@ -1,6 +1,6 @@ *
                                • LoadBalancerNames - string|array - Optional - A list of names associated with the LoadBalancers at creation time. Pass a string for a single value, or an indexed array for multiple values.
                                • - *
                                • Marker - string - Optional - An optional parameter reserved for future use.
                                • + *
                                • Marker - string - Optional -
                                • *
                                • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                • *
                                • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                * @return CFResponse A object containing a parsed HTTP response. @@ -809,7 +809,7 @@ public function enable_availability_zones_for_load_balancer($load_balancer_name, *

                                * * @param string $load_balancer_name (Required) The name associated with the LoadBalancer. The name must be unique within the client AWS account. - * @param array $instances (Required) A list of instance IDs that should be registered with the LoadBalancer.

                                If you stop and then restart the instance, the instance ID changes. Elastic Load Balancing cannot recognize the new ID, which prevents it from routing traffic to your instance. We recommend you de-register and then register your the new instance ID with the load balancer after you restart your instance. To de-register your instances from load balancer, use DeregisterInstancesFromLoadBalancer action.

                                  + * @param array $instances (Required) A list of instances IDs that should be registered with the LoadBalancer.
                                    *
                                  • x - array - Optional - This represents a simple array index.
                                      *
                                    • InstanceId - string - Optional - Provides an EC2 instance ID.
                                    • *
                                  • diff --git a/services/emr.class.php b/services/emr.class.php index 216469b..e3cfd63 100644 --- a/services/emr.class.php +++ b/services/emr.class.php @@ -1,6 +1,6 @@ *
                                  • LogUri - string - Optional - Specifies the location in Amazon S3 to write the log files of the job flow. If a value is not provided, logs are not created. [Constraints: The value must be between 0 and 10280 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                                  • *
                                  • AdditionalInfo - string - Optional - A JSON string for selecting additional features. [Constraints: The value must be between 0 and 10280 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                                  • - *
                                  • AmiVersion - string - Optional - The version of the Amazon Machine Image (AMI) to use when launching Amazon EC2 instances in the job flow. The following values ane valid:
                                    • "latest" (latest AMI version; currently AMI 2.0, Hadoop 0.20.205)
                                    • "2.0" (AMI 2.0, Hadoop 0.20.205)
                                    • "1.0" (AMI 1.0, Hadoop 0.18)
                                    If this value is not specified, the job flow uses the default of (AMI 1.0, Hadoop 0.18). If the AMI supports multiple verisons of Hadoop (for example, AMI 1.0 supports both Hadoop 0.18 and 0.20) you can use the JobFlowInstancesConfig HadoopVersion parameter to modify the version of Hadoop from the defaults shown above. For details about the AMI versions currently supported by Amazon ElasticMapReduce, go to AMI Versions Supported in Elastic MapReduce in the Amazon Elastic MapReduce Developer's Guide. [Constraints: The value must be between 0 and 256 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                                  • + *
                                  • AmiVersion - string - Optional - The version of the Amazon Machine Image (AMI) to use when launching Amazon EC2 instances in the job flow. The following values ane valid:
                                    • "latest" (latest AMI version; currently AMI 2.0, Hadoop 0.20.205)
                                    • "2.0" (AMI 2.0, Hadoop 0.20.205)
                                    • "1.0" (AMI 1.0, Hadoop 0.18)
                                    If this value is not specified, the job flow uses the default of (AMI 1.0, Hadoop 0.18). If the AMI supports multiple versions of Hadoop (for example, AMI 1.0 supports both Hadoop 0.18 and 0.20) you can use the JobFlowInstancesConfig HadoopVersion parameter to modify the version of Hadoop from the defaults shown above. For details about the AMI versions currently supported by Amazon ElasticMapReduce, go to AMI Versions Supported in Elastic MapReduce in the Amazon Elastic MapReduce Developer's Guide. [Constraints: The value must be between 0 and 256 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                                  • *
                                  • Steps - array - Optional - A list of steps to be executed by the job flow.
                                      *
                                    • x - array - Optional - This represents a simple array index.
                                        *
                                      • Name - string - Required - The name of the job flow step. [Constraints: The value must be between 0 and 256 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
                                      • diff --git a/services/importexport.class.php b/services/importexport.class.php index 68b4783..a3c0451 100644 --- a/services/importexport.class.php +++ b/services/importexport.class.php @@ -1,6 +1,6 @@ Amazon RDS API Reference. It contains a comprehensive description of all + * Amazon RDS Query APIs and data types. To get started with Amazon RDS, go to the Amazon RDS Getting + * Started Guide. For more information on Amazon RDS concepts and usage scenarios, go to the + * Amazon RDS User + * Guide. * - * @version 2011.12.13 + * @version 2012.01.16 * @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/rds/ Amazon Relational Database Service @@ -176,11 +183,11 @@ public function set_region($region) * For an overview of CIDR ranges, go to the Wikipedia Tutorial. * - * @param string $db_security_group_name (Required) The name of the DB Security Group to authorize. + * @param string $db_security_group_name (Required) The name of the DB Security Group to add authorization to. * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                          *
                                        • CIDRIP - string - Optional - The IP range to authorize.
                                        • *
                                        • EC2SecurityGroupName - string - Optional - Name of the EC2 Security Group to authorize.
                                        • - *
                                        • EC2SecurityGroupOwnerId - string - Optional - AWS Account Number of the owner of the security group specified in the EC2SecurityGroupName parameter. The AWS Access Key ID is not an acceptable value.
                                        • + *
                                        • EC2SecurityGroupOwnerId - string - Optional - AWS Account Number of the owner of the EC2 Security Group specified in the EC2SecurityGroupName parameter. The AWS Access Key ID is not an acceptable value.
                                        • *
                                        • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                        • *
                                        • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                        * @return CFResponse A object containing a parsed HTTP response. @@ -207,7 +214,7 @@ public function authorize_db_security_group_ingress($db_security_group_name, $op *
                                      • DBSecurityGroups - string|array - Optional - A list of DB Security Groups to associate with this DB Instance. Default: The default DB Security Group for the database engine. Pass a string for a single value, or an indexed array for multiple values.
                                      • *
                                      • AvailabilityZone - string - Optional - The EC2 Availability Zone that the database instance will be created in. Default: A random, system-chosen Availability Zone in the endpoint's region. Example: us-east-1d Constraint: The AvailabilityZone parameter cannot be specified if the MultiAZ parameter is set to true. The specified Availability Zone must be in the same region as the current endpoint.
                                      • *
                                      • PreferredMaintenanceWindow - string - Optional - The weekly time range (in UTC) during which system maintenance can occur. Format: ddd:hh24:mi-ddd:hh24:mi Default: A 30-minute window selected at random from an 8-hour block of time per region, occurring on a random day of the week. The following list shows the time blocks for each region from which the default maintenance windows are assigned.
                                        • US-East (Northern Virginia) Region: 03:00-11:00 UTC
                                        • US-West (Northern California) Region: 06:00-14:00 UTC
                                        • EU (Ireland) Region: 22:00-06:00 UTC
                                        • Asia Pacific (Singapore) Region: 14:00-22:00 UTC
                                        • Asia Pacific (Tokyo) Region: 17:00-03:00 UTC
                                        Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun Constraints: Minimum 30-minute window.
                                      • - *
                                      • DBParameterGroupName - string - Optional - The name of the database parameter group to associate with this DB instance. If this argument is omitted, the default DBParameterGroup for the specified engine will be used. Constraints:
                                        • Must be 1 to 255 alphanumeric characters
                                        • First character must be a letter
                                        • Cannot end with a hyphen or contain two consecutive hyphens
                                      • + *
                                      • DBParameterGroupName - string - Optional - The name of the DB Parameter Group to associate with this DB instance. If this argument is omitted, the default DBParameterGroup for the specified engine will be used. Constraints:
                                        • Must be 1 to 255 alphanumeric characters
                                        • First character must be a letter
                                        • Cannot end with a hyphen or contain two consecutive hyphens
                                      • *
                                      • BackupRetentionPeriod - integer - Optional - The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups. Default: 1 Constraints:
                                        • Must be a value from 0 to 8
                                        • Cannot be set to 0 if the DB Instance is a master instance with read replicas
                                      • *
                                      • PreferredBackupWindow - string - Optional - The daily time range during which automated backups are created if automated backups are enabled, using the BackupRetentionPeriod parameter. Default: A 30-minute window selected at random from an 8-hour block of time per region. The following list shows the time blocks for each region from which the default backup windows are assigned.
                                        • US-East (Northern Virginia) Region: 03:00-11:00 UTC
                                        • US-West (Northern California) Region: 06:00-14:00 UTC
                                        • EU (Ireland) Region: 22:00-06:00 UTC
                                        • Asia Pacific (Singapore) Region: 14:00-22:00 UTC
                                        • Asia Pacific (Tokyo) Region: 17:00-03:00 UTC
                                        Constraints: Must be in the format hh24:mi-hh24:mi. Times should be Universal Time Coordinated (UTC). Must not conflict with the preferred maintenance window. Must be at least 30 minutes.
                                      • *
                                      • Port - integer - Optional - The port number on which the database accepts connections. MySQL Default: 3306 Valid Values: 1150-65535 Type: Integer Oracle Default: 1521 Valid Values: 1150-65535
                                      • @@ -272,10 +279,18 @@ public function create_db_instance_read_replica($db_instance_identifier, $source } /** - * Creates a new database parameter group. + * Creates a new DB Parameter Group. + * + * A DB Parameter Group is initially created with the default parameters for the database engine + * used by the DB Instance. To provide custom values for any of the parameters, you must modify + * the group after creating it using ModifyDBParameterGroup. Once you've created a DB + * Parameter Group, you need to associate it with your DB Instance using + * ModifyDBInstance. When you associate a new DB Parameter Group with a running DB + * Instance, you need to reboot the DB Instance for the new DB Parameter Group and associated + * settings to take effect. * * @param string $db_parameter_group_name (Required) The name of the DB Parameter Group. Constraints:
                                        • Must be 1 to 255 alphanumeric characters
                                        • First character must be a letter
                                        • Cannot end with a hyphen or contain two consecutive hyphens

                                        This value is stored as a lower-case string.

                                        - * @param string $db_parameter_group_family (Required) The DB parameter group family name. A DB parameter group can be associated with one and only one DB parameter group family, and can be applied only to a DB instance running a database engine compatible with that DB parameter group family and version. + * @param string $db_parameter_group_family (Required) The DB Parameter Group Family name. A DB Parameter Group can be associated with one and only one DB Parameter Group Family, and can be applied only to a DB Instance running a database engine and engine version compatible with that DB Parameter Group Family. * @param string $description (Required) The description for the DB Parameter Group. * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                          *
                                        • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                        • @@ -293,8 +308,7 @@ public function create_db_parameter_group($db_parameter_group_name, $db_paramete } /** - * Creates a new database security group. Database Security groups control access to a database - * instance. + * Creates a new DB Security Group. DB Security Groups control access to a DB Instance. * * @param string $db_security_group_name (Required) The name for the DB Security Group. This value is stored as a lowercase string. Constraints: Must contain no more than 255 alphanumeric characters or hyphens. Must not be "Default". Example: mysecuritygroup * @param string $db_security_group_description (Required) The description for the DB Security Group. @@ -355,14 +369,13 @@ public function delete_db_instance($db_instance_identifier, $opt = null) } /** - * Deletes a specified DBParameterGroup. The DBParameterGroup cannot be associated with any RDS - * instances to be deleted. + * Deletes a specified DBParameterGroup. * *

                                          - * The specified database parameter group cannot be associated with any DB Instances. + * The specified DB Parameter Group cannot be associated with any DB Instances. *

                                          * - * @param string $db_parameter_group_name (Required) The name of the DB Parameter Group. Constraints:
                                          • Must be the name of an existing DB Parameter Group
                                          • You cannot delete a default DB Parameter Group
                                          + * @param string $db_parameter_group_name (Required) The name of the DB Parameter Group. Constraints:
                                          • Must be the name of an existing DB Parameter Group
                                          • You cannot delete a default DB Parameter Group
                                          • Cannot be associated with any DB Instances
                                          * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                            *
                                          • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                          • *
                                          • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                          @@ -377,13 +390,13 @@ public function delete_db_parameter_group($db_parameter_group_name, $opt = null) } /** - * Deletes a database security group. + * Deletes a DB Security Group. * *

                                          - * The specified database security group must not be associated with any DB instances. + * The specified DB Security Group must not be associated with any DB Instances. *

                                          * - * @param string $db_security_group_name (Required) The name of the database security group to delete.

                                          You cannot delete the default security group.

                                          Constraints:
                                          • Must be 1 to 255 alphanumeric characters
                                          • First character must be a letter
                                          • Cannot end with a hyphen or contain two consecutive hyphens
                                          + * @param string $db_security_group_name (Required) The name of the DB Security Group to delete.

                                          You cannot delete the default DB Security Group.

                                          Constraints:
                                          • Must be 1 to 255 alphanumeric characters
                                          • First character must be a letter
                                          • Cannot end with a hyphen or contain two consecutive hyphens
                                          * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                            *
                                          • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                          • *
                                          • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                          @@ -398,13 +411,13 @@ public function delete_db_security_group($db_security_group_name, $opt = null) } /** - * Deletes a DBSnapshot. + * Deletes a DB Snapshot. * *

                                          * The DBSnapshot must be in the available state to be deleted. *

                                          * - * @param string $db_snapshot_identifier (Required) The DBSnapshot identifier. Constraints: Must be the name of an existing DB Snapshot in the available state. + * @param string $db_snapshot_identifier (Required) The name of the DB Snapshot to delete. Constraints: Must be the name of an existing DB Snapshot in the available state. * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                            *
                                          • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                          • *
                                          • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                          @@ -424,7 +437,7 @@ public function delete_db_snapshot($db_snapshot_identifier, $opt = null) * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                            *
                                          • Engine - string - Optional - The database engine to return.
                                          • *
                                          • EngineVersion - string - Optional - The database engine version to return. Example: 5.1.49
                                          • - *
                                          • DBParameterGroupFamily - string - Optional - The name of a specific database parameter group family to return details for. Constraints:
                                            • Must be 1 to 255 alphanumeric characters
                                            • First character must be a letter
                                            • Cannot end with a hyphen or contain two consecutive hyphens
                                          • + *
                                          • DBParameterGroupFamily - string - Optional - The name of a specific DB Parameter Group family to return details for. Constraints:
                                            • Must be 1 to 255 alphanumeric characters
                                            • First character must be a letter
                                            • Cannot end with a hyphen or contain two consecutive hyphens
                                          • *
                                          • MaxRecords - integer - Optional - The maximum number of records to include in the response. If more than the MaxRecords value is available, a marker is included in the response so that the following results can be retrieved. Default: 100 Constraints: minimum 20, maximum 100
                                          • *
                                          • Marker - string - Optional - The marker provided in the previous request. If this parameter is specified, the response includes records beyond the marker only, up to MaxRecords.
                                          • *
                                          • DefaultOnly - boolean - Optional - Indicates that only the default version of the specified engine or engine and major version combination is returned.
                                          • @@ -459,12 +472,12 @@ public function describe_db_instances($opt = null) /** * Returns a list of DBParameterGroup descriptions. If a DBParameterGroupName is specified, the - * list will contain only the descriptions of the specified DBParameterGroup. + * list will contain only the description of the specified DBParameterGroup. * * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                              - *
                                            • DBParameterGroupName - string - Optional - The name of a specific database parameter group to return details for. Constraints:
                                              • Must be 1 to 255 alphanumeric characters
                                              • First character must be a letter
                                              • Cannot end with a hyphen or contain two consecutive hyphens
                                            • + *
                                            • DBParameterGroupName - string - Optional - The name of a specific DB Parameter Group to return details for. Constraints:
                                              • Must be 1 to 255 alphanumeric characters
                                              • First character must be a letter
                                              • Cannot end with a hyphen or contain two consecutive hyphens
                                            • *
                                            • MaxRecords - integer - Optional - The maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a marker is included in the response so that the remaining results may be retrieved. Default: 100 Constraints: minimum 20, maximum 100
                                            • - *
                                            • Marker - string - Optional - An optional marker provided in the previous DescribeDBInstances request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.
                                            • + *
                                            • Marker - string - Optional - An optional marker provided in the previous DescribeDBParameterGroups request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.
                                            • *
                                            • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                            • *
                                            • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                            * @return CFResponse A object containing a parsed HTTP response. @@ -479,7 +492,7 @@ public function describe_db_parameter_groups($opt = null) /** * Returns the detailed parameter list for a particular DBParameterGroup. * - * @param string $db_parameter_group_name (Required) The name of a specific database parameter group to return details for. Constraints:
                                            • Must be 1 to 255 alphanumeric characters
                                            • First character must be a letter
                                            • Cannot end with a hyphen or contain two consecutive hyphens
                                            + * @param string $db_parameter_group_name (Required) The name of a specific DB Parameter Group to return details for. Constraints:
                                            • Must be 1 to 255 alphanumeric characters
                                            • First character must be a letter
                                            • Cannot end with a hyphen or contain two consecutive hyphens
                                            * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                              *
                                            • Source - string - Optional - The parameter types to return. Default: All parameter types returned Valid Values: user | system | engine-default
                                            • *
                                            • MaxRecords - integer - Optional - The maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a marker is included in the response so that the remaining results may be retrieved. Default: 100 Constraints: minimum 20, maximum 100
                                            • @@ -522,10 +535,10 @@ public function describe_db_security_groups($opt = null) * Returns information about DBSnapshots. This API supports pagination. * * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                - *
                                              • DBInstanceIdentifier - string - Optional - The unique identifier for the Amazon RDS DB snapshot. This value is stored as a lowercase string. Constraints:
                                                • Must contain from 1 to 63 alphanumeric characters or hyphens
                                                • First character must be a letter
                                                • Cannot end with a hyphen or contain two consecutive hyphens
                                              • - *
                                              • DBSnapshotIdentifier - string - Optional - The DB Instance identifier. This parameter isn't case sensitive. Constraints:
                                                • Must be 1 to 255 alphanumeric characters
                                                • First character must be a letter
                                                • Cannot end with a hyphen or contain two consecutive hyphens
                                              • + *
                                              • DBInstanceIdentifier - string - Optional - A DB Instance Identifier to retrieve the list of DB Snapshots for. Cannot be used in conjunction with DBSnapshotIdentifier. Constraints:
                                                • Must contain from 1 to 63 alphanumeric characters or hyphens
                                                • First character must be a letter
                                                • Cannot end with a hyphen or contain two consecutive hyphens
                                              • + *
                                              • DBSnapshotIdentifier - string - Optional - A specific DB Snapshot Identifier to describe. Cannot be used in conjunction with DBInstanceIdentifier. Constraints:
                                                • Must be 1 to 255 alphanumeric characters
                                                • First character must be a letter
                                                • Cannot end with a hyphen or contain two consecutive hyphens
                                              • *
                                              • MaxRecords - integer - Optional - The maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a marker is included in the response so that the remaining results may be retrieved. Default: 100 Constraints: minimum 20, maximum 100
                                              • - *
                                              • Marker - string - Optional - An optional marker provided in the previous DescribeDBInstances request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.
                                              • + *
                                              • Marker - string - Optional - An optional marker provided in the previous DescribeDBSnapshots request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.
                                              • *
                                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                              • *
                                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                              * @return CFResponse A object containing a parsed HTTP response. @@ -538,12 +551,13 @@ public function describe_db_snapshots($opt = null) } /** - * Returns the default engine and system parameter information for the specified database engine. + * Returns the default engine and system parameter information for the specified DB Parameter + * Group Family. * * @param string $db_parameter_group_family (Required) The name of the DB Parameter Group Family. * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                *
                                              • MaxRecords - integer - Optional - The maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a marker is included in the response so that the remaining results may be retrieved. Default: 100 Constraints: minimum 20, maximum 100
                                              • - *
                                              • Marker - string - Optional - An optional marker provided in the previous DescribeDBInstances request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.
                                              • + *
                                              • Marker - string - Optional - An optional marker provided in the previous DescribeEngineDefaultParameters request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.
                                              • *
                                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                              • *
                                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                              * @return CFResponse A object containing a parsed HTTP response. @@ -558,9 +572,9 @@ public function describe_engine_default_parameters($db_parameter_group_family, $ /** * Returns events related to DB Instances, DB Security Groups, DB Snapshots and DB Parameter - * Groups for the past 14 days. Events specific to a particular DB Instance, database security - * group, database snapshot or database parameter group can be obtained by providing the name as a - * parameter. By default, the past hour of events are returned. + * Groups for the past 14 days. Events specific to a particular DB Instance, DB Security Group, DB + * Snapshot, or DB Parameter Group can be obtained by providing the name as a parameter. By + * default, the past hour of events are returned. * * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                *
                                              • SourceIdentifier - string - Optional - The identifier of the event source for which events will be returned. If not specified, then all sources are included in the response. Constraints:
                                                • If SourceIdentifier is supplied, SourceType must also be provided.
                                                • If the source type is DBInstance, then a DBInstanceIdentifier must be supplied.
                                                • If the source type is DBSecurityGroup, a DBSecurityGroupName must be supplied.
                                                • If the source type is DBParameterGroup, a DBParameterGroupName must be supplied.
                                                • If the source type is DBSnapshot, a DBSnapshotIdentifier must be supplied.
                                                • Cannot end with a hyphen or contain two consecutive hyphens.
                                              • @@ -569,7 +583,7 @@ public function describe_engine_default_parameters($db_parameter_group_family, $ *
                                              • EndTime - string - Optional - The end of the time interval for which to retrieve events, specified in ISO 8601 format. For more information about ISO 8601, go to the ISO8601 Wikipedia page. Example: 2009-07-08T18:00Z May be passed as a number of seconds since UNIX Epoch, or any string compatible with .
                                              • *
                                              • Duration - integer - Optional - The number of minutes to retrieve events for. Default: 60
                                              • *
                                              • MaxRecords - integer - Optional - The maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a marker is included in the response so that the remaining results may be retrieved. Default: 100 Constraints: minimum 20, maximum 100
                                              • - *
                                              • Marker - string - Optional - An optional marker provided in the previous DescribeDBInstances request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.
                                              • + *
                                              • Marker - string - Optional - An optional marker provided in the previous DescribeEvents request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.
                                              • *
                                              • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                              • *
                                              • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                              * @return CFResponse A object containing a parsed HTTP response. @@ -667,7 +681,7 @@ public function describe_reserved_db_instances_offerings($opt = null) * * @param string $db_instance_identifier (Required) The DB Instance identifier. This value is stored as a lowercase string. Constraints:
                                              • Must be the identifier for an existing DB Instance
                                              • Must contain from 1 to 63 alphanumeric characters or hyphens
                                              • First character must be a letter
                                              • Cannot end with a hyphen or contain two consecutive hyphens
                                              Example:mydbinstance * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                - *
                                              • AllocatedStorage - integer - Optional - The new storage capacity of the RDS instance. This change does not result in an outage and is applied during the next maintenance window unless the ApplyImmediately parameter is specified as true for this request. MySQL Default: Uses existing setting Valid Values: 5-1024 Constraints: Value supplied must be at least 10% greater than the current value. Values that are not at least 10% greater than the existing value are rounded up so that they are 10% greater than the current value. Type: Integer MySQL Default: Uses existing setting Valid Values: 10-1024 Constraints: Value supplied must be at least 10% greater than the current value. Values that are not at least 10% greater than the existing value are rounded up so that they are 10% greater than the current value.
                                              • + *
                                              • AllocatedStorage - integer - Optional - The new storage capacity of the RDS instance. This change does not result in an outage and is applied during the next maintenance window unless the ApplyImmediately parameter is specified as true for this request. MySQL Default: Uses existing setting Valid Values: 5-1024 Constraints: Value supplied must be at least 10% greater than the current value. Values that are not at least 10% greater than the existing value are rounded up so that they are 10% greater than the current value. Type: Integer Oracle Default: Uses existing setting Valid Values: 10-1024 Constraints: Value supplied must be at least 10% greater than the current value. Values that are not at least 10% greater than the existing value are rounded up so that they are 10% greater than the current value.
                                              • *
                                              • DBInstanceClass - string - Optional - The new compute and memory capacity of the DB Instance. Passing a value for this parameter causes an outage during the change and is applied during the next maintenance window, unless the ApplyImmediately parameter is specified as true for this request. Default: Uses existing setting Valid Values: db.m1.small | db.m1.large | db.m1.xlarge | db.m2.xlarge | db.m2.2xlarge | db.m2.4xlarge
                                              • *
                                              • DBSecurityGroups - string|array - Optional - A list of DB Security Groups to authorize on this DB Instance. This change is asynchronously applied as soon as possible. Constraints:
                                                • Must be 1 to 255 alphanumeric characters
                                                • First character must be a letter
                                                • Cannot end with a hyphen or contain two consecutive hyphens
                                                Pass a string for a single value, or an indexed array for multiple values.
                                              • *
                                              • ApplyImmediately - boolean - Optional - Specifies whether or not the modifications in this request and any pending modifications are asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow setting for the DB Instance. If this parameter is passed as false, changes to the DB Instance are applied on the next call to RebootDBInstance, the next maintenance reboot, or the next failure reboot, whichever occurs first. Default: false
                                              • @@ -705,8 +719,12 @@ public function modify_db_instance($db_instance_identifier, $opt = null) * Modifies the parameters of a DBParameterGroup. To modify more than one parameter submit a list * of the following: ParameterName, ParameterValue, and ApplyMethod. A maximum of 20 parameters * can be modified in a single request. + * + *

                                                + * The apply-immediate method can only be used for dynamic parameters; the + * pending-reboot method can be used for either dynamic or static parameters. * - * @param string $db_parameter_group_name (Required) The name of the database parameter group. Constraints:
                                                • Must be the name of an existing database parameter group
                                                • Must be 1 to 255 alphanumeric characters
                                                • First character must be a letter
                                                • Cannot end with a hyphen or contain two consecutive hyphens
                                                + * @param string $db_parameter_group_name (Required) The name of the DB Parameter Group. Constraints:
                                                • Must be the name of an existing DB Parameter Group
                                                • Must be 1 to 255 alphanumeric characters
                                                • First character must be a letter
                                                • Cannot end with a hyphen or contain two consecutive hyphens
                                                * @param array $parameters (Required) An array of parameter names, values, and the apply method for the parameter update. At least one parameter name, value, and apply method must be supplied; subsequent arguments are optional. A maximum of 20 parameters may be modified in a single request. Valid Values (for the application method): immediate | pending-reboot

                                                You can use the immediate value with dynamic parameters only. You can use the pending-reboot value for both dynamic and static parameters, and changes are applied when DB Instance reboots.

                                                  *
                                                • x - array - Optional - This represents a simple array index.
                                                    *
                                                  • ParameterName - string - Optional - Specifies the name of the parameter.
                                                  • @@ -780,7 +798,7 @@ public function reboot_db_instance($db_instance_identifier, $opt = null) } /** - * Modifies the parameters of a DBParameterGroup to the engine/system default value. To reset + * Resets the parameters of a DBParameterGroup to the engine/system default value. To reset * specific parameters submit a list of the following: ParameterName and ApplyMethod. To reset the * entire DBParameterGroup specify the DBParameterGroup name and ResetAllParameters parameters. * When resetting the entire group, dynamic parameters are updated immediately and static @@ -826,16 +844,15 @@ public function reset_db_parameter_group($db_parameter_group_name, $opt = null) } /** - * Restores a DB Instance to an arbitrary point-in-time. Users can restore to any point in time - * before the latestRestorableTime for up to backupRetentionPeriod days. The target database is - * created from the source database with the same configuration as the original database except - * that the DB instance is created with the default DB security group. + * Creates a new DB Instance from a DB snapshot. The new DB Instance will have the same + * configuration as the original source database, except that the new DB instance is created with + * the default security group. * * @param string $db_instance_identifier (Required) The identifier for the DB Snapshot to restore from. Constraints:
                                                    • Must contain from 1 to 63 alphanumeric characters or hyphens
                                                    • First character must be a letter
                                                    • Cannot end with a hyphen or contain two consecutive hyphens
                                                    * @param string $db_snapshot_identifier (Required) Name of the DB Instance to create from the DB Snapshot. This parameter isn't case sensitive. Constraints:
                                                    • Must contain from 1 to 255 alphanumeric characters or hyphens
                                                    • First character must be a letter
                                                    • Cannot end with a hyphen or contain two consecutive hyphens
                                                    Example: my-snapshot-id * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                      *
                                                    • DBInstanceClass - string - Optional - The compute and memory capacity of the Amazon RDS DB instance. Valid Values: db.m1.small | db.m1.large | db.m1.xlarge | db.m2.2xlarge | db.m2.4xlarge
                                                    • - *
                                                    • Port - integer - Optional - The port number on which the database accepts connections. Default: The same port as the original DB Instance Constraints: Value must be 1115-65535
                                                    • + *
                                                    • Port - integer - Optional - The port number on which the database accepts connections. Default: The same port as the original DB Instance Constraints: Value must be 1150-65535
                                                    • *
                                                    • AvailabilityZone - string - Optional - The EC2 Availability Zone that the database instance will be created in. Default: A random, system-chosen Availability Zone. Constraint: You cannot specify the AvailabilityZone parameter if the MultiAZ parameter is set to true. Example: us-east-1a
                                                    • *
                                                    • MultiAZ - boolean - Optional - Specifies if the DB Instance is a Multi-AZ deployment. Constraint: You cannot specify the AvailabilityZone parameter if the MultiAZ parameter is set to true.
                                                    • *
                                                    • AutoMinorVersionUpgrade - boolean - Optional - Indicates that minor version upgrades will be applied automatically to the DB Instance during the maintenance window.
                                                    • @@ -856,17 +873,18 @@ public function restore_db_instance_from_db_snapshot($db_instance_identifier, $d } /** - * Creates a new DB Instance from a point-in-time system snapshot. The target database is created - * from the source database restore point with the same configuration as the original source - * database, except that the new RDS instance is created with the default security group. + * Restores a DB Instance to an arbitrary point-in-time. Users can restore to any point in time + * before the latestRestorableTime for up to backupRetentionPeriod days. The target database is + * created from the source database with the same configuration as the source database except that + * the new DB instance is created with the default DB security group. * * @param string $source_db_instance_identifier (Required) The identifier of the source DB Instance from which to restore. Constraints:
                                                      • Must be the identifier of an existing database instance
                                                      • Must contain from 1 to 63 alphanumeric characters or hyphens
                                                      • First character must be a letter
                                                      • Cannot end with a hyphen or contain two consecutive hyphens
                                                      * @param string $target_db_instance_identifier (Required) The name of the new database instance to be created. Constraints:
                                                      • Must contain from 1 to 63 alphanumeric characters or hyphens
                                                      • First character must be a letter
                                                      • Cannot end with a hyphen or contain two consecutive hyphens
                                                      * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                        - *
                                                      • RestoreTime - string - Optional - The date and time from to restore from. Valid Values: Value must be a UTC time Constraints:
                                                        • Must be after the latest restorable time for the DB Instance
                                                        • Cannot be specified if UseLatestRestorableTime parameter is true
                                                        Example: 2009-09-07T23:45:00Z May be passed as a number of seconds since UNIX Epoch, or any string compatible with .
                                                      • + *
                                                      • RestoreTime - string - Optional - The date and time to restore from. Valid Values: Value must be a UTC time Constraints:
                                                        • Must be before the latest restorable time for the DB Instance
                                                        • Cannot be specified if UseLatestRestorableTime parameter is true
                                                        Example: 2009-09-07T23:45:00Z May be passed as a number of seconds since UNIX Epoch, or any string compatible with .
                                                      • *
                                                      • UseLatestRestorableTime - boolean - Optional - Specifies whether (true) or not (false) the DB Instance is restored from the latest backup time. Default: false Constraints: Cannot be specified if RestoreTime parameter is provided.
                                                      • *
                                                      • DBInstanceClass - string - Optional - The compute and memory capacity of the Amazon RDS DB instance. Valid Values: db.m1.small | db.m1.large | db.m1.xlarge | db.m2.2xlarge | db.m2.4xlarge Default: The same DBInstanceClass as the original DB Instance.
                                                      • - *
                                                      • Port - integer - Optional - The port number on which the database accepts connections. Constraints: Value must be 1115-65535 Default: The same port as the original DB Instance.
                                                      • + *
                                                      • Port - integer - Optional - The port number on which the database accepts connections. Constraints: Value must be 1150-65535 Default: The same port as the original DB Instance.
                                                      • *
                                                      • AvailabilityZone - string - Optional - The EC2 Availability Zone that the database instance will be created in. Default: A random, system-chosen Availability Zone. Constraint: You cannot specify the AvailabilityZone parameter if the MultiAZ parameter is set to true. Example: us-east-1a
                                                      • *
                                                      • MultiAZ - boolean - Optional - Specifies if the DB Instance is a Multi-AZ deployment. Constraint: You cannot specify the AvailabilityZone parameter if the MultiAZ parameter is set to true.
                                                      • *
                                                      • AutoMinorVersionUpgrade - boolean - Optional - Indicates that minor version upgrades will be applied automatically to the DB Instance during the maintenance window.
                                                      • @@ -901,7 +919,7 @@ public function restore_db_instance_to_point_in_time($source_db_instance_identif * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                          *
                                                        • CIDRIP - string - Optional - The IP range to revoke access from. Must be a valid CIDR range. If CIDRIP is specified, EC2SecurityGroupName and EC2SecurityGroupOwnerId cannot be provided.
                                                        • *
                                                        • EC2SecurityGroupName - string - Optional - The name of the EC2 Security Group to revoke access from. If EC2SecurityGroupName is specified, EC2SecurityGroupOwnerId must also be provided and CIDRIP cannot be provided.
                                                        • - *
                                                        • EC2SecurityGroupOwnerId - string - Optional - The AWS Account Number of the owner of the security group specified in the EC2SecurityGroupName parameter. The AWS Access Key ID is not an acceptable value. If EC2SecurityGroupOwnerId is specified EC2SecurityGroupName must also be provided and CIDRIP cannot be provided.
                                                        • + *
                                                        • EC2SecurityGroupOwnerId - string - Optional - The AWS Account Number of the owner of the EC2 Security specified in the EC2SecurityGroupName parameter. The AWS Access Key ID is not an acceptable value. If EC2SecurityGroupOwnerId is specified EC2SecurityGroupName must also be provided and CIDRIP cannot be provided.
                                                        • *
                                                        • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                                        • *
                                                        • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                                        * @return CFResponse A object containing a parsed HTTP response. diff --git a/services/s3.class.php b/services/s3.class.php index d6bcb12..42b2a1c 100755 --- a/services/s3.class.php +++ b/services/s3.class.php @@ -1,6 +1,6 @@ for more information. * - * @version 2011.12.08 + * @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/s3/ Amazon Simple Storage Service @@ -68,7 +68,12 @@ class AmazonS3 extends CFRuntime /** * Specify the queue URL for the US-Standard (Northern Virginia & Washington State) Region. */ - const REGION_VIRGINIA = self::REGION_US_W1; + const REGION_VIRGINIA = self::REGION_US_E1; + + /** + * Specify the queue URL for the US-Standard (Northern Virginia & Washington State) Region. + */ + const REGION_US_STANDARD = self::REGION_US_E1; /** * Specify the queue URL for the US-West 1 (Northern California) Region. @@ -157,7 +162,12 @@ class AmazonS3 extends CFRuntime /** * Specify the queue URL for the US-Standard (Northern Virginia & Washington State) Website Region. */ - const REGION_VIRGINIA_WEBSITE = self::REGION_US_W1_WEBSITE; + const REGION_VIRGINIA_WEBSITE = self::REGION_US_E1_WEBSITE; + + /** + * Specify the queue URL for the US-Standard (Northern Virginia & Washington State) Website Region. + */ + const REGION_US_STANDARD_WEBSITE = self::REGION_US_E1_WEBSITE; /** * Specify the queue URL for the US-West 1 (Northern California) Website Region. @@ -399,11 +409,6 @@ class AmazonS3 extends CFRuntime */ public $temporary_prefix = false; - /** - * The state of whether the response should be parsed or not. - */ - public $parse_the_response = true; - /*%******************************************************************************************%*/ // CONSTRUCTOR @@ -425,7 +430,6 @@ public function __construct(array $options = array()) $this->vhost = null; $this->api_version = '2006-03-01'; $this->hostname = self::DEFAULT_URL; - $this->auth_class = 'AuthS3'; $this->base_acp_xml = ''; $this->base_location_constraint = ''; @@ -436,7 +440,7 @@ public function __construct(array $options = array()) $this->website_config_xml = 'index.htmlerror.html'; $this->multi_object_delete_xml = ''; - return parent::__construct($options); + parent::__construct($options); } @@ -447,14 +451,12 @@ public function __construct(array $options = array()) * Authenticates a connection to Amazon S3. Do not use directly unless implementing custom methods for * this class. * - * @param string $bucket (Required) The name of the bucket to use. - * @param array $opt (Optional) An associative array of parameters for authenticating. See the individual methods for allowed keys. - * @param string $location (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 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 name of the bucket to operate on (S3 Only). + * @param array $payload (Required) An associative array of parameters for authenticating. See inline comments for allowed keys. * @return CFResponse A object containing a parsed HTTP response. * @link http://docs.amazonwebservices.com/AmazonS3/latest/dev/S3_Authentication.html REST authentication */ - public function authenticate($bucket, $opt = null, $location = null, $redirects = 0, $nothing = null) + public function authenticate($operation, $payload) { /* * Overriding or extending this class? You can pass the following "magic" keys into $opt. @@ -486,9 +488,9 @@ public function authenticate($bucket, $opt = null, $location = null, $redirects * Tells authenticate() to return the cURL handle for the request instead of executing it. */ - /** - * @todo: Handle duplicate headers with different values. - */ + // Rename variables (to overcome inheritence issues) + $bucket = $operation; + $opt = $payload; // Validate the S3 bucket name if (!$this->validate_bucketname_support($bucket)) @@ -561,7 +563,7 @@ public function authenticate($bucket, $opt = null, $location = null, $redirects } // Get the UTC timestamp in RFC 2616 format - $date = gmdate(CFUtilities::DATE_FORMAT_RFC2616, (time() + (integer) $this->adjust_offset)); + $date = gmdate(CFUtilities::DATE_FORMAT_RFC2616, time()); // Storage for request parameters. $resource = ''; @@ -645,6 +647,11 @@ public function authenticate($bucket, $opt = null, $location = null, $redirects } $this->request_url = $scheme . $hostname . $signable_resource . $signable_query_string . $non_signable_resource; + if (isset($opt['location'])) + { + $this->request_url = $opt['location']; + } + // Gather information to pass along to other classes. $helpers = array( 'utilities' => $this->utilities_class, @@ -658,6 +665,7 @@ public function authenticate($bucket, $opt = null, $location = null, $redirects // 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) @@ -759,7 +767,6 @@ public function authenticate($bucket, $opt = null, $location = null, $redirects if (isset($opt['curlopts'])) { $curlopts = $opt['curlopts']; - unset($opt['curlopts']); } // Debug mode @@ -884,7 +891,7 @@ public function authenticate($bucket, $opt = null, $location = null, $redirects // Prepare the response $headers = $request->get_response_header(); $headers['x-aws-request-url'] = $this->request_url; - $headers['x-aws-redirects'] = $redirects; + $headers['x-aws-redirects'] = $this->redirects; $headers['x-aws-stringtosign'] = $string_to_sign; $headers['x-aws-requestheaders'] = $request->request_headers; @@ -901,23 +908,27 @@ public function authenticate($bucket, $opt = null, $location = null, $redirects // @codeCoverageIgnoreStart if ((integer) $request->get_response_code() === 307) // Temporary redirect to new endpoint. { - $data = $this->authenticate($bucket, $opt, $headers['location'], ++$redirects); + $this->redirects++; + $opt['location'] = $headers['location']; + $data = $this->authenticate($bucket, $opt); } // Was it Amazon's fault the request failed? Retry the request until we reach $max_retries. elseif ((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($bucket, $opt, null, ++$redirects); + $this->redirects++; + $data = $this->authenticate($bucket, $opt); } } // @codeCoverageIgnoreEnd // Return! + $this->redirects = 0; return $data; } @@ -972,34 +983,6 @@ public function validate_bucketname_support($bucket) return true; } - /** - * The callback function that is executed when the cache doesn't exist or has expired. The response of - * this method is cached. Accepts identical parameters as the method. Never call this - * method directly -- it is used internally by the caching system. - * - * @param string $bucket (Required) The name of the bucket to use. - * @param array $opt (Optional) An associative array of parameters for authenticating. See the individual methods for allowed keys. - * @param string $location (Optional) Used internally by this method when Amazon S3 returns a redirect code and needs to call itself recursively. - * @param integer $redirects (Optional) Used internally by this method when Amazon S3 returns a redirect code and needs to call itself recursively. - * @return CFResponse A object containing a parsed HTTP response. - */ - public function cache_callback($bucket, $opt = null, $location = null, $redirects = 0) - { - // Disable the cache flow since it's already been handled. - $this->use_cache_flow = false; - - // Make the request - $response = $this->authenticate($bucket, $opt, $location, $redirects); - - if (isset($response->body) && ($response->body instanceof SimpleXMLElement)) - { - $response->body = $response->body->asXML(); - } - - return $response; - } - - /*%******************************************************************************************%*/ // SETTERS @@ -1322,8 +1305,8 @@ public function set_bucket_acl($bucket, $acl = self::ACL_PRIVATE, $opt = null) *
                                                      • fileUpload - string|resource - Required; Conditional - The URL/path for the file to upload, or an open resource. Either this parameter or body is required.
                                                      • *
                                                      • acl - string - Optional - The ACL settings for the specified object. [Allowed values: AmazonS3::ACL_PRIVATE, AmazonS3::ACL_PUBLIC, AmazonS3::ACL_OPEN, AmazonS3::ACL_AUTH_READ, AmazonS3::ACL_OWNER_READ, AmazonS3::ACL_OWNER_FULL_CONTROL]. The default value is ACL_PRIVATE.
                                                      • *
                                                      • contentType - string - Optional - The type of content that is being sent in the body. If a file is being uploaded via fileUpload as a file system path, it will attempt to determine the correct mime-type based on the file extension. The default value is application/octet-stream.
                                                      • - *
                                                      • contentType - string - Optional - The type of content that is being sent in the body. If a file is being uploaded via fileUpload as a file system path, it will attempt to determine the correct mime-type based on the file extension. The default value is application/octet-stream.
                                                      • *
                                                      • encryption - string - Optional - The algorithm to use for encrypting the object. [Allowed values: AES256]
                                                      • + *
                                                      • headers - array - Optional - Standard HTTP headers to send along in the request. Accepts an associative array of key-value pairs.
                                                      • *
                                                      • length - integer - Optional - The size of the object in bytes. For more information, see RFC 2616, section 14.13. The value can also be passed to the header option as Content-Length.
                                                      • *
                                                      • meta - array - Optional - An associative array of key-value pairs. Represented by x-amz-meta-:. Any header starting with this prefix is considered user metadata. It will be stored with the object and returned when you retrieve the object. The total size of the HTTP request, not including the body, must be less than 4 KB.
                                                      • *
                                                      • seekTo - integer - Optional - The starting position in bytes within the file/stream to upload from.
                                                      • @@ -1399,7 +1382,7 @@ public function create_object($bucket, $filename, $opt = null) * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                          *
                                                        • etag - string - Optional - The ETag header passed in from a previous request. If specified, request LastModified option must be specified as well. Will trigger a 304 Not Modified status code if the file hasn't changed.
                                                        • *
                                                        • fileDownload - string|resource - Optional - The file system location to download the file to, or an open file resource. Must be a server-writable location.
                                                        • - *
                                                        • headers - array - Optional - Standard HTTP headers to send along in the request.
                                                        • + *
                                                        • headers - array - Optional - Standard HTTP headers to send along in the request. Accepts an associative array of key-value pairs.
                                                        • *
                                                        • lastmodified - string - Optional - The LastModified header passed in from a previous request. If specified, request ETag option must be specified as well. Will trigger a 304 Not Modified status code if the file hasn't changed.
                                                        • *
                                                        • preauth - integer|string - Optional - Specifies that a presigned URL for this request should be returned. May be passed as a number of seconds since UNIX Epoch, or any string compatible with .
                                                        • *
                                                        • range - string - Optional - The range of bytes to fetch from the object. Specify this parameter when downloading partial bits or completing incomplete object downloads. The specified range must be notated with a hyphen (e.g., 0-10485759). Defaults to the byte range of the complete Amazon S3 object.
                                                        • @@ -1591,11 +1574,13 @@ public function delete_objects($bucket, $opt = null) /** * Gets a list of all Amazon S3 objects in the specified bucket. * + * NOTE: This method is paginated, and will not return more than max-keys keys. If you want to retrieve a list of all keys, you will need to make multiple calls to this function using the marker option to specify the pagination offset (the key of the last processed key--lexically ordered) and the IsTruncated response key to detect when all results have been processed. See: the S3 REST documentation for get_bucket for more information. + * * @param string $bucket (Required) The name of the bucket to use. * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                            *
                                                          • delimiter - string - Optional - Keys that contain the same string between the prefix and the first occurrence of the delimiter will be rolled up into a single result element in the CommonPrefixes collection.
                                                          • *
                                                          • marker - string - Optional - Restricts the response to contain results that only occur alphabetically after the value of the marker.
                                                          • - *
                                                          • max-keys - string - Optional - The maximum number of results returned by the method call. The returned list will contain no more results than the specified value, but may return less.
                                                          • + *
                                                          • max-keys - string - Optional - The maximum number of results returned by the method call. The returned list will contain no more results than the specified value, but may return fewer. The default value is 1000.
                                                          • *
                                                          • preauth - integer|string - Optional - Specifies that a presigned URL for this request should be returned. May be passed as a number of seconds since UNIX Epoch, or any string compatible with .
                                                          • *
                                                          • prefix - string - Optional - Restricts the response to contain results that begin only with the specified prefix.
                                                          • *
                                                          • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                                          • @@ -1640,7 +1625,7 @@ public function list_objects($bucket, $opt = null) *
                                                          • ifUnmodifiedSince - string - Optional - The LastModified header from a previous request. Copies the object if it hasn't been modified since the specified time; otherwise, the request returns a 412 HTTP status code error (precondition failed). Used in conjunction with ifMatch.
                                                          • *
                                                          • ifNoneMatch - string - Optional - The ETag header from a previous request. Copies the object if its entity tag (ETag) is different than the specified ETag; otherwise, the request returns a 412 HTTP status code error (failed condition). Used in conjunction with ifModifiedSince.
                                                          • *
                                                          • ifModifiedSince - string - Optional - The LastModified header from a previous request. Copies the object if it has been modified since the specified time; otherwise, the request returns a 412 HTTP status code error (failed condition). Used in conjunction with ifNoneMatch.
                                                          • - *
                                                          • headers - array - Optional - Standard HTTP headers to send along in the request.
                                                          • + *
                                                          • headers - array - Optional - Standard HTTP headers to send along in the request. Accepts an associative array of key-value pairs.
                                                          • *
                                                          • meta - array - Optional - Associative array of key-value pairs. Represented by x-amz-meta-: Any header starting with this prefix is considered user metadata. It will be stored with the object and returned when you retrieve the object. The total size of the HTTP request, not including the body, must be less than 4 KB.
                                                          • *
                                                          • metadataDirective - string - Optional - Accepts either COPY or REPLACE. You will likely never need to use this, as it manages itself with no issues.
                                                          • *
                                                          • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                                          • @@ -1770,7 +1755,7 @@ public function copy_object($source, $dest, $opt = null) * @param string $filename (Required) The source file name that you want to update. * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                              *
                                                            • acl - string - Optional - The ACL settings for the specified object. [Allowed values: AmazonS3::ACL_PRIVATE, AmazonS3::ACL_PUBLIC, AmazonS3::ACL_OPEN, AmazonS3::ACL_AUTH_READ, AmazonS3::ACL_OWNER_READ, AmazonS3::ACL_OWNER_FULL_CONTROL]. The default value is .
                                                            • - *
                                                            • headers - array - Optional - The standard HTTP headers to update the Amazon S3 object with.
                                                            • + *
                                                            • headers - array - Optional - Standard HTTP headers to send along in the request. Accepts an associative array of key-value pairs.
                                                            • *
                                                            • meta - array - Optional - An associative array of key-value pairs. Any header with the x-amz-meta- prefix is considered user metadata and is stored with the Amazon S3 object. It will be stored with the object and returned when you retrieve the object. The total size of the HTTP request, not including the body, must be less than 4 KB.
                                                            • *
                                                            • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                                            • *
                                                            • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                                            @@ -1780,7 +1765,7 @@ public function copy_object($source, $dest, $opt = null) public function update_object($bucket, $filename, $opt = null) { if (!$opt) $opt = array(); - $opt['metadataDirective'] = 'REPLACE'; + $opt['metadataDirective'] = 'COPY'; // Authenticate to S3 return $this->copy_object( @@ -2261,7 +2246,7 @@ public function change_content_type($bucket, $filename, $contentType, $opt = nul 'headers' => array( 'Content-Type' => $contentType ), - 'metadataDirective' => 'REPLACE' + 'metadataDirective' => 'COPY' ), $opt); return $this->copy_object( @@ -2516,18 +2501,24 @@ public function delete_all_object_versions($bucket, $pcre = null) { if (preg_match($pcre, (string) $marker->Key)) { - $objects[] = array( - 'key' => (string) $marker->Key, - 'version_id' => (string) $marker->VersionId - ); + $xx = array('key' => (string) $marker->Key); + if ((string) $marker->VersionId !== 'null') + { + $xx['version_id'] = (string) $marker->VersionId; + } + $objects[] = $xx; + unset($xx); } } else { - $objects[] = array( - 'key' => (string) $marker->Key, - 'version_id' => (string) $marker->VersionId - ); + $xx = array('key' => (string) $marker->Key); + if ((string) $marker->VersionId !== 'null') + { + $xx['version_id'] = (string) $marker->VersionId; + } + $objects[] = $xx; + unset($xx); } } @@ -3046,7 +3037,7 @@ public function get_multipart_counts($filesize, $part_size) *
                                                          • acl - string - Optional - The ACL settings for the specified object. [Allowed values: AmazonS3::ACL_PRIVATE, AmazonS3::ACL_PUBLIC, AmazonS3::ACL_OPEN, AmazonS3::ACL_AUTH_READ, AmazonS3::ACL_OWNER_READ, AmazonS3::ACL_OWNER_FULL_CONTROL]. The default value is ACL_PRIVATE.
                                                          • *
                                                          • contentType - string - Optional - The type of content that is being sent. The default value is application/octet-stream.
                                                          • *
                                                          • encryption - string - Optional - The algorithm to use for encrypting the object. [Allowed values: AES256]
                                                          • - *
                                                          • headers - array - Optional - The standard HTTP headers to send along in the request.
                                                          • + *
                                                          • headers - array - Optional - Standard HTTP headers to send along in the request. Accepts an associative array of key-value pairs.
                                                          • *
                                                          • meta - array - Optional - An associative array of key-value pairs. Any header starting with x-amz-meta-: is considered user metadata. It will be stored with the object and returned when you retrieve the object. The total size of the HTTP request, not including the body, must be less than 4 KB.
                                                          • *
                                                          • storage - string - Optional - Whether to use Standard or Reduced Redundancy storage. [Allowed values: AmazonS3::STORAGE_STANDARD, AmazonS3::STORAGE_REDUCED]. The default value is STORAGE_STANDARD.
                                                          • *
                                                          • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                                          • @@ -3128,7 +3119,7 @@ public function initiate_multipart_upload($bucket, $filename, $opt = null) *
                                                          • fileUpload - string|resource - Required - The URL/path for the file to upload or an open resource.
                                                          • *
                                                          • partNumber - integer - Required - The part number order of the multipart upload.
                                                          • *
                                                          • expect - string - Optional - Specifies that the SDK not send the request body until it receives an acknowledgement. If the message is rejected based on the headers, the body of the message is not sent. For more information, see RFC 2616, section 14.20. The value can also be passed to the header option as Expect. [Allowed values: 100-continue]
                                                          • - *
                                                          • headers - array - Optional - The standard HTTP headers to send along in the request.
                                                          • + *
                                                          • headers - array - Optional - Standard HTTP headers to send along in the request. Accepts an associative array of key-value pairs.
                                                          • *
                                                          • length - integer - Optional - The size of the part in bytes. For more information, see RFC 2616, section 14.13. The value can also be passed to the header option as Content-Length.
                                                          • *
                                                          • md5 - string - Optional - The base64 encoded 128-bit MD5 digest of the part data. This header can be used as a message integrity check to verify that the part data is the same data that was originally sent. Although it is optional, we recommend using this mechanism as an end-to-end integrity check. For more information, see RFC 1864. The value can also be passed to the header option as Content-MD5.
                                                          • *
                                                          • seekTo - integer - Optional - The starting position in bytes for the piece of the file/stream to upload.
                                                          • @@ -3446,7 +3437,7 @@ public function copy_part($source, $dest, $upload_id, $part_number, $opt = null) *
                                                          • fileUpload - string|resource - Required - The URL/path for the file to upload, or an open resource.
                                                          • *
                                                          • acl - string - Optional - The ACL settings for the specified object. [Allowed values: AmazonS3::ACL_PRIVATE, AmazonS3::ACL_PUBLIC, AmazonS3::ACL_OPEN, AmazonS3::ACL_AUTH_READ, AmazonS3::ACL_OWNER_READ, AmazonS3::ACL_OWNER_FULL_CONTROL]. The default value is ACL_PRIVATE.
                                                          • *
                                                          • contentType - string - Optional - The type of content that is being sent in the body. The default value is application/octet-stream.
                                                          • - *
                                                          • headers - array - Optional - The standard HTTP headers to send along in the request.
                                                          • + *
                                                          • headers - array - Optional - Standard HTTP headers to send along in the request. Accepts an associative array of key-value pairs.
                                                          • *
                                                          • length - integer - Optional - The size of the object in bytes. For more information, see RFC 2616, section 14.13. The value can also be passed to the header option as Content-Length.
                                                          • *
                                                          • limit - integer - Optional - The maximum number of concurrent uploads done by cURL. Gets passed to CFBatchRequest.
                                                          • *
                                                          • meta - array - Optional - An associative array of key-value pairs. Any header starting with x-amz-meta-: is considered user metadata. It will be stored with the object and returned when you retrieve the object. The total size of the HTTP request, not including the body, must be less than 4 KB.
                                                          • diff --git a/services/sdb.class.php b/services/sdb.class.php index 0468a42..11293e6 100644 --- a/services/sdb.class.php +++ b/services/sdb.class.php @@ -1,6 +1,6 @@ http://aws.amazon.com/simpledb/ for more * information. * - * @version 2011.12.13 + * @version 2012.01.16 * @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/simpledb/ Amazon SimpleDB diff --git a/services/ses.class.php b/services/ses.class.php index a84634d..38b96f3 100644 --- a/services/ses.class.php +++ b/services/ses.class.php @@ -1,6 +1,6 @@ Amazon SES Developer Guide. + * + *

                                                            + * The endpoint for AWS Email Service is located at: + * https://email.us-east-1.amazonaws.com + *

                                                            * - * @version 2011.12.13 + * @version 2012.01.16 * @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/ses/ Amazon Simple Email Service @@ -127,7 +132,7 @@ public function delete_verified_email_address($email_address, $opt = null) } /** - * Returns the user's current activity limits. + * Returns the user's current sending limits. * * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                              *
                                                            • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                                            • @@ -182,7 +187,19 @@ public function list_verified_email_addresses($opt = null) * If you have not yet requested production access to Amazon SES, then you will only be able to * send email to and from verified email addresses. For more information, go to the Amazon SES Developer Guide. - *

                                                              + *

                                                              + * The total size of the message cannot exceed 10 MB. + * + * Amazon SES has a limit on the total number of recipients per message: The combined number of + * To:, CC: and BCC: email addresses cannot exceed 50. If you need to send an email message to a + * larger audience, you can divide your recipient list into groups of 50 or fewer, and then call + * Amazon SES repeatedly to send the message to each group. + * + * For every message that you send, the total number of recipients (To:, CC: and BCC:) is counted + * against your sending quota - the maximum number of emails you can send in a 24-hour + * period. For information about your sending quota, go to the "Managing Your Sending Activity" + * section of the Amazon SES + * Developer Guide. * * @param string $source (Required) The sender's email address. * @param array $destination (Required) The destination for this email, composed of To:, CC:, and BCC: fields.
                                                                @@ -261,7 +278,20 @@ public function send_email($source, $destination, $message, $opt = null) * If you have not yet requested production access to Amazon SES, then you will only be able to * send email to and from verified email addresses. For more information, go to the Amazon SES Developer Guide. - *

                                                                + *

                                                                + * The total size of the message cannot exceed 10 MB. This includes any attachments that are part + * of the message. + * + * Amazon SES has a limit on the total number of recipients per message: The combined number of + * To:, CC: and BCC: email addresses cannot exceed 50. If you need to send an email message to a + * larger audience, you can divide your recipient list into groups of 50 or fewer, and then call + * Amazon SES repeatedly to send the message to each group. + * + * For every message that you send, the total number of recipients (To:, CC: and BCC:) is counted + * against your sending quota - the maximum number of emails you can send in a 24-hour + * period. For information about your sending quota, go to the "Managing Your Sending Activity" + * section of the Amazon SES + * Developer Guide. * * @param array $raw_message (Required) The raw text of the message. The client is responsible for ensuring the following:
                                                                • Message must contain a header and a body, separated by a blank line.
                                                                • All required header fields must be present.
                                                                • Each part of a multipart MIME message must be formatted properly.
                                                                • MIME content types must be among those supported by Amazon SES. Refer to the Amazon SES Developer Guide for more details.
                                                                • Content must be base64-encoded, if MIME requires it.
                                                                  *
                                                                • x - array - Optional - This represents a simple array index.
                                                                    diff --git a/services/sns.class.php b/services/sns.class.php index 21f383b..ea26348 100644 --- a/services/sns.class.php +++ b/services/sns.class.php @@ -1,6 +1,6 @@ Amazon Simple Notification Service (Amazon SNS) API Reference. This guide + * provides detailed information about Amazon SNS actions, data types, parameters, and errors. For + * detailed information about Amazon SNS features and their associated API calls, go to the + * Amazon SNS Getting Started + * Guide. + * + * Amazon Simple Notification Service is a web service that enables you to build distributed + * web-enabled applications. Applications can use Amazon SNS to easily push real-time notification + * messages to interested subscribers over multiple delivery protocols. For more information about + * this product go to http://aws.amazon.com/sns. + * + * Use the following links to get started using the Amazon Simple Notification Service API + * Reference: * + * * - * @version 2011.12.13 + * @version 2012.01.16 * @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/sns/ Amazon Simple Notification Service @@ -186,7 +215,7 @@ public function get_topic_list($pcre = null) * @param string $topic_arn (Required) The ARN of the topic whose access control policy you wish to modify. * @param string $label (Required) A unique identifier for the new policy statement. * @param string|array $aws_account_id (Required) The AWS account IDs of the users (principals) who will be given access to the specified actions. The users must have AWS accounts, but do not need to be signed up for this service. Pass a string for a single value, or an indexed array for multiple values. - * @param string|array $action_name (Required) The action you want to allow for the specified principal(s). Pass a string for a single value, or an indexed array for multiple values. + * @param string|array $action_name (Required) The action you want to allow for the specified principal(s). Valid values: any Amazon SNS action name. 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:
                                                                      *
                                                                    • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                                                    • *
                                                                    • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                                                    @@ -220,7 +249,7 @@ public function add_permission($topic_arn, $label, $aws_account_id, $action_name * @param string $topic_arn (Required) The ARN of the topic for which you wish to confirm a subscription. * @param string $token (Required) Short-lived token sent to an endpoint during the Subscribe action. * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                                      - *
                                                                    • AuthenticateOnUnsubscribe - string - Optional - Indicates that you want to disable unauthenticated unsubsciption of the subscription. If parameter is present in the request, the request has an AWS signature, and the value of this parameter is true, only the topic owner and the subscription owner will be permitted to unsubscribe the endopint, and the Unsubscribe action will require AWS authentication.
                                                                    • + *
                                                                    • AuthenticateOnUnsubscribe - string - Optional - Disallows unauthenticated unsubscribes of the subscription. If the value of this parameter is true and the request has an AWS signature, then only the topic owner and the subscription owner can unsubscribe the endpoint. The unsubscribe action will require AWS authentication.
                                                                    • *
                                                                    • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                                                    • *
                                                                    • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                                                    * @return CFResponse A object containing a parsed HTTP response. @@ -272,6 +301,23 @@ public function delete_topic($topic_arn, $opt = null) return $this->authenticate('DeleteTopic', $opt); } + /** + * The GetSubscriptionAttribtues action returns all of the properties of a subscription. + * + * @param string $subscription_arn (Required) The ARN of the subscription whose properties you want to get. + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                                      + *
                                                                    • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                                                    • + *
                                                                    • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                                                    + * @return CFResponse A object containing a parsed HTTP response. + */ + public function get_subscription_attributes($subscription_arn, $opt = null) + { + if (!$opt) $opt = array(); + $opt['SubscriptionArn'] = $subscription_arn; + + return $this->authenticate('GetSubscriptionAttributes', $opt); + } + /** * The GetTopicAttribtues action returns all of the properties of a topic customers have created. * Topic properties returned might differ based on the authorization of the user. @@ -292,8 +338,9 @@ public function get_topic_attributes($topic_arn, $opt = null) /** * The ListSubscriptions action returns a list of the requester's subscriptions. Each call returns - * a limited list of subscriptions. If there are more subscriptions, a NextToken is also returned. - * Use the NextToken parameter in a new ListSubscriptions call to get further results. + * a limited list of subscriptions, up to 100. If there are more subscriptions, a NextToken is + * also returned. Use the NextToken parameter in a new ListSubscriptions call to get further + * results. * * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                                      *
                                                                    • NextToken - string - Optional - Token returned by the previous ListSubscriptions request.
                                                                    • @@ -310,9 +357,9 @@ public function list_subscriptions($opt = null) /** * The ListSubscriptionsByTopic action returns a list of the subscriptions to a specific topic. - * Each call returns a limited list of subscriptions. If there are more subscriptions, a NextToken - * is also returned. Use the NextToken parameter in a new ListSubscriptionsByTopic call to get - * further results. + * Each call returns a limited list of subscriptions, up to 100. If there are more subscriptions, + * a NextToken is also returned. Use the NextToken parameter in a new ListSubscriptionsByTopic + * call to get further results. * * @param string $topic_arn (Required) The ARN of the topic for which you wish to find subscriptions. * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                                        @@ -331,8 +378,8 @@ public function list_subscriptions_by_topic($topic_arn, $opt = null) /** * The ListTopics action returns a list of the requester's topics. Each call returns a limited - * list of topics. If there are more topics, a NextToken is also returned. Use the NextToken - * parameter in a new ListTopics call to get further results. + * list of topics, up to 100. If there are more topics, a NextToken is also returned. Use the + * NextToken parameter in a new ListTopics call to get further results. * * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                                          *
                                                                        • NextToken - string - Optional - Token returned by the previous ListTopics request.
                                                                        • @@ -357,6 +404,7 @@ public function list_topics($opt = null) * @param string $message (Required) The message you want to send to the topic. Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters). * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                                            *
                                                                          • Subject - string - Optional - Optional parameter to be used as the "Subject" line of when the message is delivered to e-mail endpoints. This field will also be included, if present, in the standard JSON messages delivered to other endpoints. Constraints: Subjects must be ASCII text that begins with a letter, number or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long.
                                                                          • + *
                                                                          • MessageStructure - string - Optional - Optional parameter. It will have one valid value: "json". If this option, Message is present and set to "json", the value of Message must: be a syntactically valid JSON object. It must contain at least a top level JSON key of "default" with a value that is a string. For any other top level key that matches one of our transport protocols (e.g. "http"), then the corresponding value (if it is a string) will be used for the message published for that protocol Constraints: Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values. The values will be parsed (unescaped) before they are used in outgoing messages. Typically, outbound notifications are JSON encoded (meaning, the characters will be reescaped for sending). JSON strings are UTF-8. Values have a minimum length of 0 (the empty string, "", is allowed). Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes). Non-string values will cause the key to be ignored. Keys that do not correspond to supported transport protocols will be ignored. Duplicate keys are not allowed. Failure to parse or validate any key or value in the message will cause the Publish call to return an error (no partial delivery).
                                                                          • *
                                                                          • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                                                          • *
                                                                          • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                                                          * @return CFResponse A object containing a parsed HTTP response. @@ -389,12 +437,34 @@ public function remove_permission($topic_arn, $label, $opt = null) return $this->authenticate('RemovePermission', $opt); } + /** + * The SetSubscriptionAttributes action allows a subscription owner to set an attribute of the + * topic to a new value. + * + * @param string $subscription_arn (Required) The ARN of the subscription to modify. + * @param string $attribute_name (Required) The name of the attribute you want to set. Only a subset of the subscriptions attributes are mutable. Valid values: DeliveryPolicy + * @param string $attribute_value (Required) The new value for the attribute. + * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                                            + *
                                                                          • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                                                          • + *
                                                                          • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                                                          + * @return CFResponse A object containing a parsed HTTP response. + */ + public function set_subscription_attributes($subscription_arn, $attribute_name, $attribute_value, $opt = null) + { + if (!$opt) $opt = array(); + $opt['SubscriptionArn'] = $subscription_arn; + $opt['AttributeName'] = $attribute_name; + $opt['AttributeValue'] = $attribute_value; + + return $this->authenticate('SetSubscriptionAttributes', $opt); + } + /** * The SetTopicAttributes action allows a topic owner to set an attribute of the topic to a new * value. * * @param string $topic_arn (Required) The ARN of the topic to modify. - * @param string $attribute_name (Required) The name of the attribute you want to set. Only a subset of the topic's attributes are mutable. + * @param string $attribute_name (Required) The name of the attribute you want to set. Only a subset of the topic's attributes are mutable. Valid values: Policy | DisplayName * @param string $attribute_value (Required) The new value for the attribute. * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                                            *
                                                                          • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                                                          • @@ -415,11 +485,11 @@ public function set_topic_attributes($topic_arn, $attribute_name, $attribute_val * The Subscribe action prepares to subscribe an endpoint by sending the endpoint a confirmation * message. To actually create a subscription, the endpoint owner must call the * ConfirmSubscription action with the token from the confirmation message. Confirmation tokens - * are valid for twenty-four hours. + * are valid for three days. * * @param string $topic_arn (Required) The ARN of topic you want to subscribe to. - * @param string $protocol (Required) The protocol you want to use. Supported protocols include:
                                                                            • http -- delivery of JSON-encoded message via HTTP POST
                                                                            • https -- delivery of JSON-encoded message via HTTPS POST
                                                                            • email -- delivery of message via SMTP
                                                                            • email-json -- delivery of JSON-encoded message via SMTP
                                                                            • sqs -- delivery of JSON-encoded message to an Amazon SQS queue
                                                                            - * @param string $endpoint (Required) The endpoint that you want to receive notifications. Endpoints vary by protocol:
                                                                            • For the http protocol, the endpoint is an URL beginning with "http://"
                                                                            • For the https protocol, the endpoint is a URL beginning with "https://"
                                                                            • For the email protocol, the endpoint is an e-mail address
                                                                            • For the email-json protocol, the endpoint is an e-mail address
                                                                            • For the sqs protocol, the endpoint is the ARN of an Amazon SQS queue
                                                                            + * @param string $protocol (Required) The protocol you want to use. Supported protocols include:
                                                                            • http -- delivery of JSON-encoded message via HTTP POST
                                                                            • https -- delivery of JSON-encoded message via HTTPS POST
                                                                            • email -- delivery of message via SMTP
                                                                            • email-json -- delivery of JSON-encoded message via SMTP
                                                                            • sms -- delivery of message via SMS
                                                                            • sqs -- delivery of JSON-encoded message to an Amazon SQS queue
                                                                            + * @param string $endpoint (Required) The endpoint that you want to receive notifications. Endpoints vary by protocol:
                                                                            • For the http protocol, the endpoint is an URL beginning with "http://"
                                                                            • For the https protocol, the endpoint is a URL beginning with "https://"
                                                                            • For the email protocol, the endpoint is an e-mail address
                                                                            • For the email-json protocol, the endpoint is an e-mail address
                                                                            • For the sms protocol, the endpoint is a phone number of an SMS-enabled device
                                                                            • For the sqs protocol, the endpoint is the ARN of an Amazon SQS queue
                                                                            * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                                              *
                                                                            • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
                                                                            • *
                                                                            • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.
                                                                            diff --git a/services/sts.class.php b/services/sts.class.php index fa36094..1543b69 100644 --- a/services/sts.class.php +++ b/services/sts.class.php @@ -1,6 +1,6 @@ Using AWS Identity and Access Management. + * This is the AWS Security Token Service API Reference. The AWS Security Token Service + * is a web service that enables you to request temporary, limited-privilege credentials for AWS + * Identity and Access Management (IAM) users or for users that you authenticate (federated + * users). This guide provides descriptions of the AWS Security Token Service API as well as links + * to related content in Using IAM. * * For more detailed information about using this service, go to Granting Temporary Access to Your AWS Resources, in Using AWS Identity and - * Access Management. + * "_blank">Granting Temporary Access to Your AWS Resources in Using IAM. * * For specific information about setting up signatures and authorization through the API, go to * Making Query Requests in Using AWS Identity and Access Management. + * "_blank">Making Query Requests in Using IAM. * * If you're new to AWS and need additional technical information about a specific AWS product, * you can find the product'stechnical documentation at http://aws.amazon.com/documentation/. * - * We will refer to Amazon AWS Security Token Service using the abbreviated form STS, and to - * Amazon Identity and Access Management using the abbreviated form IAM. All copyrights and legal - * protections still apply. + * We will refer to Amazon Identity and Access Management using the abbreviated form IAM. All + * copyrights and legal protections still apply. * - * @version 2011.12.13 + * @version 2012.01.16 * @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/sts/ Amazon Secure Token Service @@ -120,8 +119,8 @@ public function set_region($region) * * The federated user who holds these credentials has any permissions allowed by the intersection * of the specified policy and any resource or user policies that apply to the caller of the - * GetFederationToken API, and any resource policies that apply to the federated user's ARN. For - * more information about how token permissions work, see Controlling Permissions in Temporary Credentials in Using AWS Identity and * Access Management. For information about using GetFederationToken to create temporary @@ -148,7 +147,7 @@ public function get_federation_token($name, $opt = null) /** * The GetSessionToken action returns a set of temporary credentials for an AWS account or IAM - * User. The credentials consist of an Access Key ID, a Secret Access Key, and a security token. + * user. The credentials consist of an Access Key ID, a Secret Access Key, and a security token. * These credentials are valid for the specified duration only. The session duration for IAM users * can be between one and 36 hours, with a default of 12 hours. The session duration for AWS * account owners is restricted to one hour. @@ -156,7 +155,7 @@ public function get_federation_token($name, $opt = null) * For more information about using GetSessionToken to create temporary credentials, go to * Creating Temporary Credentials to Enable Access for IAM Users in Using - * AWS Identity and Access Management. + * IAM. * * @param array $opt (Optional) An associative array of parameters that can have the following keys:
                                                                              *
                                                                            • DurationSeconds - integer - Optional - The duration, in seconds, that the credentials should remain valid. Acceptable durations for IAM user sessions range from 3600s (one hour) to 129600s (36 hours), with 43200s (12 hours) as the default. Sessions for AWS account owners are restricted to a maximum of 3600s (one hour).
                                                                            • diff --git a/utilities/array.class.php b/utilities/array.class.php index 4330bd3..dea6735 100644 --- a/utilities/array.class.php +++ b/utilities/array.class.php @@ -1,6 +1,6 @@ and objects that are returned by AWS services. * - * @version 2011.12.02 + * @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 @@ -41,7 +41,16 @@ class CFArray extends ArrayObject */ public function __construct($input = array(), $flags = self::STD_PROP_LIST, $iterator_class = 'ArrayIterator') { - return parent::__construct($input, $flags, $iterator_class); + // Provide a default value + $input = $input ? $input : array(); + + try { + return parent::__construct($input, $flags, $iterator_class); + } + catch (InvalidArgumentException $e) + { + throw new CFArray_Exception($e->getMessage()); + } } /** @@ -299,3 +308,5 @@ public function to_yaml() return sfYaml::dump($this->getArrayCopy(), 5); } } + +class CFArray_Exception extends Exception {} diff --git a/utilities/batchrequest.class.php b/utilities/batchrequest.class.php index 223e119..9782834 100644 --- a/utilities/batchrequest.class.php +++ b/utilities/batchrequest.class.php @@ -1,6 +1,6 @@ onto this one. + * + * @param CFCredential $credential (Required) Another instance of . + * @return CFCredential A reference to the current collection. + */ + public function merge(CFCredential $credential) + { + $merged = array_merge($this->to_array(), $credential->to_array()); + $this->collection->exchangeArray($merged); + return $this; + } + /** * Retrieves the data as a standard array. * diff --git a/utilities/credentials.class.php b/utilities/credentials.class.php index 4bea3f2..2504a08 100644 --- a/utilities/credentials.class.php +++ b/utilities/credentials.class.php @@ -1,6 +1,6 @@