Index: trunk/extensions/OpenStackManager/aws-sdk/services/s3.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | * Visit <http://aws.amazon.com/s3/> for more information. |
40 | 40 | * |
41 | 41 | * Version: |
42 | | - * 2010.12.02 |
| 42 | + * 2011.01.16 |
43 | 43 | * |
44 | 44 | * License and Copyright: |
45 | 45 | * See the included NOTICE.md file for more information. |
— | — | @@ -261,7 +261,13 @@ |
262 | 262 | */ |
263 | 263 | public $path_style = false; |
264 | 264 | |
| 265 | + /** |
| 266 | + * Property: temporary_prefix |
| 267 | + * The state of whether the prefix change is temporary or permanent. |
| 268 | + */ |
| 269 | + public $temporary_prefix = false; |
265 | 270 | |
| 271 | + |
266 | 272 | /*%******************************************************************************************%*/ |
267 | 273 | // CONSTRUCTOR |
268 | 274 | |
— | — | @@ -338,14 +344,14 @@ |
339 | 345 | * <verb> /<resource>?<sub_resource>&<query_string> |
340 | 346 | * GET /filename.txt?versions&prefix=abc&max-items=1 |
341 | 347 | * |
342 | | - * ## versionId, uploadId, partNumber ## |
| 348 | + * ## versionId, uploadId, partNumber, response-* ## |
343 | 349 | * These don't follow the same rules as above, in that the they needs to be signed, while |
344 | 350 | * other query_string values do not. |
345 | 351 | * |
346 | 352 | * ## curlopts ## |
347 | 353 | * These values get passed directly to the cURL methods in RequestCore. |
348 | 354 | * |
349 | | - * ## fileUpload, fileDownload, seekTo, length ## |
| 355 | + * ## fileUpload, fileDownload, seekTo ## |
350 | 356 | * These are slightly modified and then passed to the cURL methods in RequestCore. |
351 | 357 | * |
352 | 358 | * ## headers ## |
— | — | @@ -406,11 +412,17 @@ |
407 | 413 | if (!$this->resource_prefix || $this->path_style) |
408 | 414 | { |
409 | 415 | // And if the bucket name isn't DNS-valid... |
410 | | - if (!$this->validate_bucketname_create($bucket) || $this->path_style) |
| 416 | + if (!$this->validate_bucketname_create($bucket)) |
411 | 417 | { |
412 | 418 | // Fall back to the older path-style URI |
413 | 419 | $this->set_resource_prefix('/' . $bucket); |
| 420 | + $this->temporary_prefix = true; |
414 | 421 | } |
| 422 | + elseif ($this->path_style) |
| 423 | + { |
| 424 | + // Fall back to the older path-style URI |
| 425 | + $this->set_resource_prefix('/' . $bucket); |
| 426 | + } |
415 | 427 | } |
416 | 428 | |
417 | 429 | // Determine hostname |
— | — | @@ -455,19 +467,24 @@ |
456 | 468 | $query_string = $this->util->to_query_string($query_string_params); |
457 | 469 | |
458 | 470 | // Merge the signable query string values. Must be alphabetical. |
459 | | - if (isset($opt['partNumber'])) |
| 471 | + $signable_list = array( |
| 472 | + 'partNumber', |
| 473 | + 'response-cache-control', |
| 474 | + 'response-content-disposition', |
| 475 | + 'response-content-encoding', |
| 476 | + 'response-content-language', |
| 477 | + 'response-content-type', |
| 478 | + 'response-expires', |
| 479 | + 'uploadId', |
| 480 | + 'versionId' |
| 481 | + ); |
| 482 | + foreach ($signable_list as $item) |
460 | 483 | { |
461 | | - $signable_query_string_params['partNumber'] = rawurlencode($opt['partNumber']); |
| 484 | + if (isset($opt[$item])) |
| 485 | + { |
| 486 | + $signable_query_string_params[$item] = $opt[$item]; |
| 487 | + } |
462 | 488 | } |
463 | | - if (isset($opt['uploadId'])) |
464 | | - { |
465 | | - $signable_query_string_params['uploadId'] = rawurlencode($opt['uploadId']); |
466 | | - } |
467 | | - if (isset($opt['versionId'])) |
468 | | - { |
469 | | - $signable_query_string_params['versionId'] = rawurlencode($opt['versionId']); |
470 | | - } |
471 | | - // ksort($signable_query_string_params); |
472 | 489 | $signable_query_string = $this->util->to_query_string($signable_query_string_params); |
473 | 490 | |
474 | 491 | // Merge the HTTP headers |
— | — | @@ -478,7 +495,7 @@ |
479 | 496 | |
480 | 497 | // Compile the URI to request |
481 | 498 | $conjunction = '?'; |
482 | | - $signable_resource = '/' . rawurlencode($resource); |
| 499 | + $signable_resource = '/' . str_replace('%2F', '/', rawurlencode($resource)); |
483 | 500 | $non_signable_resource = ''; |
484 | 501 | |
485 | 502 | if (isset($opt['sub_resource'])) |
— | — | @@ -488,7 +505,7 @@ |
489 | 506 | } |
490 | 507 | if ($signable_query_string !== '') |
491 | 508 | { |
492 | | - $signable_resource .= $conjunction . $signable_query_string; |
| 509 | + $signable_query_string = $conjunction . $signable_query_string; |
493 | 510 | $conjunction = '&'; |
494 | 511 | } |
495 | 512 | if ($query_string !== '') |
— | — | @@ -496,7 +513,7 @@ |
497 | 514 | $non_signable_resource .= $conjunction . $query_string; |
498 | 515 | $conjunction = '&'; |
499 | 516 | } |
500 | | - $this->request_url = $scheme . $hostname . $signable_resource . $non_signable_resource; |
| 517 | + $this->request_url = $scheme . $hostname . $signable_resource . $signable_query_string . $non_signable_resource; |
501 | 518 | |
502 | 519 | // Instantiate the request class |
503 | 520 | $request = new $this->request_class($this->request_url, $this->proxy); |
— | — | @@ -510,8 +527,26 @@ |
511 | 528 | { |
512 | 529 | if (is_resource($opt['fileUpload'])) |
513 | 530 | { |
514 | | - $request->set_read_stream($opt['fileUpload'], isset($opt['length']) ? $opt['length'] : -1); |
| 531 | + // Determine the length to read from the stream |
| 532 | + $length = null; // From current position until EOF by default, size determined by set_read_stream() |
515 | 533 | |
| 534 | + if (isset($headers['Content-Length'])) |
| 535 | + { |
| 536 | + $length = $headers['Content-Length']; |
| 537 | + } |
| 538 | + elseif (isset($opt['seekTo'])) |
| 539 | + { |
| 540 | + // Read from seekTo until EOF by default |
| 541 | + $stats = fstat($opt['fileUpload']); |
| 542 | + |
| 543 | + if ($stats && $stats['size'] >= 0) |
| 544 | + { |
| 545 | + $length = $stats['size'] - (integer) $opt['seekTo']; |
| 546 | + } |
| 547 | + } |
| 548 | + |
| 549 | + $request->set_read_stream($opt['fileUpload'], $length); |
| 550 | + |
516 | 551 | if ($headers['Content-Type'] === 'application/x-www-form-urlencoded') |
517 | 552 | { |
518 | 553 | $headers['Content-Type'] = 'application/octet-stream'; |
— | — | @@ -521,6 +556,21 @@ |
522 | 557 | { |
523 | 558 | $request->set_read_file($opt['fileUpload']); |
524 | 559 | |
| 560 | + // Determine the length to read from the file |
| 561 | + $length = $request->read_stream_size; // The file size by default |
| 562 | + |
| 563 | + if (isset($headers['Content-Length'])) |
| 564 | + { |
| 565 | + $length = $headers['Content-Length']; |
| 566 | + } |
| 567 | + elseif (isset($opt['seekTo']) && isset($length)) |
| 568 | + { |
| 569 | + // Read from seekTo until EOF by default |
| 570 | + $length -= (integer) $opt['seekTo']; |
| 571 | + } |
| 572 | + |
| 573 | + $request->set_read_stream_size($length); |
| 574 | + |
525 | 575 | // Attempt to guess the correct mime-type |
526 | 576 | if ($headers['Content-Type'] === 'application/x-www-form-urlencoded') |
527 | 577 | { |
— | — | @@ -532,10 +582,16 @@ |
533 | 583 | } |
534 | 584 | |
535 | 585 | $headers['Content-Length'] = $request->read_stream_size; |
536 | | - $curlopts[CURLOPT_INFILESIZE] = $headers['Content-Length']; |
537 | 586 | $headers['Content-MD5'] = ''; |
538 | 587 | } |
539 | 588 | |
| 589 | + // Handle streaming file offsets |
| 590 | + if (isset($opt['seekTo'])) |
| 591 | + { |
| 592 | + // Pass the seek position to RequestCore |
| 593 | + $request->set_seek_position((integer) $opt['seekTo']); |
| 594 | + } |
| 595 | + |
540 | 596 | // Streaming downloads |
541 | 597 | if (isset($opt['fileDownload'])) |
542 | 598 | { |
— | — | @@ -564,23 +620,6 @@ |
565 | 621 | $curlopts[CURLOPT_VERBOSE] = true; |
566 | 622 | } |
567 | 623 | |
568 | | - // Handle streaming file offsets |
569 | | - if (isset($opt['seekTo'])) |
570 | | - { |
571 | | - // Pass the seek position to RequestCore |
572 | | - $request->set_seek_position((integer) $opt['seekTo']); |
573 | | - |
574 | | - $headers['Content-Length'] = (!is_resource($opt['fileUpload']) ? (filesize($opt['fileUpload']) - (integer) $opt['seekTo']) : -1); |
575 | | - $curlopts[CURLOPT_INFILESIZE] = $headers['Content-Length']; |
576 | | - } |
577 | | - |
578 | | - // Override the content length |
579 | | - if (isset($opt['length'])) |
580 | | - { |
581 | | - $headers['Content-Length'] = (integer) $opt['length']; |
582 | | - $curlopts[CURLOPT_INFILESIZE] = $headers['Content-Length']; |
583 | | - } |
584 | | - |
585 | 624 | // Set the curl options. |
586 | 625 | if (count($curlopts)) |
587 | 626 | { |
— | — | @@ -616,7 +655,7 @@ |
617 | 656 | { |
618 | 657 | unset($headers['Date']); |
619 | 658 | $headers['Content-Type'] = ''; |
620 | | - $headers['Expires'] = strtotime($opt['preauth']); |
| 659 | + $headers['Expires'] = is_int($opt['preauth']) ? $opt['preauth'] : strtotime($opt['preauth']); |
621 | 660 | } |
622 | 661 | |
623 | 662 | // Sort headers |
— | — | @@ -652,7 +691,7 @@ |
653 | 692 | |
654 | 693 | // Add the signable resource location |
655 | 694 | $string_to_sign .= ($this->resource_prefix ? $this->resource_prefix : ''); |
656 | | - $string_to_sign .= (($bucket === '' || $this->resource_prefix === '/' . $bucket) ? '' : ('/' . $bucket)) . $signable_resource; |
| 695 | + $string_to_sign .= (($bucket === '' || $this->resource_prefix === '/' . $bucket) ? '' : ('/' . $bucket)) . $signable_resource . urldecode($signable_query_string); |
657 | 696 | |
658 | 697 | // Hash the AWS secret key and generate a signature for the request. |
659 | 698 | $signature = base64_encode(hash_hmac('sha1', $string_to_sign, $this->secret_key, true)); |
— | — | @@ -661,7 +700,7 @@ |
662 | 701 | // If we're generating a URL, return certain data to the calling method. |
663 | 702 | if (isset($opt['preauth']) && (integer) $opt['preauth'] > 0) |
664 | 703 | { |
665 | | - return $this->request_url . (isset($opt['sub_resource']) ? '&' : '?') . 'AWSAccessKeyId=' . $this->key . '&Expires=' . $headers['Expires'] . '&Signature=' . rawurlencode($signature); |
| 704 | + return $this->request_url . $conjunction . 'AWSAccessKeyId=' . $this->key . '&Expires=' . $headers['Expires'] . '&Signature=' . rawurlencode($signature); |
666 | 705 | } |
667 | 706 | elseif (isset($opt['preauth'])) |
668 | 707 | { |
— | — | @@ -670,6 +709,13 @@ |
671 | 710 | |
672 | 711 | /*%******************************************************************************************%*/ |
673 | 712 | |
| 713 | + // If our changes were temporary, reset them. |
| 714 | + if ($this->temporary_prefix) |
| 715 | + { |
| 716 | + $this->temporary_prefix = false; |
| 717 | + $this->resource_prefix = null; |
| 718 | + } |
| 719 | + |
674 | 720 | // Manage the (newer) batch request API or the (older) returnCurlHandle setting. |
675 | 721 | if ($this->use_batch_flow) |
676 | 722 | { |
— | — | @@ -1199,6 +1245,7 @@ |
1200 | 1246 | } |
1201 | 1247 | else |
1202 | 1248 | { |
| 1249 | + $opt['body'] = ''; |
1203 | 1250 | $opt['headers']['x-amz-acl'] = $acl; |
1204 | 1251 | } |
1205 | 1252 | |
— | — | @@ -1214,7 +1261,7 @@ |
1215 | 1262 | * Method: create_object() |
1216 | 1263 | * Creates an Amazon S3 object. After an Amazon S3 bucket is created, objects can be stored in it. |
1217 | 1264 | * |
1218 | | - * Each object can hold up to 5 GB of data. When an object is stored in Amazon S3, the data is streamed |
| 1265 | + * Each standard object can hold up to 5 GB of data. When an object is stored in Amazon S3, the data is streamed |
1219 | 1266 | * to multiple storage servers in multiple data centers. This ensures the data remains available in the |
1220 | 1267 | * event of internal network or hardware failure. |
1221 | 1268 | * |
— | — | @@ -1228,11 +1275,13 @@ |
1229 | 1276 | * |
1230 | 1277 | * Keys for the $opt parameter: |
1231 | 1278 | * body - _string_ (Required; Conditional) The data to be stored in the object. Either this parameter or `fileUpload` must be specified. |
1232 | | - * fileUpload - _string_|_resource_ (Required; Conditional) The file system path for the local file to upload, or an open file resource. Either this parameter or `body` is required. |
| 1279 | + * fileUpload - _string_|_resource_ (Required; Conditional) The URL/path for the file to upload, or an open resource. Either this parameter or `body` is required. |
1233 | 1280 | * 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>. |
1234 | 1281 | * 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`. |
1235 | 1282 | * headers - _array_ (Optional) The standard HTTP headers to send along in the request. |
| 1283 | + * length - _integer_ (Optional) The size of the object in bytes. For more information, see [RFC 2616, section 14.13](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13). The value can also be passed to the `header` option as `Content-Length`. |
1236 | 1284 | * 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. |
| 1285 | + * seekTo - _integer_ (Optional) The starting position in bytes within the file/stream to upload from. |
1237 | 1286 | * 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>. |
1238 | 1287 | * 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. |
1239 | 1288 | * |
— | — | @@ -1250,6 +1299,13 @@ |
1251 | 1300 | $opt['verb'] = 'PUT'; |
1252 | 1301 | $opt['resource'] = $filename; |
1253 | 1302 | |
| 1303 | + // Handle content length. Can also be passed as an HTTP header. |
| 1304 | + if (isset($opt['length'])) |
| 1305 | + { |
| 1306 | + $opt['headers']['Content-Length'] = $opt['length']; |
| 1307 | + unset($opt['length']); |
| 1308 | + } |
| 1309 | + |
1254 | 1310 | // Handle content type. Can also be passed as an HTTP header. |
1255 | 1311 | if (isset($opt['contentType'])) |
1256 | 1312 | { |
— | — | @@ -1305,6 +1361,7 @@ |
1306 | 1362 | * 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. |
1307 | 1363 | * 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 `strtotime()`. |
1308 | 1364 | * 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. |
| 1365 | + * response - _array_ (Optional) Allows adjustments to specific response headers. Pass an associative array where each key is one of the following: `cache-control`, `content-disposition`, `content-encoding`, `content-language`, `content-type`, `expires`. The `expires` value should use `gmdate()` and be formatted with the `DATE_RFC2822` constant. |
1309 | 1366 | * versionId - _string_ (Optional) The version of the object to retrieve. Version IDs are returned in the `x-amz-version-id` header of any previous object-related request. |
1310 | 1367 | * 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. |
1311 | 1368 | * |
— | — | @@ -1337,6 +1394,16 @@ |
1338 | 1395 | $opt['headers']['Range'] = 'bytes=' . $opt['range']; |
1339 | 1396 | } |
1340 | 1397 | |
| 1398 | + // GET responses |
| 1399 | + if (isset($opt['response'])) |
| 1400 | + { |
| 1401 | + foreach ($opt['response'] as $key => $value) |
| 1402 | + { |
| 1403 | + $opt['response-' . $key] = $value; |
| 1404 | + unset($opt['response'][$key]); |
| 1405 | + } |
| 1406 | + } |
| 1407 | + |
1341 | 1408 | // Authenticate to S3 |
1342 | 1409 | return $this->authenticate($bucket, $opt); |
1343 | 1410 | } |
— | — | @@ -1505,6 +1572,7 @@ |
1506 | 1573 | // Add this to our request |
1507 | 1574 | $opt['verb'] = 'PUT'; |
1508 | 1575 | $opt['resource'] = $dest['filename']; |
| 1576 | + $opt['body'] = ''; |
1509 | 1577 | |
1510 | 1578 | // Handle copy source |
1511 | 1579 | if (isset($source['bucket']) && isset($source['filename'])) |
— | — | @@ -1738,6 +1806,7 @@ |
1739 | 1807 | } |
1740 | 1808 | else |
1741 | 1809 | { |
| 1810 | + $opt['body'] = ''; |
1742 | 1811 | $opt['headers']['x-amz-acl'] = $acl; |
1743 | 1812 | } |
1744 | 1813 | |
— | — | @@ -2631,6 +2700,7 @@ |
2632 | 2701 | * |
2633 | 2702 | * Keys for the $opt parameter: |
2634 | 2703 | * method - _string_ (Optional) The HTTP method to use for the request. Defaults to a value of `GET`. |
| 2704 | + * response - _array_ (Optional) Allows adjustments to specific response headers. Pass an associative array where each key is one of the following: `cache-control`, `content-disposition`, `content-encoding`, `content-language`, `content-type`, `expires`. The `expires` value should use `gmdate()` and be formatted with the `DATE_RFC2822` constant. |
2635 | 2705 | * torrent - _boolean_ (Optional) A value of `true` will return a URL to a torrent of the Amazon S3 object. A value of `false` will return a non-torrent URL. Defaults to `false`. |
2636 | 2706 | * 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. |
2637 | 2707 | * |
— | — | @@ -2654,6 +2724,16 @@ |
2655 | 2725 | unset($opt['torrent']); |
2656 | 2726 | } |
2657 | 2727 | |
| 2728 | + // GET responses |
| 2729 | + if (isset($opt['response'])) |
| 2730 | + { |
| 2731 | + foreach ($opt['response'] as $key => $value) |
| 2732 | + { |
| 2733 | + $opt['response-' . $key] = $value; |
| 2734 | + unset($opt['response'][$key]); |
| 2735 | + } |
| 2736 | + } |
| 2737 | + |
2658 | 2738 | // Authenticate to S3 |
2659 | 2739 | $current_ssl_setting = $this->use_ssl; |
2660 | 2740 | $this->use_ssl = false; |
— | — | @@ -3174,6 +3254,7 @@ |
3175 | 3255 | $opt['verb'] = 'POST'; |
3176 | 3256 | $opt['resource'] = $filename; |
3177 | 3257 | $opt['sub_resource'] = 'uploads'; |
| 3258 | + $opt['body'] = ''; |
3178 | 3259 | |
3179 | 3260 | // Handle content type. Can also be passed as an HTTP header. |
3180 | 3261 | if (isset($opt['contentType'])) |
— | — | @@ -3182,6 +3263,12 @@ |
3183 | 3264 | unset($opt['contentType']); |
3184 | 3265 | } |
3185 | 3266 | |
| 3267 | + // Set a default content type. |
| 3268 | + if (!isset($opt['headers']['Content-Type'])) |
| 3269 | + { |
| 3270 | + $opt['headers']['Content-Type'] = 'application/octet-stream'; |
| 3271 | + } |
| 3272 | + |
3186 | 3273 | // Handle Access Control Lists. Can also be passed as an HTTP header. |
3187 | 3274 | if (isset($opt['acl'])) |
3188 | 3275 | { |
— | — | @@ -3214,7 +3301,7 @@ |
3215 | 3302 | /** |
3216 | 3303 | * Method: upload_part() |
3217 | 3304 | * Uploads a single part of a multipart upload. The part size cannot be smaller than 5 MB |
3218 | | - * or larger than 5 GB. A multipart upload can have no more than 10,000 parts. |
| 3305 | + * or larger than 5 TB. A multipart upload can have no more than 10,000 parts. |
3219 | 3306 | * |
3220 | 3307 | * Amazon S3 charges for storage as well as requests to the service. Smaller part sizes (and more |
3221 | 3308 | * requests) allow for faster failures and better upload reliability. Larger part sizes (and fewer |
— | — | @@ -3230,13 +3317,13 @@ |
3231 | 3318 | * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
3232 | 3319 | * |
3233 | 3320 | * Keys for the $opt parameter: |
3234 | | - * fileUpload - _string_|_resource_ (Required) The file system path for the local file to upload or an open file resource. |
| 3321 | + * fileUpload - _string_|_resource_ (Required) The URL/path for the file to upload or an open resource. |
3235 | 3322 | * partNumber - _integer_ (Required) The part number order of the multipart upload. |
3236 | 3323 | * 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](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.20). The value can also be passed to the `header` option as `Expect`. [Allowed values: `100-continue`] |
3237 | 3324 | * headers - _array_ (Optional) The standard HTTP headers to send along in the request. |
3238 | 3325 | * length - _integer_ (Optional) The size of the part in bytes. For more information, see [RFC 2616, section 14.13](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13). The value can also be passed to the `header` option as `Content-Length`. |
3239 | 3326 | * 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](http://www.ietf.org/rfc/rfc1864.txt). The value can also be passed to the `header` option as `Content-MD5`. |
3240 | | - * seekTo - _integer_ (Optional) The starting position in bytes for the piece of the file to upload. |
| 3327 | + * seekTo - _integer_ (Optional) The starting position in bytes for the piece of the file/stream to upload. |
3241 | 3328 | * 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. |
3242 | 3329 | * |
3243 | 3330 | * Returns: |
— | — | @@ -3263,6 +3350,13 @@ |
3264 | 3351 | unset($opt['expect']); |
3265 | 3352 | } |
3266 | 3353 | |
| 3354 | + // Handle content length. Can also be passed as an HTTP header. |
| 3355 | + if (isset($opt['length'])) |
| 3356 | + { |
| 3357 | + $opt['headers']['Content-Length'] = $opt['length']; |
| 3358 | + unset($opt['length']); |
| 3359 | + } |
| 3360 | + |
3267 | 3361 | // Handle content md5. Can also be passed as an HTTP header. |
3268 | 3362 | if (isset($opt['md5'])) |
3269 | 3363 | { |
— | — | @@ -3390,12 +3484,12 @@ |
3391 | 3485 | if (is_string($parts)) |
3392 | 3486 | { |
3393 | 3487 | // Assume it's the intended XML. |
3394 | | - $opt['body'] = $xml; |
| 3488 | + $opt['body'] = $parts; |
3395 | 3489 | } |
3396 | 3490 | elseif ($parts instanceof SimpleXMLElement) |
3397 | 3491 | { |
3398 | 3492 | // Assume it's a SimpleXMLElement object representing the XML. |
3399 | | - $opt['body'] = $xml->asXML(); |
| 3493 | + $opt['body'] = $parts->asXML(); |
3400 | 3494 | } |
3401 | 3495 | elseif (is_array($parts) || $parts instanceof CFResponse) |
3402 | 3496 | { |
— | — | @@ -3476,7 +3570,7 @@ |
3477 | 3571 | * Creates an Amazon S3 object using the multipart upload APIs. It is analogous to <create_object()>. |
3478 | 3572 | * |
3479 | 3573 | * While each individual part of a multipart upload can hold up to 5 GB of data, this method limits the |
3480 | | - * part size to a maximum of 500 MB. The combined size of all parts can not exceed 5 GB of data. When an |
| 3574 | + * part size to a maximum of 500 MB. The combined size of all parts can not exceed 5 TB of data. When an |
3481 | 3575 | * object is stored in Amazon S3, the data is streamed to multiple storage servers in multiple data |
3482 | 3576 | * centers. This ensures the data remains available in the event of internal network or hardware failure. |
3483 | 3577 | * |
— | — | @@ -3493,12 +3587,15 @@ |
3494 | 3588 | * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
3495 | 3589 | * |
3496 | 3590 | * Keys for the $opt parameter: |
3497 | | - * fileUpload - _string_|_resource_ (Required) The file system path for the local file to upload or an open file resource. |
| 3591 | + * fileUpload - _string_|_resource_ (Required) The URL/path for the file to upload, or an open resource. |
3498 | 3592 | * 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>. |
3499 | 3593 | * contentType - _string_ (Optional) The type of content that is being sent in the body. The default value is `application/octet-stream`. |
3500 | 3594 | * headers - _array_ (Optional) The standard HTTP headers to send along in the request. |
| 3595 | + * length - _integer_ (Optional) The size of the object in bytes. For more information, see [RFC 2616, section 14.13](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13). The value can also be passed to the `header` option as `Content-Length`. |
| 3596 | + * limit - _integer_ (Optional) The maximum number of concurrent uploads done by cURL. Gets passed to `CFBatchRequest`. |
3501 | 3597 | * 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. |
3502 | 3598 | * partSize - _integer_ (Optional) The size of an individual part. The size may not be smaller than 5 MB or larger than 500 MB. The default value is 50 MB. |
| 3599 | + * seekTo - _integer_ (Optional) The starting position in bytes for the first piece of the file/stream to upload. |
3503 | 3600 | * 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>. |
3504 | 3601 | * uploadId - _string_ (Optional) An upload ID identifying an existing multipart upload to use. If this option is not set, one will be created automatically. |
3505 | 3602 | * 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. |
— | — | @@ -3511,14 +3608,64 @@ |
3512 | 3609 | */ |
3513 | 3610 | public function create_mpu_object($bucket, $filename, $opt = null) |
3514 | 3611 | { |
3515 | | - // Don't timeout! |
3516 | | - set_time_limit(0); |
| 3612 | + if ($this->use_batch_flow) |
| 3613 | + { |
| 3614 | + throw new S3_Exception(__FUNCTION__ . '() cannot be batch requested'); |
| 3615 | + } |
3517 | 3616 | |
| 3617 | + if (!$opt) $opt = array(); |
| 3618 | + |
| 3619 | + // Handle content length. Can also be passed as an HTTP header. |
| 3620 | + if (isset($opt['length'])) |
| 3621 | + { |
| 3622 | + $opt['headers']['Content-Length'] = $opt['length']; |
| 3623 | + unset($opt['length']); |
| 3624 | + } |
| 3625 | + |
3518 | 3626 | if (!isset($opt['fileUpload'])) |
3519 | 3627 | { |
3520 | 3628 | throw new S3_Exception('The `fileUpload` option is required in ' . __FUNCTION__ . '().'); |
3521 | 3629 | } |
| 3630 | + elseif (is_resource($opt['fileUpload'])) |
| 3631 | + { |
| 3632 | + $opt['limit'] = 1; // We can only read from this one resource. |
| 3633 | + $upload_position = isset($opt['seekTo']) ? (integer) $opt['seekTo'] : ftell($opt['fileUpload']); |
| 3634 | + $upload_filesize = isset($opt['headers']['Content-Length']) ? (integer) $opt['headers']['Content-Length'] : null; |
3522 | 3635 | |
| 3636 | + if (!isset($upload_filesize) && $upload_position !== false) |
| 3637 | + { |
| 3638 | + $stats = fstat($opt['fileUpload']); |
| 3639 | + |
| 3640 | + if ($stats && $stats['size'] >= 0) |
| 3641 | + { |
| 3642 | + $upload_filesize = $stats['size'] - $upload_position; |
| 3643 | + } |
| 3644 | + } |
| 3645 | + } |
| 3646 | + else |
| 3647 | + { |
| 3648 | + $upload_position = isset($opt['seekTo']) ? (integer) $opt['seekTo'] : 0; |
| 3649 | + |
| 3650 | + if (isset($opt['headers']['Content-Length'])) |
| 3651 | + { |
| 3652 | + $upload_filesize = (integer) $opt['headers']['Content-Length']; |
| 3653 | + } |
| 3654 | + else |
| 3655 | + { |
| 3656 | + $upload_filesize = filesize($opt['fileUpload']); |
| 3657 | + |
| 3658 | + if ($upload_filesize !== false) |
| 3659 | + { |
| 3660 | + $upload_filesize -= $upload_position; |
| 3661 | + } |
| 3662 | + } |
| 3663 | + } |
| 3664 | + |
| 3665 | + if ($upload_position === false || !isset($upload_filesize) || $upload_filesize === false || $upload_filesize < 0) |
| 3666 | + { |
| 3667 | + throw new S3_Exception('The size of `fileUpload` cannot be determined in ' . __FUNCTION__ . '().'); |
| 3668 | + } |
| 3669 | + |
3523 | 3670 | // Handle part size |
3524 | 3671 | if (isset($opt['partSize'])) |
3525 | 3672 | { |
— | — | @@ -3538,10 +3685,8 @@ |
3539 | 3686 | $opt['partSize'] = 52428800; // 50 MB |
3540 | 3687 | } |
3541 | 3688 | |
3542 | | - $upload_filesize = filesize($opt['fileUpload']); |
3543 | | - |
3544 | 3689 | // If the upload size is smaller than the piece size, failover to create_object(). |
3545 | | - if ($upload_filesize < $opt['partSize']) |
| 3690 | + if ($upload_filesize < $opt['partSize'] && !isset($opt['uploadId'])) |
3546 | 3691 | { |
3547 | 3692 | return $this->create_object($bucket, $filename, $opt); |
3548 | 3693 | } |
— | — | @@ -3566,7 +3711,7 @@ |
3567 | 3712 | $upload = $this->initiate_multipart_upload($bucket, $filename, $_opt); |
3568 | 3713 | if (!$upload->isOK()) |
3569 | 3714 | { |
3570 | | - return false; |
| 3715 | + return $upload; |
3571 | 3716 | } |
3572 | 3717 | |
3573 | 3718 | // Fetch the UploadId |
— | — | @@ -3577,14 +3722,14 @@ |
3578 | 3723 | $pieces = $this->get_multipart_counts($upload_filesize, (integer) $opt['partSize']); |
3579 | 3724 | |
3580 | 3725 | // Queue batch requests |
3581 | | - $batch = new CFBatchRequest(); |
| 3726 | + $batch = new CFBatchRequest(isset($opt['limit']) ? (integer) $opt['limit'] : null); |
3582 | 3727 | foreach ($pieces as $i => $piece) |
3583 | 3728 | { |
3584 | 3729 | $this->batch($batch)->upload_part($bucket, $filename, $upload_id, array( |
3585 | 3730 | 'expect' => '100-continue', |
3586 | 3731 | 'fileUpload' => $opt['fileUpload'], |
3587 | 3732 | 'partNumber' => ($i + 1), |
3588 | | - 'seekTo' => (integer) $piece['seekTo'], |
| 3733 | + 'seekTo' => $upload_position + (integer) $piece['seekTo'], |
3589 | 3734 | 'length' => (integer) $piece['length'], |
3590 | 3735 | )); |
3591 | 3736 | } |
— | — | @@ -3593,7 +3738,7 @@ |
3594 | 3739 | $batch_responses = $this->batch($batch)->send(); |
3595 | 3740 | if (!$batch_responses->areOK()) |
3596 | 3741 | { |
3597 | | - return false; |
| 3742 | + return $batch_responses; |
3598 | 3743 | } |
3599 | 3744 | |
3600 | 3745 | // Compose completion XML |
— | — | @@ -3606,7 +3751,69 @@ |
3607 | 3752 | return $this->complete_multipart_upload($bucket, $filename, $upload_id, $parts); |
3608 | 3753 | } |
3609 | 3754 | |
| 3755 | + /** |
| 3756 | + * Method: abort_multipart_uploads_by_date() |
| 3757 | + * Aborts all multipart uploads initiated before the specified date. This operation cannot be reversed. |
| 3758 | + * |
| 3759 | + * Access: |
| 3760 | + * public |
| 3761 | + * |
| 3762 | + * Parameters: |
| 3763 | + * $bucket - _string_ (Required) The name of the bucket to use. |
| 3764 | + * $when - _string_|_integer_ (Optional) The time and date to use for comparison. Accepts any value that `strtotime()` understands. |
| 3765 | + * |
| 3766 | + * Returns: |
| 3767 | + * _CFArray_ A <CFArray> containing a series of 0 or more <CFResponse> objects, containing a parsed HTTP response. |
| 3768 | + */ |
| 3769 | + public function abort_multipart_uploads_by_date($bucket, $when = null) |
| 3770 | + { |
| 3771 | + if ($this->use_batch_flow) |
| 3772 | + { |
| 3773 | + throw new S3_Exception(__FUNCTION__ . '() cannot be batch requested'); |
| 3774 | + } |
3610 | 3775 | |
| 3776 | + $when = $when ? $when : time(); |
| 3777 | + $handles = array(); |
| 3778 | + $data = $this->list_multipart_uploads($bucket)->body; |
| 3779 | + $when = is_int($when) ? $when : strtotime($when); |
| 3780 | + |
| 3781 | + if (!($data instanceof CFSimpleXML)) |
| 3782 | + { |
| 3783 | + return false; |
| 3784 | + } |
| 3785 | + |
| 3786 | + $list = $data->query('descendant-or-self::Upload/Initiated'); |
| 3787 | + |
| 3788 | + foreach ($list as $node) |
| 3789 | + { |
| 3790 | + if (strtotime((string) $node) < $when) |
| 3791 | + { |
| 3792 | + $q = new CFBatchRequest(); |
| 3793 | + $parent = $node->parent(); |
| 3794 | + |
| 3795 | + $upload_id = $parent |
| 3796 | + ->query('descendant-or-self::UploadId') |
| 3797 | + ->first() |
| 3798 | + ->to_string(); |
| 3799 | + |
| 3800 | + $filename = $parent |
| 3801 | + ->query('descendant-or-self::Key') |
| 3802 | + ->first() |
| 3803 | + ->to_string(); |
| 3804 | + |
| 3805 | + $handles[] = $this->abort_multipart_upload($bucket, $filename, $upload_id, array( |
| 3806 | + 'returnCurlHandle' => true |
| 3807 | + )); |
| 3808 | + } |
| 3809 | + } |
| 3810 | + |
| 3811 | + $http = new CFRequest(); |
| 3812 | + $responses = $http->send_multi_request($handles); |
| 3813 | + |
| 3814 | + return new CFArray($responses); |
| 3815 | + } |
| 3816 | + |
| 3817 | + |
3611 | 3818 | /*%******************************************************************************************%*/ |
3612 | 3819 | // MISCELLANEOUS |
3613 | 3820 | |
Index: trunk/extensions/OpenStackManager/aws-sdk/services/iam.class.php |
— | — | @@ -1201,4 +1201,3 @@ |
1202 | 1202 | return $this->authenticate('DeleteGroup', $opt, $this->hostname); |
1203 | 1203 | } |
1204 | 1204 | } |
1205 | | - |
Index: trunk/extensions/OpenStackManager/aws-sdk/services/sqs.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
— | — | @@ -16,6 +16,7 @@ |
17 | 17 | |
18 | 18 | /** |
19 | 19 | * File: AmazonSQS |
| 20 | + * * |
20 | 21 | * Amazon Simple Queue Service (Amazon SQS) offers a reliable, highly scalable, hosted queue for |
21 | 22 | * storing messages as they travel between computers. By using Amazon SQS, developers can simply move |
22 | 23 | * data between distributed components of their applications that perform different tasks, without |
— | — | @@ -31,7 +32,7 @@ |
32 | 33 | * Visit [http://aws.amazon.com/sqs/](http://aws.amazon.com/sqs/) for more information. |
33 | 34 | * |
34 | 35 | * Version: |
35 | | - * Fri Dec 03 16:28:26 PST 2010 |
| 36 | + * Mon Jan 24 15:00:28 PST 2011 |
36 | 37 | * |
37 | 38 | * License and Copyright: |
38 | 39 | * See the included NOTICE.md file for complete information. |
Index: trunk/extensions/OpenStackManager/aws-sdk/services/rds.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | * Amazon Web Services, there are no up-front investments, and you pay only for the resources you use. |
31 | 31 | * |
32 | 32 | * Version: |
33 | | - * Fri Dec 03 16:26:47 PST 2010 |
| 33 | + * Mon Jan 24 14:57:43 PST 2011 |
34 | 34 | * |
35 | 35 | * License and Copyright: |
36 | 36 | * See the included NOTICE.md file for complete information. |
Index: trunk/extensions/OpenStackManager/aws-sdk/services/sdb.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
— | — | @@ -16,9 +16,10 @@ |
17 | 17 | |
18 | 18 | /** |
19 | 19 | * File: AmazonSDB |
20 | | - * Amazon SimpleDB is a web service providing the core database functions of data indexing and querying |
21 | | - * in the cloud. By offloading the time and effort associated with building and operating a web-scale |
22 | | - * database, SimpleDB provides developers the freedom to focus on application development. |
| 20 | + * * |
| 21 | + * Amazon SimpleDB is a web service providing the core database functions of data indexing and |
| 22 | + * querying in the cloud. By offloading the time and effort associated with building and operating a |
| 23 | + * web-scale database, SimpleDB provides developers the freedom to focus on application development. |
23 | 24 | * |
24 | 25 | * A traditional, clustered relational database requires a sizable upfront capital outlay, is complex |
25 | 26 | * to design, and often requires extensive and repetitive database administration. Amazon SimpleDB is |
— | — | @@ -30,7 +31,7 @@ |
31 | 32 | * Visit [http://aws.amazon.com/simpledb/](http://aws.amazon.com/simpledb/) for more information. |
32 | 33 | * |
33 | 34 | * Version: |
34 | | - * Fri Dec 03 16:27:22 PST 2010 |
| 35 | + * Mon Jan 24 14:58:45 PST 2011 |
35 | 36 | * |
36 | 37 | * License and Copyright: |
37 | 38 | * See the included NOTICE.md file for complete information. |
Index: trunk/extensions/OpenStackManager/aws-sdk/services/ec2.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
— | — | @@ -30,7 +30,7 @@ |
31 | 31 | * Visit [http://aws.amazon.com/ec2/](http://aws.amazon.com/ec2/) for more information. |
32 | 32 | * |
33 | 33 | * Version: |
34 | | - * Fri Dec 03 16:23:55 PST 2010 |
| 34 | + * Mon Jan 24 14:52:20 PST 2011 |
35 | 35 | * |
36 | 36 | * License and Copyright: |
37 | 37 | * See the included NOTICE.md file for complete information. |
Index: trunk/extensions/OpenStackManager/aws-sdk/services/elasticbeanstalk.class.php |
— | — | @@ -0,0 +1,1152 @@ |
| 2 | +<?php |
| 3 | +/* |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 5 | + * |
| 6 | + * Licensed under the Apache License, Version 2.0 (the "License"). |
| 7 | + * You may not use this file except in compliance with the License. |
| 8 | + * A copy of the License is located at |
| 9 | + * |
| 10 | + * http://aws.amazon.com/apache2.0 |
| 11 | + * |
| 12 | + * or in the "license" file accompanying this file. This file is distributed |
| 13 | + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 14 | + * express or implied. See the License for the specific language governing |
| 15 | + * permissions and limitations under the License. |
| 16 | + */ |
| 17 | + |
| 18 | +/** |
| 19 | + * File: AmazonElasticBeanstalk |
| 20 | + * * |
| 21 | + * This is the Amazon Elastic Beanstalk API Reference. This guide provides detailed information about |
| 22 | + * Amazon Elastic Beanstalk actions, data types, parameters, and errors. |
| 23 | + * |
| 24 | + * Amazon Elastic Beanstalk is a tool that makes it easy for you to create, deploy, and manage |
| 25 | + * scalable, fault-tolerant applications running on Amazon Web Services cloud resources. |
| 26 | + * |
| 27 | + * For more information about this product, go to the [Amazon Elastic |
| 28 | + * Beanstalk](http://aws.amazon.com/elasticbeanstalk/) details page. For specific information about |
| 29 | + * setting up signatures and authorization through the API, go to the [Amazon Elastic Beanstalk User |
| 30 | + * Guide](http://docs.amazonwebservices.com/elasticbeanstalk/latest/ug/). |
| 31 | + * |
| 32 | + * Version: |
| 33 | + * Mon Jan 24 14:51:25 PST 2011 |
| 34 | + * |
| 35 | + * License and Copyright: |
| 36 | + * See the included NOTICE.md file for complete information. |
| 37 | + * |
| 38 | + * See Also: |
| 39 | + * [AWS Elastic Beanstalk](http://aws.amazon.com/elasticbeanstalk/) |
| 40 | + * [AWS Elastic Beanstalk documentation](http://aws.amazon.com/documentation/elasticbeanstalk/) |
| 41 | + */ |
| 42 | + |
| 43 | + |
| 44 | +/*%******************************************************************************************%*/ |
| 45 | +// EXCEPTIONS |
| 46 | + |
| 47 | +/** |
| 48 | + * Exception: ElasticBeanstalk_Exception |
| 49 | + * Default Elastic Beanstalk Exception. |
| 50 | + */ |
| 51 | +class ElasticBeanstalk_Exception extends Exception {} |
| 52 | + |
| 53 | + |
| 54 | +/*%******************************************************************************************%*/ |
| 55 | +// MAIN CLASS |
| 56 | + |
| 57 | +/** |
| 58 | + * Class: AmazonElasticBeanstalk |
| 59 | + * Container for all service-related methods. |
| 60 | + */ |
| 61 | +class AmazonElasticBeanstalk extends CFRuntime |
| 62 | +{ |
| 63 | + |
| 64 | + /*%******************************************************************************************%*/ |
| 65 | + // CLASS CONSTANTS |
| 66 | + |
| 67 | + /** |
| 68 | + * Constant: DEFAULT_URL |
| 69 | + * Specify the default queue URL. |
| 70 | + */ |
| 71 | + const DEFAULT_URL = 'elasticbeanstalk.us-east-1.amazonaws.com'; |
| 72 | + |
| 73 | + /** |
| 74 | + * Constant: REGION_US_E1 |
| 75 | + * Specify the queue URL for the US-East (Northern Virginia) Region. |
| 76 | + */ |
| 77 | + const REGION_US_E1 = 'us-east-1'; |
| 78 | + |
| 79 | + |
| 80 | + /*%******************************************************************************************%*/ |
| 81 | + // SETTERS |
| 82 | + |
| 83 | + /** |
| 84 | + * Method: set_region() |
| 85 | + * This allows you to explicitly sets the region for the service to use. |
| 86 | + * |
| 87 | + * Access: |
| 88 | + * public |
| 89 | + * |
| 90 | + * Parameters: |
| 91 | + * $region - _string_ (Required) The region to explicitly set. Available options are <REGION_US_E1>. |
| 92 | + * |
| 93 | + * Returns: |
| 94 | + * `$this` |
| 95 | + */ |
| 96 | + public function set_region($region) |
| 97 | + { |
| 98 | + $this->set_hostname('http://elasticbeanstalk.'. $region .'.amazonaws.com'); |
| 99 | + return $this; |
| 100 | + } |
| 101 | + |
| 102 | + |
| 103 | + /*%******************************************************************************************%*/ |
| 104 | + // CONSTRUCTOR |
| 105 | + |
| 106 | + /** |
| 107 | + * Method: __construct() |
| 108 | + * Constructs a new instance of <AmazonClearBox>. |
| 109 | + * |
| 110 | + * Access: |
| 111 | + * public |
| 112 | + * |
| 113 | + * Parameters: |
| 114 | + * $key - _string_ (Optional) Your Amazon API Key. If blank, it will look for the <AWS_KEY> constant. |
| 115 | + * $secret_key - _string_ (Optional) Your Amazon API Secret Key. If blank, it will look for the <AWS_SECRET_KEY> constant. |
| 116 | + * |
| 117 | + * Returns: |
| 118 | + * _boolean_ false if no valid values are set, otherwise true. |
| 119 | + */ |
| 120 | + public function __construct($key = null, $secret_key = null) |
| 121 | + { |
| 122 | + $this->api_version = '2010-12-01'; |
| 123 | + $this->hostname = self::DEFAULT_URL; |
| 124 | + |
| 125 | + if (!$key && !defined('AWS_KEY')) |
| 126 | + { |
| 127 | + throw new Beanstalk_Exception('No account key was passed into the constructor, nor was it set in the AWS_KEY constant.'); |
| 128 | + } |
| 129 | + |
| 130 | + if (!$secret_key && !defined('AWS_SECRET_KEY')) |
| 131 | + { |
| 132 | + throw new Beanstalk_Exception('No account secret was passed into the constructor, nor was it set in the AWS_SECRET_KEY constant.'); |
| 133 | + } |
| 134 | + |
| 135 | + return parent::__construct($key, $secret_key); |
| 136 | + } |
| 137 | + |
| 138 | + |
| 139 | + /*%******************************************************************************************%*/ |
| 140 | + // SERVICE METHODS |
| 141 | + |
| 142 | + /** |
| 143 | + * Method: check_dns_availability() |
| 144 | + * Checks if the specified CNAME is available. |
| 145 | + * |
| 146 | + * Access: |
| 147 | + * public |
| 148 | + * |
| 149 | + * Parameters: |
| 150 | + * $cname_prefix - _string_ (Required) The prefix used when this CNAME is reserved. |
| 151 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 152 | + * |
| 153 | + * Keys for the $opt parameter: |
| 154 | + * 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. |
| 155 | + * |
| 156 | + * Returns: |
| 157 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 158 | + */ |
| 159 | + public function check_dns_availability($cname_prefix, $opt = null) |
| 160 | + { |
| 161 | + if (!$opt) $opt = array(); |
| 162 | + $opt['CNAMEPrefix'] = $cname_prefix; |
| 163 | + |
| 164 | + return $this->authenticate('CheckDNSAvailability', $opt, $this->hostname); |
| 165 | + } |
| 166 | + |
| 167 | + /** |
| 168 | + * Method: describe_configuration_options() |
| 169 | + * Describes the configuration options that are used in a particular configuration template or |
| 170 | + * environment, or that a specified solution stack defines. The description includes the values the |
| 171 | + * options, their default values, and an indication of the required action on a running environment if |
| 172 | + * an option value is changed. |
| 173 | + * |
| 174 | + * Access: |
| 175 | + * public |
| 176 | + * |
| 177 | + * Parameters: |
| 178 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 179 | + * |
| 180 | + * Keys for the $opt parameter: |
| 181 | + * ApplicationName - _string_ (Optional) The name of the application associated with the configuration template or environment. Only needed if you want to describe the configuration options associated with either the configuration template or environment. |
| 182 | + * TemplateName - _string_ (Optional) The name of the configuration template whose configuration options you want to describe. |
| 183 | + * EnvironmentName - _string_ (Optional) The name of the environment whose configuration options you want to describe. |
| 184 | + * SolutionStackName - _string_ (Optional) The name of the solution stack whose configuration options you want to describe. |
| 185 | + * Options - _ComplexList_ (Optional) If specified, restricts the descriptions to only the specified options. A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `Options` subtype (documented next), or by passing an associative array with the following `Options`-prefixed entries as keys. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. See below for a list and a usage example. |
| 186 | + * Options.x.Namespace - _string_ (Optional) A unique namespace identifying the option's associated AWS resource. |
| 187 | + * Options.x.OptionName - _string_ (Optional) The name of the configuration option. |
| 188 | + * 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. |
| 189 | + * |
| 190 | + * Returns: |
| 191 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 192 | + */ |
| 193 | + public function describe_configuration_options($opt = null) |
| 194 | + { |
| 195 | + if (!$opt) $opt = array(); |
| 196 | + |
| 197 | + // Optional parameter |
| 198 | + if (isset($opt['Options'])) |
| 199 | + { |
| 200 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 201 | + 'Options' => $opt['Options'] |
| 202 | + ), 'member')); |
| 203 | + unset($opt['Options']); |
| 204 | + } |
| 205 | + |
| 206 | + return $this->authenticate('DescribeConfigurationOptions', $opt, $this->hostname); |
| 207 | + } |
| 208 | + |
| 209 | + /** |
| 210 | + * Method: delete_configuration_template() |
| 211 | + * Deletes the specified configuration template. When you launch an environment using a configuration |
| 212 | + * template, the environment gets a copy of the template. You can delete or modify the environment's |
| 213 | + * copy of the template without affecting the running environment. |
| 214 | + * |
| 215 | + * Access: |
| 216 | + * public |
| 217 | + * |
| 218 | + * Parameters: |
| 219 | + * $application_name - _string_ (Required) The name of the application to delete the configuration template from. |
| 220 | + * $template_name - _string_ (Required) The name of the configuration template to delete. |
| 221 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 222 | + * |
| 223 | + * Keys for the $opt parameter: |
| 224 | + * 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. |
| 225 | + * |
| 226 | + * Returns: |
| 227 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 228 | + */ |
| 229 | + public function delete_configuration_template($application_name, $template_name, $opt = null) |
| 230 | + { |
| 231 | + if (!$opt) $opt = array(); |
| 232 | + $opt['ApplicationName'] = $application_name; |
| 233 | + $opt['TemplateName'] = $template_name; |
| 234 | + |
| 235 | + return $this->authenticate('DeleteConfigurationTemplate', $opt, $this->hostname); |
| 236 | + } |
| 237 | + |
| 238 | + /** |
| 239 | + * Method: create_environment() |
| 240 | + * Launches an environment for the specified application using the specified configuration. |
| 241 | + * |
| 242 | + * Access: |
| 243 | + * public |
| 244 | + * |
| 245 | + * Parameters: |
| 246 | + * $application_name - _string_ (Required) The name of the application that contains the version to be deployed. If no application is found with this name, returns an `InvalidParameterValue` error. |
| 247 | + * $environment_name - _string_ (Required) A unique name for the deployment environment. Used in the application URL. Constraint: Must be from 4 to 23 characters in length. The name can contain only letters, numbers, and hyphens. It cannot start or end with a hyphen. Constraint: This name must be unique in your account. If the specified name already exists, Amazon Elastic Beanstalk returns an `InvalidParameterValue` error. Default: If the CNAME parameter is not specified, the environment name becomes part of the CNAME, and therefore part of the visible URL for your application. |
| 248 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 249 | + * |
| 250 | + * Keys for the $opt parameter: |
| 251 | + * VersionLabel - _string_ (Optional) The name of the application version to deploy. If the specified application has no associated application versions, Amazon Elastic Beanstalk returns an `InvalidParameterValue` error. Default: If not specified, Amazon Elastic Beanstalk attempts to launch the most recently created application version. |
| 252 | + * TemplateName - _string_ (Optional) The name of the configuration template to use in deployment. If no configuration template is found with this name, Amazon Elastic Beanstalk returns an `InvalidParameterValue` error. This parameter is optional. You must specify either this parameter or a `SolutionStackName`, but not both. If you specify both, Amazon Elastic Beanstalk returns an `InvalidParameterCombination` error. If you do not specify either, Amazon Elastic Beanstalk returns a `MissingRequiredParameter` error. |
| 253 | + * SolutionStackName - _string_ (Optional) This is an alternative to specifying a configuration name. If specified, Amazon Elastic Beanstalk sets the configuration values to the default values associated with the specified solution stack. This parameter is optional. You must specify either this or a `TemplateName`, but not both. If you specify both, Amazon Elastic Beanstalk returns an `InvalidParameterCombination` error. If you do not specify either, Amazon Elastic Beanstalk returns a `MissingRequiredParameter` error. |
| 254 | + * CNAMEPrefix - _string_ (Optional) If specified, the environment attempts to use this value as the prefix for the CNAME. If not specified, the environment uses the environment name. |
| 255 | + * Description - _string_ (Optional) Describes this environment. |
| 256 | + * OptionSettings - _ComplexList_ (Optional) If specified, Amazon Elastic Beanstalk sets the specified configuration options to the requested value in the configuration set for the new environment. These override the values obtained from the solution stack or the configuration template. A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `OptionSettings` subtype (documented next), or by passing an associative array with the following `OptionSettings`-prefixed entries as keys. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. See below for a list and a usage example. |
| 257 | + * OptionSettings.x.Namespace - _string_ (Optional) A unique namespace identifying the option's associated AWS resource. |
| 258 | + * OptionSettings.x.OptionName - _string_ (Optional) The name of the configuration option. |
| 259 | + * OptionSettings.x.Value - _string_ (Optional) The current value for the configuration option. |
| 260 | + * OptionsToRemove - _ComplexList_ (Optional) A list of custom user-defined configuration options to remove from the configuration set for this new environment. A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `OptionsToRemove` subtype (documented next), or by passing an associative array with the following `OptionsToRemove`-prefixed entries as keys. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. See below for a list and a usage example. |
| 261 | + * OptionsToRemove.x.Namespace - _string_ (Optional) A unique namespace identifying the option's associated AWS resource. |
| 262 | + * OptionsToRemove.x.OptionName - _string_ (Optional) The name of the configuration option. |
| 263 | + * 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. |
| 264 | + * |
| 265 | + * Returns: |
| 266 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 267 | + */ |
| 268 | + public function create_environment($application_name, $environment_name, $opt = null) |
| 269 | + { |
| 270 | + if (!$opt) $opt = array(); |
| 271 | + $opt['ApplicationName'] = $application_name; |
| 272 | + $opt['EnvironmentName'] = $environment_name; |
| 273 | + |
| 274 | + // Optional parameter |
| 275 | + if (isset($opt['OptionSettings'])) |
| 276 | + { |
| 277 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 278 | + 'OptionSettings' => $opt['OptionSettings'] |
| 279 | + ), 'member')); |
| 280 | + unset($opt['OptionSettings']); |
| 281 | + } |
| 282 | + |
| 283 | + // Optional parameter |
| 284 | + if (isset($opt['OptionsToRemove'])) |
| 285 | + { |
| 286 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 287 | + 'OptionsToRemove' => $opt['OptionsToRemove'] |
| 288 | + ), 'member')); |
| 289 | + unset($opt['OptionsToRemove']); |
| 290 | + } |
| 291 | + |
| 292 | + return $this->authenticate('CreateEnvironment', $opt, $this->hostname); |
| 293 | + } |
| 294 | + |
| 295 | + /** |
| 296 | + * Method: create_storage_location() |
| 297 | + * Creates the Amazon S3 storage location for the account. This location is used to store user log |
| 298 | + * files. |
| 299 | + * |
| 300 | + * Access: |
| 301 | + * public |
| 302 | + * |
| 303 | + * Parameters: |
| 304 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 305 | + * |
| 306 | + * Keys for the $opt parameter: |
| 307 | + * 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. |
| 308 | + * |
| 309 | + * Returns: |
| 310 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 311 | + */ |
| 312 | + public function create_storage_location($opt = null) |
| 313 | + { |
| 314 | + if (!$opt) $opt = array(); |
| 315 | + |
| 316 | + return $this->authenticate('CreateStorageLocation', $opt, $this->hostname); |
| 317 | + } |
| 318 | + |
| 319 | + /** |
| 320 | + * Method: request_environment_info() |
| 321 | + * Initiates a request to compile the specified type of information of the deployed environment. |
| 322 | + * |
| 323 | + * Setting the `InfoType` to `tail` compiles the last lines from the application server log files of |
| 324 | + * every Amazon EC2 instance in your environment. Use RetrieveEnvironmentInfo to access the compiled |
| 325 | + * information. |
| 326 | + * |
| 327 | + * Related Topics |
| 328 | + * |
| 329 | + * - RetrieveEnvironmentInfo |
| 330 | + * |
| 331 | + * Access: |
| 332 | + * public |
| 333 | + * |
| 334 | + * Parameters: |
| 335 | + * $info_type - _string_ (Required) The type of information to request. [Allowed values: `tail`] |
| 336 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 337 | + * |
| 338 | + * Keys for the $opt parameter: |
| 339 | + * EnvironmentId - _string_ (Optional) The ID of the environment of the requested data. If no such environment is found, returns an `InvalidParameterValue` error. |
| 340 | + * EnvironmentName - _string_ (Optional) The name of the environment of the requested data. If no such environment is found, returns an `InvalidParameterValue` error. |
| 341 | + * 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. |
| 342 | + * |
| 343 | + * Returns: |
| 344 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 345 | + */ |
| 346 | + public function request_environment_info($info_type, $opt = null) |
| 347 | + { |
| 348 | + if (!$opt) $opt = array(); |
| 349 | + $opt['InfoType'] = $info_type; |
| 350 | + |
| 351 | + return $this->authenticate('RequestEnvironmentInfo', $opt, $this->hostname); |
| 352 | + } |
| 353 | + |
| 354 | + /** |
| 355 | + * Method: create_application_version() |
| 356 | + * Creates an application version for the specified application. Once you create an application version |
| 357 | + * with a specified Amazon S3 bucket and key location, you cannot change that Amazon S3 location. If |
| 358 | + * you change the Amazon S3 location, you receive an exception when you attempt to launch an |
| 359 | + * environment from the application version. |
| 360 | + * |
| 361 | + * Access: |
| 362 | + * public |
| 363 | + * |
| 364 | + * Parameters: |
| 365 | + * $application_name - _string_ (Required) The name of the application. If no application is found with this name, and `AutoCreateApplication` is `false` , returns an `InvalidParameterValue` error. |
| 366 | + * $version_label - _string_ (Required) A label identifying this version. Constraint: Must be unique per application. If an application version already exists with this label for the specified application, Amazon Elastic Beanstalk returns an `InvalidParameterValue` error. |
| 367 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 368 | + * |
| 369 | + * Keys for the $opt parameter: |
| 370 | + * Description - _string_ (Optional) Describes this version. |
| 371 | + * SourceBundle - _ComplexType_ (Optional) The Amazon S3 bucket and key that identify the location of the source bundle for this version. If data found at the Amazon S3 location exceeds the maximum allowed source bundle size, Amazon Elastic Beanstalk returns an `InvalidParameterValue` error. Default: If not specified, Amazon Elastic Beanstalk uses a sample application. If only partially specified (for example, a bucket is provided but not the key) or if no data is found at the Amazon S3 location, Amazon Elastic Beanstalk returns an `InvalidParameterCombination` error. A ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `SourceBundle` subtype (documented next), or by passing an associative array with the following `SourceBundle`-prefixed entries as keys. See below for a list and a usage example. |
| 372 | + * SourceBundle.S3Bucket - _string_ (Optional) The Amazon S3 bucket where the data is located. |
| 373 | + * SourceBundle.S3Key - _string_ (Optional) The Amazon S3 key where the data is located. |
| 374 | + * AutoCreateApplication - _boolean_ (Optional) Determines how the system behaves if the specified application for this version does not already exist: <enumValues> <value name="true"> `true` : Automatically creates the specified application for this version if it does not already exist. </value> <value name="false"> `false` : Throws an `InvalidParameterValue` if the specified application for this version does not already exist. </value> </enumValues> `true` : Automatically creates the specified application for this release if it does not already exist. ; `false` : Throws an `InvalidParameterValue` if the specified application for this release does not already exist. . Default: `false` Valid Values: `true` | `false` |
| 375 | + * 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. |
| 376 | + * |
| 377 | + * Returns: |
| 378 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 379 | + */ |
| 380 | + public function create_application_version($application_name, $version_label, $opt = null) |
| 381 | + { |
| 382 | + if (!$opt) $opt = array(); |
| 383 | + $opt['ApplicationName'] = $application_name; |
| 384 | + $opt['VersionLabel'] = $version_label; |
| 385 | + |
| 386 | + // Optional parameter |
| 387 | + if (isset($opt['SourceBundle'])) |
| 388 | + { |
| 389 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 390 | + 'SourceBundle' => $opt['SourceBundle'] |
| 391 | + ), 'member')); |
| 392 | + unset($opt['SourceBundle']); |
| 393 | + } |
| 394 | + |
| 395 | + return $this->authenticate('CreateApplicationVersion', $opt, $this->hostname); |
| 396 | + } |
| 397 | + |
| 398 | + /** |
| 399 | + * Method: delete_application_version() |
| 400 | + * Deletes the specified version from the specified application. |
| 401 | + * |
| 402 | + * You cannot delete an application version that is associated with a running environment. |
| 403 | + * |
| 404 | + * Access: |
| 405 | + * public |
| 406 | + * |
| 407 | + * Parameters: |
| 408 | + * $application_name - _string_ (Required) The name of the application to delete releases from. |
| 409 | + * $version_label - _string_ (Required) The label of the version to delete. |
| 410 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 411 | + * |
| 412 | + * Keys for the $opt parameter: |
| 413 | + * DeleteSourceBundle - _boolean_ (Optional) Indicates whether to delete associated source bundle from Amazon S3: `true` : An attempt is made to delete the associated Amazon S3 source bundle specified at time of creation. ; `false` : No action is taken on the Amazon S3 source bundle specified at time of creation. . Valid Values: `true` | `false` |
| 414 | + * 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. |
| 415 | + * |
| 416 | + * Returns: |
| 417 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 418 | + */ |
| 419 | + public function delete_application_version($application_name, $version_label, $opt = null) |
| 420 | + { |
| 421 | + if (!$opt) $opt = array(); |
| 422 | + $opt['ApplicationName'] = $application_name; |
| 423 | + $opt['VersionLabel'] = $version_label; |
| 424 | + |
| 425 | + return $this->authenticate('DeleteApplicationVersion', $opt, $this->hostname); |
| 426 | + } |
| 427 | + |
| 428 | + /** |
| 429 | + * Method: describe_application_versions() |
| 430 | + * Returns descriptions for existing application versions. |
| 431 | + * |
| 432 | + * Access: |
| 433 | + * public |
| 434 | + * |
| 435 | + * Parameters: |
| 436 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 437 | + * |
| 438 | + * Keys for the $opt parameter: |
| 439 | + * ApplicationName - _string_ (Optional) If specified, Amazon Elastic Beanstalk restricts the returned descriptions to only include ones that are associated with the specified application. |
| 440 | + * VersionLabels - _string_|_array_ (Optional) If specified, restricts the returned descriptions to only include ones that have the specified version labels. Pass a string for a single value, or an indexed array for multiple values. |
| 441 | + * 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. |
| 442 | + * |
| 443 | + * Returns: |
| 444 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 445 | + */ |
| 446 | + public function describe_application_versions($opt = null) |
| 447 | + { |
| 448 | + if (!$opt) $opt = array(); |
| 449 | + |
| 450 | + // Optional parameter |
| 451 | + if (isset($opt['VersionLabels'])) |
| 452 | + { |
| 453 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 454 | + 'VersionLabels' => (is_array($opt['VersionLabels']) ? $opt['VersionLabels'] : array($opt['VersionLabels'])) |
| 455 | + ), 'member')); |
| 456 | + unset($opt['VersionLabels']); |
| 457 | + } |
| 458 | + |
| 459 | + return $this->authenticate('DescribeApplicationVersions', $opt, $this->hostname); |
| 460 | + } |
| 461 | + |
| 462 | + /** |
| 463 | + * Method: delete_application() |
| 464 | + * Deletes the specified application along with all associated versions and configurations. |
| 465 | + * |
| 466 | + * You cannot delete an application that has a running environment. |
| 467 | + * |
| 468 | + * Access: |
| 469 | + * public |
| 470 | + * |
| 471 | + * Parameters: |
| 472 | + * $application_name - _string_ (Required) The name of the application to delete. |
| 473 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 474 | + * |
| 475 | + * Keys for the $opt parameter: |
| 476 | + * 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. |
| 477 | + * |
| 478 | + * Returns: |
| 479 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 480 | + */ |
| 481 | + public function delete_application($application_name, $opt = null) |
| 482 | + { |
| 483 | + if (!$opt) $opt = array(); |
| 484 | + $opt['ApplicationName'] = $application_name; |
| 485 | + |
| 486 | + return $this->authenticate('DeleteApplication', $opt, $this->hostname); |
| 487 | + } |
| 488 | + |
| 489 | + /** |
| 490 | + * Method: update_application_version() |
| 491 | + * Updates the specified application version to have the specified properties. |
| 492 | + * |
| 493 | + * If a property (for example, `description` ) is not provided, the value remains unchanged. To clear |
| 494 | + * properties, specify an empty string. |
| 495 | + * |
| 496 | + * Access: |
| 497 | + * public |
| 498 | + * |
| 499 | + * Parameters: |
| 500 | + * $application_name - _string_ (Required) The name of the application associated with this version. If no application is found with this name, returns an `InvalidParameterValue` error. |
| 501 | + * $version_label - _string_ (Required) The name of the version to update. If no application version is found with this label, returns an `InvalidParameterValue` error. |
| 502 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 503 | + * |
| 504 | + * Keys for the $opt parameter: |
| 505 | + * Description - _string_ (Optional) A new description for this release. |
| 506 | + * 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. |
| 507 | + * |
| 508 | + * Returns: |
| 509 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 510 | + */ |
| 511 | + public function update_application_version($application_name, $version_label, $opt = null) |
| 512 | + { |
| 513 | + if (!$opt) $opt = array(); |
| 514 | + $opt['ApplicationName'] = $application_name; |
| 515 | + $opt['VersionLabel'] = $version_label; |
| 516 | + |
| 517 | + return $this->authenticate('UpdateApplicationVersion', $opt, $this->hostname); |
| 518 | + } |
| 519 | + |
| 520 | + /** |
| 521 | + * Method: create_application() |
| 522 | + * Creates an application that has one configuration template named `default` and no application |
| 523 | + * versions. |
| 524 | + * |
| 525 | + * The `default` configuration template is for a 32-bit version of the Amazon Linux operating system |
| 526 | + * running the Tomcat 6 application container. |
| 527 | + * |
| 528 | + * Access: |
| 529 | + * public |
| 530 | + * |
| 531 | + * Parameters: |
| 532 | + * $application_name - _string_ (Required) The name of the application. Constraint: This name must be unique within your account. If the specified name already exists, the action returns an `InvalidParameterValue` error. |
| 533 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 534 | + * |
| 535 | + * Keys for the $opt parameter: |
| 536 | + * Description - _string_ (Optional) Describes the application. |
| 537 | + * 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. |
| 538 | + * |
| 539 | + * Returns: |
| 540 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 541 | + */ |
| 542 | + public function create_application($application_name, $opt = null) |
| 543 | + { |
| 544 | + if (!$opt) $opt = array(); |
| 545 | + $opt['ApplicationName'] = $application_name; |
| 546 | + |
| 547 | + return $this->authenticate('CreateApplication', $opt, $this->hostname); |
| 548 | + } |
| 549 | + |
| 550 | + /** |
| 551 | + * Method: update_configuration_template() |
| 552 | + * Updates the specified configuration template to have the specified properties or configuration |
| 553 | + * option values. If a property (for example, `ApplicationName` ) is not provided, its value remains |
| 554 | + * unchanged. To clear such properties, specify an empty string. |
| 555 | + * |
| 556 | + * Related Topics |
| 557 | + * |
| 558 | + * - DescribeConfigurationOptions |
| 559 | + * |
| 560 | + * Access: |
| 561 | + * public |
| 562 | + * |
| 563 | + * Parameters: |
| 564 | + * $application_name - _string_ (Required) The name of the application associated with the configuration template to update. If no application is found with this name, returns an `InvalidParameterValue` error. |
| 565 | + * $template_name - _string_ (Required) The name of the configuration template to update. If no configuration template is found with this name, returns an `InvalidParameterValue` error. |
| 566 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 567 | + * |
| 568 | + * Keys for the $opt parameter: |
| 569 | + * Description - _string_ (Optional) A new description for the configuration. |
| 570 | + * OptionSettings - _ComplexList_ (Optional) A list of configuration option settings to update with the new specified option value. A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `OptionSettings` subtype (documented next), or by passing an associative array with the following `OptionSettings`-prefixed entries as keys. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. See below for a list and a usage example. |
| 571 | + * OptionSettings.x.Namespace - _string_ (Optional) A unique namespace identifying the option's associated AWS resource. |
| 572 | + * OptionSettings.x.OptionName - _string_ (Optional) The name of the configuration option. |
| 573 | + * OptionSettings.x.Value - _string_ (Optional) The current value for the configuration option. |
| 574 | + * OptionsToRemove - _ComplexList_ (Optional) A list of configuration options to remove from the configuration set. Constraint: You can remove only `UserDefined` configuration options. A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `OptionsToRemove` subtype (documented next), or by passing an associative array with the following `OptionsToRemove`-prefixed entries as keys. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. See below for a list and a usage example. |
| 575 | + * OptionsToRemove.x.Namespace - _string_ (Optional) A unique namespace identifying the option's associated AWS resource. |
| 576 | + * OptionsToRemove.x.OptionName - _string_ (Optional) The name of the configuration option. |
| 577 | + * 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. |
| 578 | + * |
| 579 | + * Returns: |
| 580 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 581 | + */ |
| 582 | + public function update_configuration_template($application_name, $template_name, $opt = null) |
| 583 | + { |
| 584 | + if (!$opt) $opt = array(); |
| 585 | + $opt['ApplicationName'] = $application_name; |
| 586 | + $opt['TemplateName'] = $template_name; |
| 587 | + |
| 588 | + // Optional parameter |
| 589 | + if (isset($opt['OptionSettings'])) |
| 590 | + { |
| 591 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 592 | + 'OptionSettings' => $opt['OptionSettings'] |
| 593 | + ), 'member')); |
| 594 | + unset($opt['OptionSettings']); |
| 595 | + } |
| 596 | + |
| 597 | + // Optional parameter |
| 598 | + if (isset($opt['OptionsToRemove'])) |
| 599 | + { |
| 600 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 601 | + 'OptionsToRemove' => $opt['OptionsToRemove'] |
| 602 | + ), 'member')); |
| 603 | + unset($opt['OptionsToRemove']); |
| 604 | + } |
| 605 | + |
| 606 | + return $this->authenticate('UpdateConfigurationTemplate', $opt, $this->hostname); |
| 607 | + } |
| 608 | + |
| 609 | + /** |
| 610 | + * Method: retrieve_environment_info() |
| 611 | + * Retrieves the compiled information from a RequestEnvironmentInfo request. |
| 612 | + * |
| 613 | + * Related Topics |
| 614 | + * |
| 615 | + * - RequestEnvironmentInfo |
| 616 | + * |
| 617 | + * Access: |
| 618 | + * public |
| 619 | + * |
| 620 | + * Parameters: |
| 621 | + * $info_type - _string_ (Required) The type of information to retrieve. [Allowed values: `tail`] |
| 622 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 623 | + * |
| 624 | + * Keys for the $opt parameter: |
| 625 | + * EnvironmentId - _string_ (Optional) The ID of the data's environment. If no such environment is found, returns an `InvalidParameterValue` error. |
| 626 | + * EnvironmentName - _string_ (Optional) The name of the data's environment. If no such environment is found, returns an `InvalidParameterValue` error. |
| 627 | + * 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. |
| 628 | + * |
| 629 | + * Returns: |
| 630 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 631 | + */ |
| 632 | + public function retrieve_environment_info($info_type, $opt = null) |
| 633 | + { |
| 634 | + if (!$opt) $opt = array(); |
| 635 | + $opt['InfoType'] = $info_type; |
| 636 | + |
| 637 | + return $this->authenticate('RetrieveEnvironmentInfo', $opt, $this->hostname); |
| 638 | + } |
| 639 | + |
| 640 | + /** |
| 641 | + * Method: list_available_solution_stacks() |
| 642 | + * Returns a list of the available solution stack names. |
| 643 | + * |
| 644 | + * Access: |
| 645 | + * public |
| 646 | + * |
| 647 | + * Parameters: |
| 648 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 649 | + * |
| 650 | + * Keys for the $opt parameter: |
| 651 | + * 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. |
| 652 | + * |
| 653 | + * Returns: |
| 654 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 655 | + */ |
| 656 | + public function list_available_solution_stacks($opt = null) |
| 657 | + { |
| 658 | + if (!$opt) $opt = array(); |
| 659 | + |
| 660 | + return $this->authenticate('ListAvailableSolutionStacks', $opt, $this->hostname); |
| 661 | + } |
| 662 | + |
| 663 | + /** |
| 664 | + * Method: update_application() |
| 665 | + * Updates the specified application to have the specified properties. If a property (for example, |
| 666 | + * `description`) is not provided, the value remains unchanged. To clear these properties, specify an |
| 667 | + * empty string. |
| 668 | + * |
| 669 | + * Access: |
| 670 | + * public |
| 671 | + * |
| 672 | + * Parameters: |
| 673 | + * $application_name - _string_ (Required) The name of the application to update. If no such application is found, returns an `InvalidParameterValue` error. |
| 674 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 675 | + * |
| 676 | + * Keys for the $opt parameter: |
| 677 | + * Description - _string_ (Optional) A new description for the application. Default: If not specified, Amazon Elastic Beanstalk does not update the description. |
| 678 | + * 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. |
| 679 | + * |
| 680 | + * Returns: |
| 681 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 682 | + */ |
| 683 | + public function update_application($application_name, $opt = null) |
| 684 | + { |
| 685 | + if (!$opt) $opt = array(); |
| 686 | + $opt['ApplicationName'] = $application_name; |
| 687 | + |
| 688 | + return $this->authenticate('UpdateApplication', $opt, $this->hostname); |
| 689 | + } |
| 690 | + |
| 691 | + /** |
| 692 | + * Method: describe_environments() |
| 693 | + * Returns descriptions for existing environments. |
| 694 | + * |
| 695 | + * Access: |
| 696 | + * public |
| 697 | + * |
| 698 | + * Parameters: |
| 699 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 700 | + * |
| 701 | + * Keys for the $opt parameter: |
| 702 | + * ApplicationName - _string_ (Optional) If specified, Amazon Elastic Beanstalk restricts the returned descriptions to include only those that are associated with this application. |
| 703 | + * VersionLabel - _string_ (Optional) If specified, Amazon Elastic Beanstalk restricts the returned descriptions to include only those that are associated with this application version. |
| 704 | + * EnvironmentIds - _string_|_array_ (Optional) If specified, Amazon Elastic Beanstalk restricts the returned descriptions to includes only those that have the specified IDs. Pass a string for a single value, or an indexed array for multiple values. |
| 705 | + * EnvironmentNames - _string_|_array_ (Optional) If specified, Amazon Elastic Beanstalk restricts the returned descriptions to includes only those that have the specified names. Pass a string for a single value, or an indexed array for multiple values. |
| 706 | + * IncludeDeleted - _boolean_ (Optional) Indicates whether to include deleted environments: `true` : Environments that have been deleted after `IncludedDeletedBackTo` is displayed. `false` : Do not include deleted environments. |
| 707 | + * IncludedDeletedBackTo - _string_ (Optional) This parameter is conditional. If specified when `IncludeDeleted` is set to `true` , then environments deleted after this date are displayed. Accepts any value that `strtotime()` understands. |
| 708 | + * 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. |
| 709 | + * |
| 710 | + * Returns: |
| 711 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 712 | + */ |
| 713 | + public function describe_environments($opt = null) |
| 714 | + { |
| 715 | + if (!$opt) $opt = array(); |
| 716 | + |
| 717 | + // Optional parameter |
| 718 | + if (isset($opt['EnvironmentIds'])) |
| 719 | + { |
| 720 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 721 | + 'EnvironmentIds' => (is_array($opt['EnvironmentIds']) ? $opt['EnvironmentIds'] : array($opt['EnvironmentIds'])) |
| 722 | + ), 'member')); |
| 723 | + unset($opt['EnvironmentIds']); |
| 724 | + } |
| 725 | + |
| 726 | + // Optional parameter |
| 727 | + if (isset($opt['EnvironmentNames'])) |
| 728 | + { |
| 729 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 730 | + 'EnvironmentNames' => (is_array($opt['EnvironmentNames']) ? $opt['EnvironmentNames'] : array($opt['EnvironmentNames'])) |
| 731 | + ), 'member')); |
| 732 | + unset($opt['EnvironmentNames']); |
| 733 | + } |
| 734 | + |
| 735 | + // Optional parameter |
| 736 | + if (isset($opt['IncludedDeletedBackTo'])) |
| 737 | + { |
| 738 | + $opt['IncludedDeletedBackTo'] = $this->util->convert_date_to_iso8601($opt['IncludedDeletedBackTo']); |
| 739 | + } |
| 740 | + |
| 741 | + return $this->authenticate('DescribeEnvironments', $opt, $this->hostname); |
| 742 | + } |
| 743 | + |
| 744 | + /** |
| 745 | + * Method: describe_environment_resources() |
| 746 | + * Returns AWS resources for this environment. |
| 747 | + * |
| 748 | + * Access: |
| 749 | + * public |
| 750 | + * |
| 751 | + * Parameters: |
| 752 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 753 | + * |
| 754 | + * Keys for the $opt parameter: |
| 755 | + * EnvironmentId - _string_ (Optional) The ID of the environment to retrieve AWS resource usage data. |
| 756 | + * EnvironmentName - _string_ (Optional) The name of the environment to retrieve AWS resource usage data. |
| 757 | + * 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. |
| 758 | + * |
| 759 | + * Returns: |
| 760 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 761 | + */ |
| 762 | + public function describe_environment_resources($opt = null) |
| 763 | + { |
| 764 | + if (!$opt) $opt = array(); |
| 765 | + |
| 766 | + return $this->authenticate('DescribeEnvironmentResources', $opt, $this->hostname); |
| 767 | + } |
| 768 | + |
| 769 | + /** |
| 770 | + * Method: terminate_environment() |
| 771 | + * Terminates the specified environment. |
| 772 | + * |
| 773 | + * Access: |
| 774 | + * public |
| 775 | + * |
| 776 | + * Parameters: |
| 777 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 778 | + * |
| 779 | + * Keys for the $opt parameter: |
| 780 | + * EnvironmentId - _string_ (Optional) The ID of the environment to terminate. |
| 781 | + * EnvironmentName - _string_ (Optional) The name of the environment to terminate. |
| 782 | + * TerminateResources - _boolean_ (Optional) Indicates whether the associated AWS resources should shut down when the environment is terminated: <enumValues> <value name="true"> `true` : (default) The user AWS resources (for example, the Auto Scaling group, load balancer, etc.) are terminated along with the environment. </value> <value name="false"> `false`: The environment is removed from the Amazon Elastic Beanstalk but the AWS resources continue to operate. </value> </enumValues> `true` : The specified environment as well as the associated AWS resources, such as Auto Scaling group and load balancer, are terminated. ; `false`: Amazon Elastic Beanstalk resource management is removed from the environment but the AWS resources continue to operate. . For more information, see the Amazon Elastic Beanstalk User Guide. Default: `true` Valid Values: `true` | `false` |
| 783 | + * 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. |
| 784 | + * |
| 785 | + * Returns: |
| 786 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 787 | + */ |
| 788 | + public function terminate_environment($opt = null) |
| 789 | + { |
| 790 | + if (!$opt) $opt = array(); |
| 791 | + |
| 792 | + return $this->authenticate('TerminateEnvironment', $opt, $this->hostname); |
| 793 | + } |
| 794 | + |
| 795 | + /** |
| 796 | + * Method: validate_configuration_settings() |
| 797 | + * Takes a set of configuration settings and either a configuration template or environment, and |
| 798 | + * determines whether those values are valid. This action returns a list of messages indicating any |
| 799 | + * errors or warnings associated with the selection of option values. |
| 800 | + * |
| 801 | + * Access: |
| 802 | + * public |
| 803 | + * |
| 804 | + * Parameters: |
| 805 | + * $application_name - _string_ (Required) The name of the application that the configuration template or environment belongs to. |
| 806 | + * $option_settings - _ComplexList_ (Required) A list of the options and desired values to evaluate. A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs which must be set by passing an associative array. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. |
| 807 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 808 | + * |
| 809 | + * Keys for the $option_settings parameter: |
| 810 | + * Namespace - _string_ (Optional) A unique namespace identifying the option's associated AWS resource. |
| 811 | + * OptionName - _string_ (Optional) The name of the configuration option. |
| 812 | + * Value - _string_ (Optional) The current value for the configuration option. |
| 813 | + * |
| 814 | + * Keys for the $opt parameter: |
| 815 | + * TemplateName - _string_ (Optional) The name of the configuration template to validate the settings against. You cannot specify both this and an environment name. |
| 816 | + * EnvironmentName - _string_ (Optional) The name of the environment to validate the settings against. You cannot specify both this and a configuration template name. |
| 817 | + * 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. |
| 818 | + * |
| 819 | + * Returns: |
| 820 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 821 | + */ |
| 822 | + public function validate_configuration_settings($application_name, $option_settings, $opt = null) |
| 823 | + { |
| 824 | + if (!$opt) $opt = array(); |
| 825 | + $opt['ApplicationName'] = $application_name; |
| 826 | + |
| 827 | + // Required parameter |
| 828 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 829 | + 'OptionSettings' => (is_array($option_settings) ? $option_settings : array($option_settings)) |
| 830 | + ), 'member')); |
| 831 | + |
| 832 | + return $this->authenticate('ValidateConfigurationSettings', $opt, $this->hostname); |
| 833 | + } |
| 834 | + |
| 835 | + /** |
| 836 | + * Method: restart_app_server() |
| 837 | + * Causes the environment to restart the application container server running on each Amazon EC2 |
| 838 | + * instance. |
| 839 | + * |
| 840 | + * Access: |
| 841 | + * public |
| 842 | + * |
| 843 | + * Parameters: |
| 844 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 845 | + * |
| 846 | + * Keys for the $opt parameter: |
| 847 | + * EnvironmentId - _string_ (Optional) The ID of the environment to restart the server for. |
| 848 | + * EnvironmentName - _string_ (Optional) The name of the environment to restart the server for. |
| 849 | + * 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. |
| 850 | + * |
| 851 | + * Returns: |
| 852 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 853 | + */ |
| 854 | + public function restart_app_server($opt = null) |
| 855 | + { |
| 856 | + if (!$opt) $opt = array(); |
| 857 | + |
| 858 | + return $this->authenticate('RestartAppServer', $opt, $this->hostname); |
| 859 | + } |
| 860 | + |
| 861 | + /** |
| 862 | + * Method: delete_environment_configuration() |
| 863 | + * Deletes the draft configuration associated with the running environment. Updating a running |
| 864 | + * environment with any configuration changes creates a draft configuration set. You can get the draft |
| 865 | + * configuration using DescribeConfigurationSettings while the update is in progress or if the update |
| 866 | + * fails. The `DeploymentStatus` for the draft configuration indicates whether the deployment is in |
| 867 | + * process or has failed. The draft configuration remains in existence until it is deleted with this |
| 868 | + * action. |
| 869 | + * |
| 870 | + * Access: |
| 871 | + * public |
| 872 | + * |
| 873 | + * Parameters: |
| 874 | + * $application_name - _string_ (Required) The name of the application the environment is associated with. |
| 875 | + * $environment_name - _string_ (Required) The name of the environment to delete the draft configuration from. |
| 876 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 877 | + * |
| 878 | + * Keys for the $opt parameter: |
| 879 | + * 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. |
| 880 | + * |
| 881 | + * Returns: |
| 882 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 883 | + */ |
| 884 | + public function delete_environment_configuration($application_name, $environment_name, $opt = null) |
| 885 | + { |
| 886 | + if (!$opt) $opt = array(); |
| 887 | + $opt['ApplicationName'] = $application_name; |
| 888 | + $opt['EnvironmentName'] = $environment_name; |
| 889 | + |
| 890 | + return $this->authenticate('DeleteEnvironmentConfiguration', $opt, $this->hostname); |
| 891 | + } |
| 892 | + |
| 893 | + /** |
| 894 | + * Method: update_environment() |
| 895 | + * Updates the environment description, deploys a new application version, updates the configuration |
| 896 | + * settings to an entirely new configuration template, or updates select configuration option values in |
| 897 | + * the running environment. Attempting to update both the release and configuration is not allowed and |
| 898 | + * Amazon Elastic Beanstalk throws an `InvalidParameterCombination` error. |
| 899 | + * |
| 900 | + * When updating the configuration settings to a new template or individual settings, a draft |
| 901 | + * configuration is created and DescribeConfigurationSettings for this environment returns two setting |
| 902 | + * descriptions with different `DeploymentStatus` values. |
| 903 | + * |
| 904 | + * Access: |
| 905 | + * public |
| 906 | + * |
| 907 | + * Parameters: |
| 908 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 909 | + * |
| 910 | + * Keys for the $opt parameter: |
| 911 | + * EnvironmentId - _string_ (Optional) The ID of the environment to update. If no environment with this ID exists, Amazon Elastic Beanstalk returns an `InvalidParameterValue` error. |
| 912 | + * EnvironmentName - _string_ (Optional) The name of the environment to update. If no environment with this name exists, Amazon Elastic Beanstalk returns an `InvalidParameterValue` error. |
| 913 | + * VersionLabel - _string_ (Optional) If this parameter is specified, Amazon Elastic Beanstalk deploys the named application version to the environment. If no such application version is found, returns an `InvalidParameterValue` error. |
| 914 | + * TemplateName - _string_ (Optional) If this parameter is specified, Amazon Elastic Beanstalk deploys this configuration template to the environment. If no such configuration template is found, Amazon Elastic Beanstalk returns an `InvalidParameterValue` error. |
| 915 | + * Description - _string_ (Optional) If this parameter is specified, Amazon Elastic Beanstalk updates the description of this environment. |
| 916 | + * OptionSettings - _ComplexList_ (Optional) If specified, Amazon Elastic Beanstalk updates the configuration set associated with the running environment and sets the specified configuration options to the requested value. A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `OptionSettings` subtype (documented next), or by passing an associative array with the following `OptionSettings`-prefixed entries as keys. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. See below for a list and a usage example. |
| 917 | + * OptionSettings.x.Namespace - _string_ (Optional) A unique namespace identifying the option's associated AWS resource. |
| 918 | + * OptionSettings.x.OptionName - _string_ (Optional) The name of the configuration option. |
| 919 | + * OptionSettings.x.Value - _string_ (Optional) The current value for the configuration option. |
| 920 | + * OptionsToRemove - _ComplexList_ (Optional) A list of custom user-defined configuration options to remove from the configuration set for this environment. A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `OptionsToRemove` subtype (documented next), or by passing an associative array with the following `OptionsToRemove`-prefixed entries as keys. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. See below for a list and a usage example. |
| 921 | + * OptionsToRemove.x.Namespace - _string_ (Optional) A unique namespace identifying the option's associated AWS resource. |
| 922 | + * OptionsToRemove.x.OptionName - _string_ (Optional) The name of the configuration option. |
| 923 | + * 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. |
| 924 | + * |
| 925 | + * Returns: |
| 926 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 927 | + */ |
| 928 | + public function update_environment($opt = null) |
| 929 | + { |
| 930 | + if (!$opt) $opt = array(); |
| 931 | + |
| 932 | + // Optional parameter |
| 933 | + if (isset($opt['OptionSettings'])) |
| 934 | + { |
| 935 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 936 | + 'OptionSettings' => $opt['OptionSettings'] |
| 937 | + ), 'member')); |
| 938 | + unset($opt['OptionSettings']); |
| 939 | + } |
| 940 | + |
| 941 | + // Optional parameter |
| 942 | + if (isset($opt['OptionsToRemove'])) |
| 943 | + { |
| 944 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 945 | + 'OptionsToRemove' => $opt['OptionsToRemove'] |
| 946 | + ), 'member')); |
| 947 | + unset($opt['OptionsToRemove']); |
| 948 | + } |
| 949 | + |
| 950 | + return $this->authenticate('UpdateEnvironment', $opt, $this->hostname); |
| 951 | + } |
| 952 | + |
| 953 | + /** |
| 954 | + * Method: create_configuration_template() |
| 955 | + * Creates a configuration template. Templates are associated with a specific application and are used |
| 956 | + * to deploy different versions of the application with the same configuration settings. Related Topics |
| 957 | + * |
| 958 | + * - DescribeConfigurationOptions |
| 959 | + * |
| 960 | + * - DescribeConfigurationSettings |
| 961 | + * |
| 962 | + * - ListAvailableSolutionStacks |
| 963 | + * |
| 964 | + * Access: |
| 965 | + * public |
| 966 | + * |
| 967 | + * Parameters: |
| 968 | + * $application_name - _string_ (Required) The name of the application to associate with this configuration template. If no application is found with this name, returns an `InvalidParameterValue` error. |
| 969 | + * $template_name - _string_ (Required) The name of the configuration template. Constraint: This name must be unique per application. Default: If a configuration template already exists with this name, Amazon Elastic Beanstalk returns an `InvalidParameterValue` error. |
| 970 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 971 | + * |
| 972 | + * Keys for the $opt parameter: |
| 973 | + * SolutionStackName - _string_ (Optional) The name of the solution stack used by this configuration. The solution stack specifies the operating system, architecture, and application server for a configuration template. It determines the set of configuration options as well as the possible and default values. Use ListAvailableSolutionStacks to obtain a list of available solution stacks. Default: If the `SolutionStackName` is not specified and the source configuration parameter is blank, Amazon Elastic Beanstalk uses the default solution stack, which is a 32-bit version of the default operating system running the Tomcat 6 application container server. If not specified and the source configuration parameter is specified, Amazon Elastic Beanstalk uses the same solution stack as the source configuration template. |
| 974 | + * SourceConfiguration - _ComplexType_ (Optional) If specified, Amazon Elastic Beanstalk uses the configuration values from the specified configuration template to create a new configuration. Values specified in the `OptionSettings` parameter of this call overrides any values obtained from the `SourceConfiguration` . If no configuration template is found, returns an `InvalidParameterValue` error. Constraint: If both the solution stack name parameter and the source configuration parameters are specified, the solution stack of the source configuration template must match the specified solution stack name or else Amazon Elastic Beanstalk returns an `InvalidParameterCombination` error. A ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `SourceConfiguration` subtype (documented next), or by passing an associative array with the following `SourceConfiguration`-prefixed entries as keys. See below for a list and a usage example. |
| 975 | + * SourceConfiguration.ApplicationName - _string_ (Optional) The name of the application associated with the configuration. |
| 976 | + * SourceConfiguration.TemplateName - _string_ (Optional) The name of the configuration template. |
| 977 | + * Description - _string_ (Optional) Describes this configuration. |
| 978 | + * OptionSettings - _ComplexList_ (Optional) If specified, Amazon Elastic Beanstalk sets the specified configuration option to the requested value. The new values override the values obtained from the solution stack or the source configuration template. A ComplexList is an indexed array of ComplexTypes. Each ComplexType is a set of key-value pairs. These pairs can be set one of two ways: by setting each individual `OptionSettings` subtype (documented next), or by passing an associative array with the following `OptionSettings`-prefixed entries as keys. In the descriptions below, `x`, `y` and `z` should be integers starting at `1`. See below for a list and a usage example. |
| 979 | + * OptionSettings.x.Namespace - _string_ (Optional) A unique namespace identifying the option's associated AWS resource. |
| 980 | + * OptionSettings.x.OptionName - _string_ (Optional) The name of the configuration option. |
| 981 | + * OptionSettings.x.Value - _string_ (Optional) The current value for the configuration option. |
| 982 | + * 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. |
| 983 | + * |
| 984 | + * Returns: |
| 985 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 986 | + */ |
| 987 | + public function create_configuration_template($application_name, $template_name, $opt = null) |
| 988 | + { |
| 989 | + if (!$opt) $opt = array(); |
| 990 | + $opt['ApplicationName'] = $application_name; |
| 991 | + $opt['TemplateName'] = $template_name; |
| 992 | + |
| 993 | + // Optional parameter |
| 994 | + if (isset($opt['SourceConfiguration'])) |
| 995 | + { |
| 996 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 997 | + 'SourceConfiguration' => $opt['SourceConfiguration'] |
| 998 | + ), 'member')); |
| 999 | + unset($opt['SourceConfiguration']); |
| 1000 | + } |
| 1001 | + |
| 1002 | + // Optional parameter |
| 1003 | + if (isset($opt['OptionSettings'])) |
| 1004 | + { |
| 1005 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 1006 | + 'OptionSettings' => $opt['OptionSettings'] |
| 1007 | + ), 'member')); |
| 1008 | + unset($opt['OptionSettings']); |
| 1009 | + } |
| 1010 | + |
| 1011 | + return $this->authenticate('CreateConfigurationTemplate', $opt, $this->hostname); |
| 1012 | + } |
| 1013 | + |
| 1014 | + /** |
| 1015 | + * Method: describe_configuration_settings() |
| 1016 | + * Returns a description of the settings for the specified configuration set, that is, either a |
| 1017 | + * configuration template or the configuration set associated with a running environment. When |
| 1018 | + * describing the settings for the configuration set associated with a running environment, it is |
| 1019 | + * possible to receive two sets of setting descriptions. One is the deployed configuration set, and the |
| 1020 | + * other is a draft configuration of an environment that is either in the process of deployment or that |
| 1021 | + * failed to deploy. Related Topics |
| 1022 | + * |
| 1023 | + * - DeleteEnvironmentConfiguration |
| 1024 | + * |
| 1025 | + * Access: |
| 1026 | + * public |
| 1027 | + * |
| 1028 | + * Parameters: |
| 1029 | + * $application_name - _string_ (Required) The application for the environment or configuration template. |
| 1030 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 1031 | + * |
| 1032 | + * Keys for the $opt parameter: |
| 1033 | + * TemplateName - _string_ (Optional) The name of the configuration template to describe. |
| 1034 | + * EnvironmentName - _string_ (Optional) The name of the environment to describe. |
| 1035 | + * 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. |
| 1036 | + * |
| 1037 | + * Returns: |
| 1038 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 1039 | + */ |
| 1040 | + public function describe_configuration_settings($application_name, $opt = null) |
| 1041 | + { |
| 1042 | + if (!$opt) $opt = array(); |
| 1043 | + $opt['ApplicationName'] = $application_name; |
| 1044 | + |
| 1045 | + return $this->authenticate('DescribeConfigurationSettings', $opt, $this->hostname); |
| 1046 | + } |
| 1047 | + |
| 1048 | + /** |
| 1049 | + * Method: describe_applications() |
| 1050 | + * Returns the descriptions of existing applications. |
| 1051 | + * |
| 1052 | + * Access: |
| 1053 | + * public |
| 1054 | + * |
| 1055 | + * Parameters: |
| 1056 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 1057 | + * |
| 1058 | + * Keys for the $opt parameter: |
| 1059 | + * ApplicationNames - _string_|_array_ (Optional) If specified, Amazon Elastic Beanstalk restricts the returned descriptions to only include those with the specified names. Pass a string for a single value, or an indexed array for multiple values. |
| 1060 | + * 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. |
| 1061 | + * |
| 1062 | + * Returns: |
| 1063 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 1064 | + */ |
| 1065 | + public function describe_applications($opt = null) |
| 1066 | + { |
| 1067 | + if (!$opt) $opt = array(); |
| 1068 | + |
| 1069 | + // Optional parameter |
| 1070 | + if (isset($opt['ApplicationNames'])) |
| 1071 | + { |
| 1072 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 1073 | + 'ApplicationNames' => (is_array($opt['ApplicationNames']) ? $opt['ApplicationNames'] : array($opt['ApplicationNames'])) |
| 1074 | + ), 'member')); |
| 1075 | + unset($opt['ApplicationNames']); |
| 1076 | + } |
| 1077 | + |
| 1078 | + return $this->authenticate('DescribeApplications', $opt, $this->hostname); |
| 1079 | + } |
| 1080 | + |
| 1081 | + /** |
| 1082 | + * Method: rebuild_environment() |
| 1083 | + * Deletes and recreates all of the AWS resources (for example: the Auto Scaling group, load balancer, |
| 1084 | + * etc.) for a specified environment and forces a restart. |
| 1085 | + * |
| 1086 | + * Access: |
| 1087 | + * public |
| 1088 | + * |
| 1089 | + * Parameters: |
| 1090 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 1091 | + * |
| 1092 | + * Keys for the $opt parameter: |
| 1093 | + * EnvironmentId - _string_ (Optional) The ID of the environment to rebuild. |
| 1094 | + * EnvironmentName - _string_ (Optional) The name of the environment to rebuild. |
| 1095 | + * 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. |
| 1096 | + * |
| 1097 | + * Returns: |
| 1098 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 1099 | + */ |
| 1100 | + public function rebuild_environment($opt = null) |
| 1101 | + { |
| 1102 | + if (!$opt) $opt = array(); |
| 1103 | + |
| 1104 | + return $this->authenticate('RebuildEnvironment', $opt, $this->hostname); |
| 1105 | + } |
| 1106 | + |
| 1107 | + /** |
| 1108 | + * Method: describe_events() |
| 1109 | + * Returns list of event descriptions matching criteria. This action returns the most recent 1,000 |
| 1110 | + * events from the specified `NextToken`. |
| 1111 | + * |
| 1112 | + * Access: |
| 1113 | + * public |
| 1114 | + * |
| 1115 | + * Parameters: |
| 1116 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 1117 | + * |
| 1118 | + * Keys for the $opt parameter: |
| 1119 | + * ApplicationName - _string_ (Optional) If specified, Amazon Elastic Beanstalk restricts the returned descriptions to include only those associated with this application. |
| 1120 | + * VersionLabel - _string_ (Optional) If specified, Amazon Elastic Beanstalk restricts the returned descriptions to those associated with this application version. |
| 1121 | + * TemplateName - _string_ (Optional) If specified, Amazon Elastic Beanstalk restricts the returned descriptions to those that are associated with this environment configuration. |
| 1122 | + * EnvironmentId - _string_ (Optional) If specified, Amazon Elastic Beanstalk restricts the returned descriptions to those associated with this environment. |
| 1123 | + * EnvironmentName - _string_ (Optional) If specified, Amazon Elastic Beanstalk restricts the returned descriptions to those associated with this environment. |
| 1124 | + * RequestId - _string_ (Optional) If specified, Amazon Elastic Beanstalk restricts the described events to include only those associated with this request ID. |
| 1125 | + * Severity - _string_ (Optional) If specified, limits the events returned from this call to include only those with the specified severity or higher. [Allowed values: `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `FATAL`] |
| 1126 | + * StartTime - _string_ (Optional) If specified, Amazon Elastic Beanstalk restricts the returned descriptions to those that occur on or after this time. Accepts any value that `strtotime()` understands. |
| 1127 | + * EndTime - _string_ (Optional) If specified, Amazon Elastic Beanstalk restricts the returned descriptions to those that occur up to but not including the `EndTime`. Accepts any value that `strtotime()` understands. |
| 1128 | + * NextToken - _string_ (Optional) Pagination token. If specified, the events return the next batch of results. |
| 1129 | + * 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. |
| 1130 | + * |
| 1131 | + * Returns: |
| 1132 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 1133 | + */ |
| 1134 | + public function describe_events($opt = null) |
| 1135 | + { |
| 1136 | + if (!$opt) $opt = array(); |
| 1137 | + |
| 1138 | + // Optional parameter |
| 1139 | + if (isset($opt['StartTime'])) |
| 1140 | + { |
| 1141 | + $opt['StartTime'] = $this->util->convert_date_to_iso8601($opt['StartTime']); |
| 1142 | + } |
| 1143 | + |
| 1144 | + // Optional parameter |
| 1145 | + if (isset($opt['EndTime'])) |
| 1146 | + { |
| 1147 | + $opt['EndTime'] = $this->util->convert_date_to_iso8601($opt['EndTime']); |
| 1148 | + } |
| 1149 | + |
| 1150 | + return $this->authenticate('DescribeEvents', $opt, $this->hostname); |
| 1151 | + } |
| 1152 | +} |
| 1153 | + |
Property changes on: trunk/extensions/OpenStackManager/aws-sdk/services/elasticbeanstalk.class.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 1154 | + native |
Index: trunk/extensions/OpenStackManager/aws-sdk/services/ses.class.php |
— | — | @@ -0,0 +1,435 @@ |
| 2 | +<?php |
| 3 | +/* |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 5 | + * |
| 6 | + * Licensed under the Apache License, Version 2.0 (the "License"). |
| 7 | + * You may not use this file except in compliance with the License. |
| 8 | + * A copy of the License is located at |
| 9 | + * |
| 10 | + * http://aws.amazon.com/apache2.0 |
| 11 | + * |
| 12 | + * or in the "license" file accompanying this file. This file is distributed |
| 13 | + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 14 | + * express or implied. See the License for the specific language governing |
| 15 | + * permissions and limitations under the License. |
| 16 | + */ |
| 17 | + |
| 18 | +/** |
| 19 | + * File: AmazonSES |
| 20 | + * * |
| 21 | + * This is the API Reference for Amazon Simple Email Service (Amazon SES). This documentation is |
| 22 | + * intended to be used in conjunction with the Amazon SES Getting Started Guide and the Amazon SES |
| 23 | + * Developer Guide. |
| 24 | + * |
| 25 | + * For specific details on how to construct a service request, please consult the Amazon SES Developer |
| 26 | + * Guide. |
| 27 | + * |
| 28 | + * Version: |
| 29 | + * Mon Jan 24 14:54:19 PST 2011 |
| 30 | + * |
| 31 | + * License and Copyright: |
| 32 | + * See the included NOTICE.md file for complete information. |
| 33 | + * |
| 34 | + * See Also: |
| 35 | + * [Amazon Simple Email Service](http://aws.amazon.com/ses/) |
| 36 | + * [Amazon Simple Email Service documentation](http://aws.amazon.com/documentation/ses/) |
| 37 | + */ |
| 38 | + |
| 39 | + |
| 40 | +/*%******************************************************************************************%*/ |
| 41 | +// EXCEPTIONS |
| 42 | + |
| 43 | +/** |
| 44 | + * Exception: Email_Exception |
| 45 | + * Default Email Exception. |
| 46 | + */ |
| 47 | +class Email_Exception extends Exception {} |
| 48 | + |
| 49 | + |
| 50 | +/*%******************************************************************************************%*/ |
| 51 | +// MAIN CLASS |
| 52 | + |
| 53 | +/** |
| 54 | + * Class: AmazonSES |
| 55 | + * Container for all service-related methods. |
| 56 | + */ |
| 57 | +class AmazonSES extends CFRuntime |
| 58 | +{ |
| 59 | + |
| 60 | + /*%******************************************************************************************%*/ |
| 61 | + // CLASS CONSTANTS |
| 62 | + |
| 63 | + /** |
| 64 | + * Constant: DEFAULT_URL |
| 65 | + * Specify the default queue URL. |
| 66 | + */ |
| 67 | + const DEFAULT_URL = 'email.us-east-1.amazonaws.com'; |
| 68 | + |
| 69 | + /** |
| 70 | + * Constant: REGION_US_E1 |
| 71 | + * Specify the queue URL for the US-East (Northern Virginia) Region. |
| 72 | + */ |
| 73 | + const REGION_US_E1 = self::DEFAULT_URL; |
| 74 | + |
| 75 | + /** |
| 76 | + * Constant: REGION_US_W1 |
| 77 | + * Specify the queue URL for the US-West (Northern California) Region. |
| 78 | + */ |
| 79 | + const REGION_US_W1 = 'email.us-west-1.amazonaws.com'; |
| 80 | + |
| 81 | + /** |
| 82 | + * Constant: REGION_EU_W1 |
| 83 | + * Specify the queue URL for the EU (Ireland) Region. |
| 84 | + */ |
| 85 | + const REGION_EU_W1 = 'email.eu-west-1.amazonaws.com'; |
| 86 | + |
| 87 | + /** |
| 88 | + * Constant: REGION_APAC_SE1 |
| 89 | + * Specify the queue URL for the Asia Pacific (Singapore) Region. |
| 90 | + */ |
| 91 | + const REGION_APAC_SE1 = 'email.ap-southeast-1.amazonaws.com'; |
| 92 | + |
| 93 | + |
| 94 | + /*%******************************************************************************************%*/ |
| 95 | + // PROPERTIES |
| 96 | + |
| 97 | + /** |
| 98 | + * Property: authenticate |
| 99 | + * The authentication method to use (defaults to <authenticate_v3()>). |
| 100 | + */ |
| 101 | + public $authenticate = 'authenticate_v3'; |
| 102 | + |
| 103 | + |
| 104 | + /*%******************************************************************************************%*/ |
| 105 | + // SETTERS |
| 106 | + |
| 107 | + /** |
| 108 | + * Method: set_region() |
| 109 | + * This allows you to explicitly sets the region for the service to use. |
| 110 | + * |
| 111 | + * Access: |
| 112 | + * public |
| 113 | + * |
| 114 | + * Parameters: |
| 115 | + * $region - _string_ (Required) The region to explicitly set. Available options are <REGION_US_E1>, <REGION_US_W1>, <REGION_EU_W1>, or <REGION_APAC_SE1>. |
| 116 | + * |
| 117 | + * Returns: |
| 118 | + * `$this` |
| 119 | + */ |
| 120 | + public function set_region($region) |
| 121 | + { |
| 122 | + $this->set_hostname($region); |
| 123 | + return $this; |
| 124 | + } |
| 125 | + |
| 126 | + /** |
| 127 | + * Method: disable_ssl() |
| 128 | + * Throws an error because SSL is required for the Amazon Email Service. |
| 129 | + * |
| 130 | + * Access: |
| 131 | + * public |
| 132 | + * |
| 133 | + * Returns: |
| 134 | + * void |
| 135 | + */ |
| 136 | + public function disable_ssl() |
| 137 | + { |
| 138 | + throw new Email_Exception('SSL/HTTPS is REQUIRED for Amazon Email Service and cannot be disabled.'); |
| 139 | + } |
| 140 | + |
| 141 | + |
| 142 | + /*%******************************************************************************************%*/ |
| 143 | + // CONSTRUCTOR |
| 144 | + |
| 145 | + /** |
| 146 | + * Method: __construct() |
| 147 | + * Constructs a new instance of <AmazonEmail>. |
| 148 | + * |
| 149 | + * Access: |
| 150 | + * public |
| 151 | + * |
| 152 | + * Parameters: |
| 153 | + * $key - _string_ (Optional) Your Amazon API Key. If blank, it will look for the <AWS_KEY> constant. |
| 154 | + * $secret_key - _string_ (Optional) Your Amazon API Secret Key. If blank, it will look for the <AWS_SECRET_KEY> constant. |
| 155 | + * |
| 156 | + * Returns: |
| 157 | + * _boolean_ false if no valid values are set, otherwise true. |
| 158 | + */ |
| 159 | + public function __construct($key = null, $secret_key = null) |
| 160 | + { |
| 161 | + $this->api_version = '2010-12-01'; |
| 162 | + $this->hostname = self::DEFAULT_URL; |
| 163 | + |
| 164 | + if (!$key && !defined('AWS_KEY')) |
| 165 | + { |
| 166 | + throw new Email_Exception('No account key was passed into the constructor, nor was it set in the AWS_KEY constant.'); |
| 167 | + } |
| 168 | + |
| 169 | + if (!$secret_key && !defined('AWS_SECRET_KEY')) |
| 170 | + { |
| 171 | + throw new Email_Exception('No account secret was passed into the constructor, nor was it set in the AWS_SECRET_KEY constant.'); |
| 172 | + } |
| 173 | + |
| 174 | + return parent::__construct($key, $secret_key); |
| 175 | + } |
| 176 | + |
| 177 | + |
| 178 | + /*%******************************************************************************************%*/ |
| 179 | + // SERVICE METHODS |
| 180 | + |
| 181 | + /** |
| 182 | + * Method: get_send_quota() |
| 183 | + * Returns the user's current activity limits. |
| 184 | + * |
| 185 | + * Access: |
| 186 | + * public |
| 187 | + * |
| 188 | + * Parameters: |
| 189 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 190 | + * |
| 191 | + * Keys for the $opt parameter: |
| 192 | + * 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. |
| 193 | + * |
| 194 | + * Returns: |
| 195 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 196 | + */ |
| 197 | + public function get_send_quota($opt = null) |
| 198 | + { |
| 199 | + if (!$opt) $opt = array(); |
| 200 | + |
| 201 | + return $this->authenticate('GetSendQuota', $opt, $this->hostname, 3); |
| 202 | + } |
| 203 | + |
| 204 | + /** |
| 205 | + * Method: list_verified_email_addresses() |
| 206 | + * Returns a list containing all of the email addresses that have been verified. |
| 207 | + * |
| 208 | + * Access: |
| 209 | + * public |
| 210 | + * |
| 211 | + * Parameters: |
| 212 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 213 | + * |
| 214 | + * Keys for the $opt parameter: |
| 215 | + * 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. |
| 216 | + * |
| 217 | + * Returns: |
| 218 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 219 | + */ |
| 220 | + public function list_verified_email_addresses($opt = null) |
| 221 | + { |
| 222 | + if (!$opt) $opt = array(); |
| 223 | + |
| 224 | + return $this->authenticate('ListVerifiedEmailAddresses', $opt, $this->hostname, 3); |
| 225 | + } |
| 226 | + |
| 227 | + /** |
| 228 | + * Method: get_send_statistics() |
| 229 | + * Returns the user's sending statistics. The result is a list of data points, representing the last |
| 230 | + * two weeks of sending activity. |
| 231 | + * |
| 232 | + * Each data point in the list contains statistics for a 15-minute interval. |
| 233 | + * |
| 234 | + * Access: |
| 235 | + * public |
| 236 | + * |
| 237 | + * Parameters: |
| 238 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 239 | + * |
| 240 | + * Keys for the $opt parameter: |
| 241 | + * 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. |
| 242 | + * |
| 243 | + * Returns: |
| 244 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 245 | + */ |
| 246 | + public function get_send_statistics($opt = null) |
| 247 | + { |
| 248 | + if (!$opt) $opt = array(); |
| 249 | + |
| 250 | + return $this->authenticate('GetSendStatistics', $opt, $this->hostname, 3); |
| 251 | + } |
| 252 | + |
| 253 | + /** |
| 254 | + * Method: send_email() |
| 255 | + * Composes an email message, based on input data, and then immediately queues the message for sending. |
| 256 | + * |
| 257 | + * Access: |
| 258 | + * public |
| 259 | + * |
| 260 | + * Parameters: |
| 261 | + * $source - _string_ (Required) The sender's email address. |
| 262 | + * $destination - _ComplexType_ (Required) The destination for this email, composed of To:, From:, and CC: fields. A required ComplexType is a set of key-value pairs which must be set by passing an associative array with certain entries as keys. See below for a list. |
| 263 | + * $message - _ComplexType_ (Required) The message to be sent. A required ComplexType is a set of key-value pairs which must be set by passing an associative array with certain entries as keys. See below for a list. |
| 264 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 265 | + * |
| 266 | + * Keys for the $destination parameter: |
| 267 | + * ToAddresses - _string_|_array_ (Optional) The To: field(s) of the message. Pass a string for a single value, or an indexed array for multiple values. |
| 268 | + * CcAddresses - _string_|_array_ (Optional) The CC: field(s) of the message. Pass a string for a single value, or an indexed array for multiple values. |
| 269 | + * BccAddresses - _string_|_array_ (Optional) The BCC: field(s) of the message. Pass a string for a single value, or an indexed array for multiple values. |
| 270 | + * |
| 271 | + * Keys for the $message parameter: |
| 272 | + * Subject.Data - _string_ (Required) The textual data of the content. |
| 273 | + * Subject.Charset - _string_ (Optional) The character set of the content. |
| 274 | + * Body.Text.Data - _string_ (Required) The textual data of the content. |
| 275 | + * Body.Text.Charset - _string_ (Optional) The character set of the content. |
| 276 | + * Body.Html.Data - _string_ (Required) The textual data of the content. |
| 277 | + * Body.Html.Charset - _string_ (Optional) The character set of the content. |
| 278 | + * |
| 279 | + * Keys for the $opt parameter: |
| 280 | + * ReplyToAddresses - _string_|_array_ (Optional) The reply-to email address(es) for the message. If the recipient replies to the message, each reply-to address will receive the reply. Pass a string for a single value, or an indexed array for multiple values. |
| 281 | + * ReturnPath - _string_ (Optional) The email address to which bounce notifications are to be forwarded. If the message cannot be delivered to the recipient, then an error message will be returned from the recipient's ISP; this message will then be forwarded to the email address specified by the ReturnPath parameter. |
| 282 | + * 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. |
| 283 | + * |
| 284 | + * Returns: |
| 285 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 286 | + */ |
| 287 | + public function send_email($source, $destination, $message, $opt = null) |
| 288 | + { |
| 289 | + if (!$opt) $opt = array(); |
| 290 | + $opt['Source'] = $source; |
| 291 | + |
| 292 | + // Collapse these list values for the required parameter |
| 293 | + if (isset($destination['ToAddresses'])) |
| 294 | + { |
| 295 | + $destination['ToAddresses'] = CFComplexType::map(array( |
| 296 | + 'member' => (is_array($destination['ToAddresses']) ? $destination['ToAddresses'] : array($destination['ToAddresses'])) |
| 297 | + )); |
| 298 | + } |
| 299 | + |
| 300 | + // Collapse these list values for the required parameter |
| 301 | + if (isset($destination['CcAddresses'])) |
| 302 | + { |
| 303 | + $destination['CcAddresses'] = CFComplexType::map(array( |
| 304 | + 'member' => (is_array($destination['CcAddresses']) ? $destination['CcAddresses'] : array($destination['CcAddresses'])) |
| 305 | + )); |
| 306 | + } |
| 307 | + |
| 308 | + // Collapse these list values for the required parameter |
| 309 | + if (isset($destination['BccAddresses'])) |
| 310 | + { |
| 311 | + $destination['BccAddresses'] = CFComplexType::map(array( |
| 312 | + 'member' => (is_array($destination['BccAddresses']) ? $destination['BccAddresses'] : array($destination['BccAddresses'])) |
| 313 | + )); |
| 314 | + } |
| 315 | + |
| 316 | + // Required parameter |
| 317 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 318 | + 'Destination' => (is_array($destination) ? $destination : array($destination)) |
| 319 | + ), 'member')); |
| 320 | + |
| 321 | + // Required parameter |
| 322 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 323 | + 'Message' => (is_array($message) ? $message : array($message)) |
| 324 | + ), 'member')); |
| 325 | + |
| 326 | + // Optional parameter |
| 327 | + if (isset($opt['ReplyToAddresses'])) |
| 328 | + { |
| 329 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 330 | + 'ReplyToAddresses' => (is_array($opt['ReplyToAddresses']) ? $opt['ReplyToAddresses'] : array($opt['ReplyToAddresses'])) |
| 331 | + ), 'member')); |
| 332 | + unset($opt['ReplyToAddresses']); |
| 333 | + } |
| 334 | + |
| 335 | + return $this->authenticate('SendEmail', $opt, $this->hostname, 3); |
| 336 | + } |
| 337 | + |
| 338 | + /** |
| 339 | + * Method: delete_verified_email_address() |
| 340 | + * Deletes the specified email address from the list of verified addresses. |
| 341 | + * |
| 342 | + * Access: |
| 343 | + * public |
| 344 | + * |
| 345 | + * Parameters: |
| 346 | + * $email_address - _string_ (Required) An email address to be removed from the list of verified addreses. |
| 347 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 348 | + * |
| 349 | + * Keys for the $opt parameter: |
| 350 | + * 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. |
| 351 | + * |
| 352 | + * Returns: |
| 353 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 354 | + */ |
| 355 | + public function delete_verified_email_address($email_address, $opt = null) |
| 356 | + { |
| 357 | + if (!$opt) $opt = array(); |
| 358 | + $opt['EmailAddress'] = $email_address; |
| 359 | + |
| 360 | + return $this->authenticate('DeleteVerifiedEmailAddress', $opt, $this->hostname, 3); |
| 361 | + } |
| 362 | + |
| 363 | + /** |
| 364 | + * Method: verify_email_address() |
| 365 | + * Begins the process of email address verification. This action causes a confirmation email message to |
| 366 | + * be sent to the specified address. |
| 367 | + * |
| 368 | + * Access: |
| 369 | + * public |
| 370 | + * |
| 371 | + * Parameters: |
| 372 | + * $email_address - _string_ (Required) The email address to be verified. |
| 373 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 374 | + * |
| 375 | + * Keys for the $opt parameter: |
| 376 | + * 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 | + * |
| 378 | + * Returns: |
| 379 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 380 | + */ |
| 381 | + public function verify_email_address($email_address, $opt = null) |
| 382 | + { |
| 383 | + if (!$opt) $opt = array(); |
| 384 | + $opt['EmailAddress'] = $email_address; |
| 385 | + |
| 386 | + return $this->authenticate('VerifyEmailAddress', $opt, $this->hostname, 3); |
| 387 | + } |
| 388 | + |
| 389 | + /** |
| 390 | + * Method: send_raw_email() |
| 391 | + * Sends an email message, with header and content specified by the client. The SendRawEmail action is |
| 392 | + * useful for sending multipart MIME emails, with attachments or inline content. |
| 393 | + * |
| 394 | + * The raw text of the message must comply with Internet email standards; otherwise, the message |
| 395 | + * cannot be sent. |
| 396 | + * |
| 397 | + * Access: |
| 398 | + * public |
| 399 | + * |
| 400 | + * Parameters: |
| 401 | + * $raw_message - _ComplexType_ (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.. A required ComplexType is a set of key-value pairs which must be set by passing an associative array with certain entries as keys. See below for a list. |
| 402 | + * $opt - _array_ (Optional) An associative array of parameters that can have the keys listed in the following section. |
| 403 | + * |
| 404 | + * Keys for the $raw_message parameter: |
| 405 | + * Data - _blob_ (Required) The raw data of the message. The client must ensure that the message format complies with Internet email standards surrounding email header fields, MIME types, MIME encoding, and base64 encoding (if necessary). |
| 406 | + * |
| 407 | + * Keys for the $opt parameter: |
| 408 | + * Source - _string_ (Optional) The sender's email address. |
| 409 | + * Destinations - _string_|_array_ (Optional) A list of destinations for the message. Pass a string for a single value, or an indexed array for multiple values. |
| 410 | + * 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. |
| 411 | + * |
| 412 | + * Returns: |
| 413 | + * _CFResponse_ A <CFResponse> object containing a parsed HTTP response. |
| 414 | + */ |
| 415 | + public function send_raw_email($raw_message, $opt = null) |
| 416 | + { |
| 417 | + if (!$opt) $opt = array(); |
| 418 | + |
| 419 | + // Optional parameter |
| 420 | + if (isset($opt['Destinations'])) |
| 421 | + { |
| 422 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 423 | + 'Destinations' => (is_array($opt['Destinations']) ? $opt['Destinations'] : array($opt['Destinations'])) |
| 424 | + ), 'member')); |
| 425 | + unset($opt['Destinations']); |
| 426 | + } |
| 427 | + |
| 428 | + // Required parameter |
| 429 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 430 | + 'RawMessage' => (is_array($raw_message) ? $raw_message : array($raw_message)) |
| 431 | + ), 'member')); |
| 432 | + |
| 433 | + return $this->authenticate('SendRawEmail', $opt, $this->hostname, 3); |
| 434 | + } |
| 435 | +} |
| 436 | + |
Property changes on: trunk/extensions/OpenStackManager/aws-sdk/services/ses.class.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 437 | + native |
Index: trunk/extensions/OpenStackManager/aws-sdk/services/importexport.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | * upgrading your connectivity. |
26 | 26 | * |
27 | 27 | * Version: |
28 | | - * Fri Dec 03 16:26:16 PST 2010 |
| 28 | + * Mon Jan 24 14:56:54 PST 2011 |
29 | 29 | * |
30 | 30 | * License and Copyright: |
31 | 31 | * See the included NOTICE.md file for complete information. |
Index: trunk/extensions/OpenStackManager/aws-sdk/services/cloudwatch.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | * that initiate Auto Scaling and Simple Notification Service actions on your behalf. |
31 | 31 | * |
32 | 32 | * Version: |
33 | | - * Fri Dec 03 16:23:21 PST 2010 |
| 33 | + * Mon Jan 24 14:50:40 PST 2011 |
34 | 34 | * |
35 | 35 | * License and Copyright: |
36 | 36 | * See the included NOTICE.md file for complete information. |
Index: trunk/extensions/OpenStackManager/aws-sdk/services/cloudfront.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
Index: trunk/extensions/OpenStackManager/aws-sdk/services/elb.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | * redundancy and supports traffic growth of your application. |
24 | 24 | * |
25 | 25 | * Version: |
26 | | - * Fri Dec 03 16:24:35 PST 2010 |
| 26 | + * Mon Jan 24 14:53:28 PST 2011 |
27 | 27 | * |
28 | 28 | * License and Copyright: |
29 | 29 | * See the included NOTICE.md file for complete information. |
Index: trunk/extensions/OpenStackManager/aws-sdk/services/as.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | * will automatically redistribute applications to a different Availability Zone. |
28 | 28 | * |
29 | 29 | * Version: |
30 | | - * Fri Dec 03 16:22:08 PST 2010 |
| 30 | + * Mon Jan 24 14:49:47 PST 2011 |
31 | 31 | * |
32 | 32 | * License and Copyright: |
33 | 33 | * See the included NOTICE.md file for complete information. |
Index: trunk/extensions/OpenStackManager/aws-sdk/services/emr.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | * detailed information about the Amazon Elastic MapReduce APIs. |
22 | 22 | * |
23 | 23 | * Version: |
24 | | - * Fri Dec 03 16:25:08 PST 2010 |
| 24 | + * Mon Jan 24 14:55:04 PST 2011 |
25 | 25 | * |
26 | 26 | * License and Copyright: |
27 | 27 | * See the included NOTICE.md file for complete information. |
Index: trunk/extensions/OpenStackManager/aws-sdk/services/sns.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | * |
21 | 21 | * |
22 | 22 | * Version: |
23 | | - * Fri Dec 03 16:27:54 PST 2010 |
| 23 | + * Mon Jan 24 14:59:34 PST 2011 |
24 | 24 | * |
25 | 25 | * License and Copyright: |
26 | 26 | * See the included NOTICE.md file for complete information. |
Index: trunk/extensions/OpenStackManager/aws-sdk/lib/requestcore/requestcore.class.php |
— | — | @@ -4,10 +4,11 @@ |
5 | 5 | * Handles all HTTP requests using cURL and manages the responses. |
6 | 6 | * |
7 | 7 | * Version: |
8 | | - * 2010.11.02 |
| 8 | + * 2011.01.11 |
9 | 9 | * |
10 | 10 | * Copyright: |
11 | | - * 2006-2010 Ryan Parman, Foleeo Inc., and contributors. |
| 11 | + * 2006-2011 Ryan Parman, Foleeo Inc., and contributors. |
| 12 | + * 2010-2011 Amazon.com, Inc. or its affiliates. |
12 | 13 | * |
13 | 14 | * License: |
14 | 15 | * Simplified BSD License - http://opensource.org/licenses/bsd-license.php |
— | — | @@ -133,43 +134,49 @@ |
134 | 135 | * Property: useragent |
135 | 136 | * Default useragent string to use. |
136 | 137 | */ |
137 | | - public $useragent = 'RequestCore/1.3'; |
| 138 | + public $useragent = 'RequestCore/1.4'; |
138 | 139 | |
139 | 140 | /** |
140 | 141 | * Property: read_file |
141 | 142 | * File to read from while streaming up. |
142 | 143 | */ |
143 | | - var $read_file = null; |
| 144 | + public $read_file = null; |
144 | 145 | |
145 | 146 | /** |
146 | 147 | * Property: read_stream |
147 | 148 | * The resource to read from while streaming up. |
148 | 149 | */ |
149 | | - var $read_stream = null; |
| 150 | + public $read_stream = null; |
150 | 151 | |
151 | 152 | /** |
152 | 153 | * Property: read_stream_size |
153 | 154 | * The size of the stream to read from. |
154 | 155 | */ |
155 | | - var $read_stream_size = null; |
| 156 | + public $read_stream_size = null; |
156 | 157 | |
157 | 158 | /** |
| 159 | + * Property: read_stream_read |
| 160 | + * The length already read from the stream. |
| 161 | + */ |
| 162 | + public $read_stream_read = 0; |
| 163 | + |
| 164 | + /** |
158 | 165 | * Property: write_file |
159 | 166 | * File to write to while streaming down. |
160 | 167 | */ |
161 | | - var $write_file = null; |
| 168 | + public $write_file = null; |
162 | 169 | |
163 | 170 | /** |
164 | 171 | * Property: write_stream |
165 | 172 | * The resource to write to while streaming down. |
166 | 173 | */ |
167 | | - var $write_stream = null; |
| 174 | + public $write_stream = null; |
168 | 175 | |
169 | 176 | /** |
170 | 177 | * Property: seek_position |
171 | 178 | * Stores the intended starting seek position. |
172 | 179 | */ |
173 | | - public $seek_position = 0; |
| 180 | + public $seek_position = null; |
174 | 181 | |
175 | 182 | |
176 | 183 | /*%******************************************************************************************%*/ |
— | — | @@ -207,7 +214,7 @@ |
208 | 215 | |
209 | 216 | |
210 | 217 | /*%******************************************************************************************%*/ |
211 | | - // CONSTRUCTOR |
| 218 | + // CONSTRUCTOR/DESTRUCTOR |
212 | 219 | |
213 | 220 | /** |
214 | 221 | * Method: __construct() |
— | — | @@ -252,7 +259,32 @@ |
253 | 260 | return $this; |
254 | 261 | } |
255 | 262 | |
| 263 | + /** |
| 264 | + * Method: __destruct() |
| 265 | + * The destructor. Closes opened file handles. |
| 266 | + * |
| 267 | + * Access: |
| 268 | + * public |
| 269 | + * |
| 270 | + * Returns: |
| 271 | + * `$this` |
| 272 | + */ |
| 273 | + public function __destruct() |
| 274 | + { |
| 275 | + if (isset($this->read_file) && isset($this->read_stream)) |
| 276 | + { |
| 277 | + fclose($this->read_stream); |
| 278 | + } |
256 | 279 | |
| 280 | + if (isset($this->write_file) && isset($this->write_stream)) |
| 281 | + { |
| 282 | + fclose($this->write_stream); |
| 283 | + } |
| 284 | + |
| 285 | + return $this; |
| 286 | + } |
| 287 | + |
| 288 | + |
257 | 289 | /*%******************************************************************************************%*/ |
258 | 290 | // REQUEST METHODS |
259 | 291 | |
— | — | @@ -415,6 +447,26 @@ |
416 | 448 | } |
417 | 449 | |
418 | 450 | /** |
| 451 | + * Method: set_read_stream_size() |
| 452 | + * Sets the length in bytes to read from the stream while streaming up. |
| 453 | + * |
| 454 | + * Access: |
| 455 | + * public |
| 456 | + * |
| 457 | + * Parameters: |
| 458 | + * $size - _integer_ (Required) The length in bytes to read from the stream. |
| 459 | + * |
| 460 | + * Returns: |
| 461 | + * `$this` |
| 462 | + */ |
| 463 | + public function set_read_stream_size($size) |
| 464 | + { |
| 465 | + $this->read_stream_size = $size; |
| 466 | + |
| 467 | + return $this; |
| 468 | + } |
| 469 | + |
| 470 | + /** |
419 | 471 | * Method: set_read_stream() |
420 | 472 | * Sets the resource to read from while streaming up. Reads the stream from it's current position until |
421 | 473 | * EOF or `$size` bytes have been read. If `$size` is not given it will be determined by fstat() and |
— | — | @@ -430,9 +482,9 @@ |
431 | 483 | * Returns: |
432 | 484 | * `$this` |
433 | 485 | */ |
434 | | - public function set_read_stream($resource, $size = -1) |
| 486 | + public function set_read_stream($resource, $size = null) |
435 | 487 | { |
436 | | - if ($size < 0) |
| 488 | + if (!isset($size) || $size < 0) |
437 | 489 | { |
438 | 490 | $stats = fstat($resource); |
439 | 491 | |
— | — | @@ -447,15 +499,9 @@ |
448 | 500 | } |
449 | 501 | } |
450 | 502 | |
451 | | - if ($size < 0) |
452 | | - { |
453 | | - throw new RequestCore_Exception('Stream size for upload cannot be determined'); |
454 | | - } |
455 | | - |
456 | 503 | $this->read_stream = $resource; |
457 | | - $this->read_stream_size = $size; |
458 | 504 | |
459 | | - return $this; |
| 505 | + return $this->set_read_stream_size($size); |
460 | 506 | } |
461 | 507 | |
462 | 508 | /** |
— | — | @@ -466,7 +512,7 @@ |
467 | 513 | * public |
468 | 514 | * |
469 | 515 | * Parameters: |
470 | | - * $location - _string_ (Required) The file system location to read from. |
| 516 | + * $location - _string_ (Required) The readable location to read from. |
471 | 517 | * |
472 | 518 | * Returns: |
473 | 519 | * `$this` |
— | — | @@ -474,7 +520,6 @@ |
475 | 521 | public function set_read_file($location) |
476 | 522 | { |
477 | 523 | $this->read_file = $location; |
478 | | - // @todo: Close this connection! |
479 | 524 | $read_file_handle = fopen($location, 'r'); |
480 | 525 | |
481 | 526 | return $this->set_read_stream($read_file_handle); |
— | — | @@ -496,6 +541,7 @@ |
497 | 542 | public function set_write_stream($resource) |
498 | 543 | { |
499 | 544 | $this->write_stream = $resource; |
| 545 | + |
500 | 546 | return $this; |
501 | 547 | } |
502 | 548 | |
— | — | @@ -507,7 +553,7 @@ |
508 | 554 | * public |
509 | 555 | * |
510 | 556 | * Parameters: |
511 | | - * $location - _string_ (Required) The file system location to write to. |
| 557 | + * $location - _string_ (Required) The writeable location to write to. |
512 | 558 | * |
513 | 559 | * Returns: |
514 | 560 | * `$this` |
— | — | @@ -551,14 +597,15 @@ |
552 | 598 | * public |
553 | 599 | * |
554 | 600 | * Parameters: |
555 | | - * $position - _integer_ (Required) The byte-position of the file to begin reading from. |
| 601 | + * $position - _integer_ (Required) The byte-position of the stream to begin reading from. |
556 | 602 | * |
557 | 603 | * Returns: |
558 | 604 | * `$this` |
559 | 605 | */ |
560 | 606 | public function set_seek_position($position) |
561 | 607 | { |
562 | | - $this->seek_position = (integer) $position; |
| 608 | + $this->seek_position = isset($position) ? (integer) $position : null; |
| 609 | + |
563 | 610 | return $this; |
564 | 611 | } |
565 | 612 | |
— | — | @@ -568,7 +615,7 @@ |
569 | 616 | |
570 | 617 | /** |
571 | 618 | * Method: streaming_read_callback() |
572 | | - * A callback function that is invoked by cURL for streaming. |
| 619 | + * A callback function that is invoked by cURL for streaming up. |
573 | 620 | * |
574 | 621 | * Access: |
575 | 622 | * public |
— | — | @@ -579,31 +626,68 @@ |
580 | 627 | * $length - _integer_ (Required) The maximum number of bytes to read. |
581 | 628 | * |
582 | 629 | * Returns: |
583 | | - * _binary_ Binary data from a file. |
| 630 | + * _binary_ Binary data from a stream. |
584 | 631 | */ |
585 | 632 | public function streaming_read_callback($curl_handle, $file_handle, $length) |
586 | 633 | { |
587 | | - $info = curl_getinfo($curl_handle); |
588 | | - |
589 | 634 | // Once we've sent as much as we're supposed to send... |
590 | | - if ($info['size_upload'] >= $info['upload_content_length']) |
| 635 | + if ($this->read_stream_read >= $this->read_stream_size) |
591 | 636 | { |
592 | 637 | // Send EOF |
593 | | - return 0; |
| 638 | + return ''; |
594 | 639 | } |
595 | 640 | |
596 | | - // If we're not in the middle of an upload... |
597 | | - if ((integer) $info['size_upload'] === 0) |
| 641 | + // If we're at the beginning of an upload and need to seek... |
| 642 | + if ($this->read_stream_read == 0 && isset($this->seek_position) && $this->seek_position !== ftell($this->read_stream)) |
598 | 643 | { |
599 | | - fseek($file_handle, (integer) $this->seek_position); |
| 644 | + if (fseek($this->read_stream, $this->seek_position) !== 0) |
| 645 | + { |
| 646 | + throw new RequestCore_Exception('The stream does not support seeking and is either not at the requested position or the position is unknown.'); |
| 647 | + } |
600 | 648 | } |
601 | 649 | |
602 | | - // echo ftell($file_handle) . '/' . $info['size_upload'] . PHP_EOL; |
| 650 | + $read = fread($this->read_stream, min($this->read_stream_size - $this->read_stream_read, $length)); // Remaining upload data or cURL's requested chunk size |
| 651 | + $this->read_stream_read += strlen($read); |
603 | 652 | |
604 | | - return fread($file_handle, 16384); // 16KB chunks |
| 653 | + return $read === false ? '' : $read; |
605 | 654 | } |
606 | 655 | |
607 | 656 | /** |
| 657 | + * Method: streaming_write_callback() |
| 658 | + * A callback function that is invoked by cURL for streaming down. |
| 659 | + * |
| 660 | + * Access: |
| 661 | + * public |
| 662 | + * |
| 663 | + * Parameters: |
| 664 | + * $curl_handle - _resource_ (Required) The cURL handle for the request. |
| 665 | + * $data - _binary_ (Required) The data to write. |
| 666 | + * |
| 667 | + * Returns: |
| 668 | + * _integer_ The number of bytes written. |
| 669 | + */ |
| 670 | + public function streaming_write_callback($curl_handle, $data) |
| 671 | + { |
| 672 | + $length = strlen($data); |
| 673 | + $written_total = 0; |
| 674 | + $written_last = 0; |
| 675 | + |
| 676 | + while ($written_total < $length) |
| 677 | + { |
| 678 | + $written_last = fwrite($this->write_stream, substr($data, $written_total)); |
| 679 | + |
| 680 | + if ($written_last === false) |
| 681 | + { |
| 682 | + return $written_total; |
| 683 | + } |
| 684 | + |
| 685 | + $written_total += $written_last; |
| 686 | + } |
| 687 | + |
| 688 | + return $written_total; |
| 689 | + } |
| 690 | + |
| 691 | + /** |
608 | 692 | * Method: prep_request() |
609 | 693 | * Prepares and adds the details of the cURL request. This can be passed along to a `curl_multi_exec()` function. |
610 | 694 | * |
— | — | @@ -633,8 +717,6 @@ |
634 | 718 | curl_setopt($curl_handle, CURLOPT_NOSIGNAL, true); |
635 | 719 | curl_setopt($curl_handle, CURLOPT_REFERER, $this->request_url); |
636 | 720 | curl_setopt($curl_handle, CURLOPT_USERAGENT, $this->useragent); |
637 | | - curl_setopt($curl_handle, CURLOPT_LOW_SPEED_LIMIT, 1); |
638 | | - curl_setopt($curl_handle, CURLOPT_LOW_SPEED_TIME, 10); |
639 | 721 | curl_setopt($curl_handle, CURLOPT_READFUNCTION, array($this, 'streaming_read_callback')); |
640 | 722 | |
641 | 723 | // Enable a proxy connection if requested. |
— | — | @@ -684,7 +766,11 @@ |
685 | 767 | curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, 'PUT'); |
686 | 768 | if (isset($this->read_stream)) |
687 | 769 | { |
688 | | - curl_setopt($curl_handle, CURLOPT_INFILE, $this->read_stream); |
| 770 | + if (!isset($this->read_stream_size) || $this->read_stream_size < 0) |
| 771 | + { |
| 772 | + throw new RequestCore_Exception('The stream size for the streaming upload cannot be determined.'); |
| 773 | + } |
| 774 | + |
689 | 775 | curl_setopt($curl_handle, CURLOPT_INFILESIZE, $this->read_stream_size); |
690 | 776 | curl_setopt($curl_handle, CURLOPT_UPLOAD, true); |
691 | 777 | } |
— | — | @@ -708,7 +794,7 @@ |
709 | 795 | curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, $this->method); |
710 | 796 | if (isset($this->write_stream)) |
711 | 797 | { |
712 | | - curl_setopt($curl_handle, CURLOPT_FILE, $this->write_stream); |
| 798 | + curl_setopt($curl_handle, CURLOPT_WRITEFUNCTION, array($this, 'streaming_write_callback')); |
713 | 799 | curl_setopt($curl_handle, CURLOPT_HEADER, false); |
714 | 800 | } |
715 | 801 | else |
— | — | @@ -884,14 +970,14 @@ |
885 | 971 | // Start executing and wait for a response. |
886 | 972 | while (($status = curl_multi_exec($multi_handle, $active)) === CURLM_CALL_MULTI_PERFORM) |
887 | 973 | { |
888 | | - if ($status !== CURLM_OK && $limit > 0) break; |
| 974 | + // Start looking for possible responses immediately when we have to add more handles |
| 975 | + if (count($handles) > 0) break; |
889 | 976 | } |
890 | 977 | |
891 | 978 | // Figure out which requests finished. |
892 | | - $qlength = 0; |
893 | 979 | $to_process = array(); |
894 | 980 | |
895 | | - while ($done = curl_multi_info_read($multi_handle, $qlength)) |
| 981 | + while ($done = curl_multi_info_read($multi_handle)) |
896 | 982 | { |
897 | 983 | // 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 ) |
898 | 984 | if ($done['result'] > 0) |
— | — | @@ -909,25 +995,20 @@ |
910 | 996 | // Actually deal with the request |
911 | 997 | foreach ($to_process as $pkey => $done) |
912 | 998 | { |
913 | | - if ((int) $done['handle'] != $last_handle) |
| 999 | + $response = $http->process_response($done['handle'], curl_multi_getcontent($done['handle'])); |
| 1000 | + $key = array_search($done['handle'], $handle_list, true); |
| 1001 | + $handles_post[$key] = $response; |
| 1002 | + |
| 1003 | + if (count($handles) > 0) |
914 | 1004 | { |
915 | | - $last_handle = (int) $done['handle']; |
916 | | - $response = $http->process_response($done['handle'], curl_multi_getcontent($done['handle'])); |
917 | | - $key = array_search($done['handle'], $handle_list, true); |
| 1005 | + curl_multi_add_handle($multi_handle, array_shift($handles)); |
| 1006 | + } |
918 | 1007 | |
919 | | - $handles_post[$key] = $response; |
920 | | - |
921 | | - if (count($handles) > 0) |
922 | | - { |
923 | | - curl_multi_add_handle($multi_handle, array_shift($handles)); |
924 | | - } |
925 | | - |
926 | | - curl_multi_remove_handle($multi_handle, $done['handle']); |
927 | | - curl_close($done['handle']); |
928 | | - } |
| 1008 | + curl_multi_remove_handle($multi_handle, $done['handle']); |
| 1009 | + curl_close($done['handle']); |
929 | 1010 | } |
930 | 1011 | } |
931 | | - while ($active); |
| 1012 | + while ($active || count($handles_post) < $added); |
932 | 1013 | |
933 | 1014 | curl_multi_close($multi_handle); |
934 | 1015 | |
Index: trunk/extensions/OpenStackManager/aws-sdk/_compatibility_test/sdk_compatibility_test_cli.php |
— | — | @@ -30,6 +30,16 @@ |
31 | 31 | $sqlite3_ok = extension_loaded('sqlite3'); |
32 | 32 | $sqlite_ok = ($pdo_ok && $pdo_sqlite_ok && ($sqlite2_ok || $sqlite3_ok)); |
33 | 33 | |
| 34 | +function success($s = 'Yes') |
| 35 | +{ |
| 36 | + return "\033[1;37m\033[42m " . $s . " \033[0m"; |
| 37 | +} |
| 38 | + |
| 39 | +function failure($s = 'No ') |
| 40 | +{ |
| 41 | + return "\033[1;37m\033[41m " . $s . " \033[0m"; |
| 42 | +} |
| 43 | + |
34 | 44 | ///////////////////////////////////////////////////////////////////////// |
35 | 45 | |
36 | 46 | echo PHP_EOL; |
— | — | @@ -39,23 +49,23 @@ |
40 | 50 | echo '----------------------------------------' . PHP_EOL; |
41 | 51 | echo PHP_EOL; |
42 | 52 | |
43 | | -echo 'PHP 5.2 or newer... ' . ($php_ok ? phpversion() : 'No') . PHP_EOL; |
44 | | -echo 'cURL with SSL... ' . ($curl_ok ? ($curl_version['version'] . ' (' . $curl_version['ssl_version'] . ')') : ($curl_version['version'] . (in_array('https', $curl_version['protocols'], true) ? ' (with ' . $curl_version['ssl_version'] . ')' : ' (without SSL)'))) . PHP_EOL; |
45 | | -echo 'Standard PHP Library... ' . ($spl_ok ? 'Yes' : 'No') . PHP_EOL; |
46 | | -echo 'SimpleXML... ' . ($simplexml_ok ? 'Yes' : 'No') . PHP_EOL; |
47 | | -echo 'JSON... ' . ($json_ok ? 'Yes' : 'No') . PHP_EOL; |
48 | | -echo 'PCRE... ' . ($pcre_ok ? 'Yes' : 'No') . PHP_EOL; |
49 | | -echo 'File system read/write... ' . ($file_ok ? 'Yes' : 'No') . PHP_EOL; |
50 | | -echo 'OpenSSL extension... ' . ($openssl_ok ? 'Yes' : 'No') . PHP_EOL; |
51 | | -echo 'Zlib... ' . ($zlib_ok ? 'Yes' : 'No') . PHP_EOL; |
52 | | -echo 'APC... ' . ($apc_ok ? 'Yes' : 'No') . PHP_EOL; |
53 | | -echo 'XCache... ' . ($xcache_ok ? 'Yes' : 'No') . PHP_EOL; |
54 | | -echo 'Memcache... ' . ($memcache_ok ? 'Yes' : 'No') . PHP_EOL; |
55 | | -echo 'Memcached... ' . ($memcached_ok ? 'Yes' : 'No') . PHP_EOL; |
56 | | -echo 'PDO... ' . ($pdo_ok ? 'Yes' : 'No') . PHP_EOL; |
57 | | -echo 'SQLite 2... ' . ($sqlite2_ok ? 'Yes' : 'No') . PHP_EOL; |
58 | | -echo 'SQLite 3... ' . ($sqlite3_ok ? 'Yes' : 'No') . PHP_EOL; |
59 | | -echo 'PDO-SQLite driver... ' . ($pdo_sqlite_ok ? 'Yes' : 'No') . PHP_EOL; |
| 53 | +echo 'PHP 5.2 or newer... ' . ($php_ok ? (success() . ' ' . phpversion()) : failure()) . PHP_EOL; |
| 54 | +echo 'cURL with SSL... ' . ($curl_ok ? (success() . ' ' . $curl_version['version'] . ' (' . $curl_version['ssl_version'] . ')') : failure($curl_version['version'] . (in_array('https', $curl_version['protocols'], true) ? ' (with ' . $curl_version['ssl_version'] . ')' : ' (without SSL)'))) . PHP_EOL; |
| 55 | +echo 'Standard PHP Library... ' . ($spl_ok ? success() : failure()) . PHP_EOL; |
| 56 | +echo 'SimpleXML... ' . ($simplexml_ok ? success() : failure()) . PHP_EOL; |
| 57 | +echo 'JSON... ' . ($json_ok ? success() : failure()) . PHP_EOL; |
| 58 | +echo 'PCRE... ' . ($pcre_ok ? success() : failure()) . PHP_EOL; |
| 59 | +echo 'File system read/write... ' . ($file_ok ? success() : failure()) . PHP_EOL; |
| 60 | +echo 'OpenSSL extension... ' . ($openssl_ok ? success() : failure()) . PHP_EOL; |
| 61 | +echo 'Zlib... ' . ($zlib_ok ? success() : failure()) . PHP_EOL; |
| 62 | +echo 'APC... ' . ($apc_ok ? success() : failure()) . PHP_EOL; |
| 63 | +echo 'XCache... ' . ($xcache_ok ? success() : failure()) . PHP_EOL; |
| 64 | +echo 'Memcache... ' . ($memcache_ok ? success() : failure()) . PHP_EOL; |
| 65 | +echo 'Memcached... ' . ($memcached_ok ? success() : failure()) . PHP_EOL; |
| 66 | +echo 'PDO... ' . ($pdo_ok ? success() : failure()) . PHP_EOL; |
| 67 | +echo 'SQLite 2... ' . ($sqlite2_ok ? success() : failure()) . PHP_EOL; |
| 68 | +echo 'SQLite 3... ' . ($sqlite3_ok ? success() : failure()) . PHP_EOL; |
| 69 | +echo 'PDO-SQLite driver... ' . ($pdo_sqlite_ok ? success() : failure()) . PHP_EOL; |
60 | 70 | echo PHP_EOL; |
61 | 71 | |
62 | 72 | echo '----------------------------------------' . PHP_EOL; |
Index: trunk/extensions/OpenStackManager/aws-sdk/_docs/NOTICE.md |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | |
11 | 11 | <http://aws.amazon.com/php> |
12 | 12 | |
13 | | -Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 13 | +Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
14 | 14 | |
15 | 15 | Licensed under the Apache License, Version 2.0 (the "License"). |
16 | 16 | You may not use this file except in compliance with the License. |
Index: trunk/extensions/OpenStackManager/aws-sdk/_docs/CHANGELOG.md |
— | — | @@ -1,3 +1,73 @@ |
| 2 | +# Changelog: 1.2.3 "Fayth" |
| 3 | + |
| 4 | +Launched Monday, January 24, 2011 |
| 5 | + |
| 6 | +## New Features & Highlights (Summary) |
| 7 | +* Support for Amazon Simple Email Service has been added to the SDK. |
| 8 | + |
| 9 | +## Service Classes |
| 10 | +### AmazonSES |
| 11 | +* **New:** Support for Amazon Simple Email Service has been added to the SDK. |
| 12 | + |
| 13 | + |
| 14 | +---- |
| 15 | + |
| 16 | +# Changelog: 1.2.2 "Esper" |
| 17 | + |
| 18 | +Launched Tuesday, January 18, 2011 |
| 19 | + |
| 20 | +## New Features & Highlights (Summary) |
| 21 | +* Support for Amazon Elastic Beanstalk has been added to the SDK. |
| 22 | +* Bug fixes and enhancements: |
| 23 | + * [AWS PHP S3 Library is not working out of the box](https://forums.aws.amazon.com/thread.jspa?threadID=55174) |
| 24 | + * [Problem with create_mpu_object() and streaming_read_callback() in S3](https://forums.aws.amazon.com/thread.jspa?threadID=54541) |
| 25 | + * [Integrated Uranium235's GitHub contributions](https://github.com/Uranium235/aws-sdk-for-php/compare/Streaming) |
| 26 | + |
| 27 | +## Service Classes |
| 28 | +### AmazonElasticBeanstalk |
| 29 | +* **New:** Support for AWS Elastic Beanstalk has been added to the SDK. |
| 30 | + |
| 31 | +### AmazonS3 |
| 32 | +* **Fixed:** Major improvements to transferring data over streams. |
| 33 | + |
| 34 | +## Utility classes |
| 35 | +###RequestCore |
| 36 | +* **New:** Upgraded to version 1.4. |
| 37 | +* **Fixed:** Major improvements to transferring data over streams. |
| 38 | + |
| 39 | + |
| 40 | +---- |
| 41 | + |
| 42 | +# Changelog: 1.2.1 "Dio" |
| 43 | + |
| 44 | +Launched Friday, January 14, 2011 |
| 45 | + |
| 46 | + |
| 47 | +## New Features & Highlights (Summary) |
| 48 | +* Support for S3 Response Headers has been added to the SDK. |
| 49 | +* Bug fixes and enhancements: |
| 50 | + * [copy_object failed between regions](https://forums.aws.amazon.com/thread.jspa?threadID=56893) |
| 51 | + * [Possible S3 bug with multiple buckets?](https://forums.aws.amazon.com/thread.jspa?threadID=56561) |
| 52 | + |
| 53 | +## Service Classes |
| 54 | +### AmazonS3 |
| 55 | +* **New:** Support for S3 Response Headers has been added to the SDK. |
| 56 | +* **New:** Documentation for Amazon S3 has been updated to include large object support details. |
| 57 | +* **New:** The `abort_multipart_uploads_by_date()` method has been added to the SDK, which aborts multipart uploads that were initiated before a specific date. |
| 58 | +* **Fixed:** Resolved an issue where the resource prefix wasn't being reset correctly. |
| 59 | + |
| 60 | +## Utility classes |
| 61 | +### CFArray |
| 62 | +* **New:** Instantiating the class without passing an array will use an empty array instead. |
| 63 | +* **New:** Added the `compress()` method which removes null values from the array. |
| 64 | +* **New:** Added the `reindex()` method which reindexes all array elements starting at zero. |
| 65 | + |
| 66 | +## Compatibility Test |
| 67 | +* **New:** The command-line compatibility test now color-codes the responses. |
| 68 | + |
| 69 | + |
| 70 | +---- |
| 71 | + |
2 | 72 | # Changelog: 1.2 "Cloud" |
3 | 73 | |
4 | 74 | Launched Friday, December 3, 2010 |
Index: trunk/extensions/OpenStackManager/aws-sdk/_docs/CONTRIBUTORS.md |
— | — | @@ -2,17 +2,17 @@ |
3 | 3 | |
4 | 4 | ## AWS SDK for PHP Contributors |
5 | 5 | |
6 | | -Contributions were provided under the Apache 2.0 License, as appropriate. |
| 6 | +Contributions were provided under the Apache 2.0 License, as appropriate, unless otherwise specified. |
7 | 7 | |
8 | 8 | The following people have provided ideas, support and bug fixes: |
9 | 9 | |
10 | | -* [antischnorrer](http://developer.amazonwebservices.com/connect/profile.jspa?userID=152443) (bug fixes) |
11 | 10 | * [arech8](http://developer.amazonwebservices.com/connect/profile.jspa?userID=154435) (bug fixes) |
12 | 11 | * [Jeremy Archuleta](http://code.google.com/u/jeremy.archuleta/) (bug fixes) |
| 12 | +* [Paul Voegler](mailto:voegler@gmx.de) (bug fixes, bug reports, patches) |
13 | 13 | * [Peter Bowen](http://github.com/pzb) (feedback, bug reports) |
14 | 14 | |
15 | 15 | |
16 | | -## CloudFusion Contributors |
| 16 | +## CloudFusion/CacheCore/RequestCore Contributors |
17 | 17 | |
18 | 18 | Contributions were provided under the New BSD License, as appropriate. |
19 | 19 | |
— | — | @@ -47,6 +47,7 @@ |
48 | 48 | * [nickgsuperstar](http://code.google.com/u/nickgsuperstar/) (bug fixes) |
49 | 49 | * [ofpichon](http://code.google.com/u/ofpichon/) (bug fixes) |
50 | 50 | * [Otavio Ferreira](http://otaviofff.me) (bug fixes) |
| 51 | +* [Paul Voegler](mailto:voegler@gmx.de) (bug fixes, bug reports, patches) |
51 | 52 | * [Steve Brozosky](http://code.google.com/u/@UBZWSlJVBxhHXAN1/) (bug fixes) |
52 | 53 | * [Steve Chu](http://stevechu.org) (bug fixes) |
53 | 54 | * [tommusic](http://code.google.com/u/tommusic/) (bug fixes) |
Index: trunk/extensions/OpenStackManager/aws-sdk/sdk.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | * Core functionality and default settings shared across all SDK classes. All methods and properties in this class are inherited by the service-specific classes. |
21 | 21 | * |
22 | 22 | * Version: |
23 | | - * 2010.12.03 |
| 23 | + * 2011.01.14 |
24 | 24 | * |
25 | 25 | * License and Copyright: |
26 | 26 | * See the included NOTICE.md file for more information. |
— | — | @@ -117,9 +117,9 @@ |
118 | 118 | // INTERMEDIARY CONSTANTS |
119 | 119 | |
120 | 120 | define('CFRUNTIME_NAME', 'aws-sdk-php'); |
121 | | -define('CFRUNTIME_VERSION', '1.2'); |
| 121 | +define('CFRUNTIME_VERSION', '1.2.2'); |
122 | 122 | // define('CFRUNTIME_BUILD', gmdate('YmdHis', filemtime(__FILE__))); // @todo: Hardcode for release. |
123 | | -define('CFRUNTIME_BUILD', '20101203002835'); |
| 123 | +define('CFRUNTIME_BUILD', '20110118151007'); |
124 | 124 | define('CFRUNTIME_USERAGENT', CFRUNTIME_NAME . '/' . CFRUNTIME_VERSION . ' PHP/' . PHP_VERSION . ' ' . php_uname('s') . '/' . php_uname('r') . ' Arch/' . php_uname('m') . ' SAPI/' . php_sapi_name() . ' Integer/' . PHP_INT_MAX . ' Build/' . CFRUNTIME_BUILD . __aws_sdk_ua_callback()); |
125 | 125 | |
126 | 126 | |
Index: trunk/extensions/OpenStackManager/aws-sdk/utilities/hadoopstep.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
Index: trunk/extensions/OpenStackManager/aws-sdk/utilities/manifest.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
Index: trunk/extensions/OpenStackManager/aws-sdk/utilities/request.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
Index: trunk/extensions/OpenStackManager/aws-sdk/utilities/complextype.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
Index: trunk/extensions/OpenStackManager/aws-sdk/utilities/batchrequest.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
Index: trunk/extensions/OpenStackManager/aws-sdk/utilities/simplexml.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
Index: trunk/extensions/OpenStackManager/aws-sdk/utilities/info.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
Index: trunk/extensions/OpenStackManager/aws-sdk/utilities/utilities.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
Index: trunk/extensions/OpenStackManager/aws-sdk/utilities/mimetypes.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
Index: trunk/extensions/OpenStackManager/aws-sdk/utilities/array.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | * Wrapper for ArrayObject. |
21 | 21 | * |
22 | 22 | * Version: |
23 | | - * 2010.11.02 |
| 23 | + * 2010.12.06 |
24 | 24 | * |
25 | 25 | * License and Copyright: |
26 | 26 | * See the included NOTICE.md file for more information. |
— | — | @@ -47,14 +47,14 @@ |
48 | 48 | * public |
49 | 49 | * |
50 | 50 | * Parameters: |
51 | | - * $input - _mixed_ (Required) The input parameter accepts an array or an Object. |
| 51 | + * $input - _mixed_ (Optional) The input parameter accepts an array or an Object. The default value is an empty array. |
52 | 52 | * $flags - _int_ (Optional) Flags to control the behavior of the ArrayObject object. Defaults to `ArrayObject::STD_PROP_LIST`. |
53 | 53 | * $iterator_class - _string_ (Optional) Specify the class that will be used for iteration of the `ArrayObject` object. `ArrayIterator` is the default class used. |
54 | 54 | * |
55 | 55 | * Returns: |
56 | 56 | * _mixed_ Either an array of matches, or a single <CFSimpleXML> element. |
57 | 57 | */ |
58 | | - public function __construct($input, $flags = self::STD_PROP_LIST, $iterator_class = 'ArrayIterator') |
| 58 | + public function __construct($input = array(), $flags = self::STD_PROP_LIST, $iterator_class = 'ArrayIterator') |
59 | 59 | { |
60 | 60 | return parent::__construct($input, $flags, $iterator_class); |
61 | 61 | } |
— | — | @@ -263,4 +263,34 @@ |
264 | 264 | $items = $this->getArrayCopy(); |
265 | 265 | return count($items) ? end($items) : false; |
266 | 266 | } |
| 267 | + |
| 268 | + /** |
| 269 | + * Method: compress() |
| 270 | + * Removes all `null` values from an array. |
| 271 | + * |
| 272 | + * Access: |
| 273 | + * public |
| 274 | + * |
| 275 | + * Returns: |
| 276 | + * _CFArray_ A new <CFArray> object containing the non-null values. |
| 277 | + */ |
| 278 | + public function compress() |
| 279 | + { |
| 280 | + return new CFArray(array_filter($this->getArrayCopy())); |
| 281 | + } |
| 282 | + |
| 283 | + /** |
| 284 | + * Method: reindex() |
| 285 | + * Reindexes the array, starting from zero. |
| 286 | + * |
| 287 | + * Access: |
| 288 | + * public |
| 289 | + * |
| 290 | + * Returns: |
| 291 | + * _CFArray_ A new <CFArray> object with indexes starting at zero. |
| 292 | + */ |
| 293 | + public function reindex() |
| 294 | + { |
| 295 | + return new CFArray(array_values($this->getArrayCopy())); |
| 296 | + } |
267 | 297 | } |
Index: trunk/extensions/OpenStackManager/aws-sdk/utilities/response.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
Index: trunk/extensions/OpenStackManager/aws-sdk/utilities/policy.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |
Index: trunk/extensions/OpenStackManager/aws-sdk/utilities/stepconfig.class.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /* |
4 | | - * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 | + * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"). |
7 | 7 | * You may not use this file except in compliance with the License. |