Index: trunk/extensions/OpenStackManager/aws-sdk/services/sqs.class.php |
— | — | @@ -15,76 +15,61 @@ |
16 | 16 | */ |
17 | 17 | |
18 | 18 | /** |
| 19 | + * Amazon Simple Queue Service (Amazon SQS) offers a reliable, highly scalable, hosted queue for |
| 20 | + * storing messages as they travel between computers. By using Amazon SQS, developers can simply |
| 21 | + * move data between distributed components of their applications that perform different tasks, |
| 22 | + * without losing messages or requiring each component to be always available. Amazon SQS makes it |
| 23 | + * easy to build an automated workflow, working in close conjunction with the Amazon Elastic |
| 24 | + * Compute Cloud (Amazon EC2) and the other AWS infrastructure web services. |
19 | 25 | * |
| 26 | + * Amazon SQS works by exposing Amazon's web-scale messaging infrastructure as a web service. Any |
| 27 | + * computer on the Internet can add or read messages without any installed software or special |
| 28 | + * firewall configurations. Components of applications using Amazon SQS can run independently, and |
| 29 | + * do not need to be on the same network, developed with the same technologies, or running at the |
| 30 | + * same time. |
20 | 31 | * |
21 | | - * Amazon Simple Queue Service (Amazon SQS) offers a reliable, highly scalable, hosted queue for storing messages as they travel between |
22 | | - * computers. By using Amazon SQS, developers can simply move data between distributed components of their applications that perform different |
23 | | - * tasks, without losing messages or requiring each component to be always available. Amazon SQS makes it easy to build an automated workflow, |
24 | | - * working in close conjunction with the Amazon Elastic Compute Cloud (Amazon EC2) and the other AWS infrastructure web services. |
25 | | - * |
26 | | - * Amazon SQS works by exposing Amazon's web-scale messaging infrastructure as a web service. Any computer on the Internet can add or read |
27 | | - * messages without any installed software or special firewall configurations. Components of applications using Amazon SQS can run |
28 | | - * independently, and do not need to be on the same network, developed with the same technologies, or running at the same time. |
29 | | - * |
30 | 32 | * Visit <a href="http://aws.amazon.com/sqs/">http://aws.amazon.com/sqs/</a> for more information. |
31 | 33 | * |
32 | | - * @version Thu Sep 01 21:24:22 PDT 2011 |
| 34 | + * @version 2011.10.20 |
33 | 35 | * @license See the included NOTICE.md file for complete information. |
34 | 36 | * @copyright See the included NOTICE.md file for complete information. |
35 | | - * @link http://aws.amazon.com/sqs/Amazon Simple Queue Service |
36 | | - * @link http://aws.amazon.com/documentation/sqs/Amazon Simple Queue Service documentation |
| 37 | + * @link http://aws.amazon.com/sqs/ Amazon Simple Queue Service |
| 38 | + * @link http://aws.amazon.com/sqs/documentation/ Amazon Simple Queue Service documentation |
37 | 39 | */ |
38 | 40 | class AmazonSQS extends CFRuntime |
39 | 41 | { |
40 | | - |
41 | 42 | /*%******************************************************************************************%*/ |
42 | 43 | // CLASS CONSTANTS |
43 | 44 | |
44 | 45 | /** |
45 | | - * Specify the default queue URL. |
| 46 | + * Specify the queue URL for the United States East (Northern Virginia) Region. |
46 | 47 | */ |
47 | | - const DEFAULT_URL = 'sqs.us-east-1.amazonaws.com'; |
| 48 | + const REGION_US_E1 = 'sqs.us-east-1.amazonaws.com'; |
48 | 49 | |
49 | 50 | /** |
50 | | - * Specify the queue URL for the US-East (Northern Virginia) Region. |
| 51 | + * Specify the queue URL for the United States West (Northern California) Region. |
51 | 52 | */ |
52 | | - const REGION_US_E1 = self::DEFAULT_URL; |
53 | | - |
54 | | - /** |
55 | | - * Specify the queue URL for the US-West (Northern California) Region. |
56 | | - */ |
57 | 53 | const REGION_US_W1 = 'sqs.us-west-1.amazonaws.com'; |
58 | 54 | |
59 | 55 | /** |
60 | | - * Specify the queue URL for the EU (Ireland) Region. |
| 56 | + * Specify the queue URL for the Europe West (Ireland) Region. |
61 | 57 | */ |
62 | 58 | const REGION_EU_W1 = 'sqs.eu-west-1.amazonaws.com'; |
63 | 59 | |
64 | 60 | /** |
65 | | - * Specify the queue URL for the Asia Pacific (Singapore) Region. |
| 61 | + * Specify the queue URL for the Asia Pacific Southeast (Singapore) Region. |
66 | 62 | */ |
67 | 63 | const REGION_APAC_SE1 = 'sqs.ap-southeast-1.amazonaws.com'; |
68 | 64 | |
69 | 65 | /** |
70 | | - * Specify the queue URL for the Asia Pacific (Japan) Region. |
| 66 | + * Specify the queue URL for the Asia Pacific Northeast (Tokyo) Region. |
71 | 67 | */ |
72 | 68 | const REGION_APAC_NE1 = 'sqs.ap-northeast-1.amazonaws.com'; |
73 | 69 | |
74 | | - |
75 | | - /*%******************************************************************************************%*/ |
76 | | - // SETTERS |
77 | | - |
78 | 70 | /** |
79 | | - * This allows you to explicitly sets the region for the service to use. |
80 | | - * |
81 | | - * @param string $region (Required) The region to use for subsequent Amazon S3 operations. [Allowed values: `AmazonSQS::REGION_US_E1 `, `AmazonSQS::REGION_US_W1`, `AmazonSQS::REGION_EU_W1`, `AmazonSQS::REGION_APAC_SE1`] |
82 | | - * @return $this A reference to the current instance. |
| 71 | + * Default service endpoint. |
83 | 72 | */ |
84 | | - public function set_region($region) |
85 | | - { |
86 | | - $this->set_hostname($region); |
87 | | - return $this; |
88 | | - } |
| 73 | + const DEFAULT_URL = self::REGION_US_E1; |
89 | 74 | |
90 | 75 | |
91 | 76 | /*%******************************************************************************************%*/ |
— | — | @@ -166,7 +151,7 @@ |
167 | 152 | */ |
168 | 153 | public function __construct($key = null, $secret_key = null, $token = null) |
169 | 154 | { |
170 | | - $this->api_version = '2009-02-01'; |
| 155 | + $this->api_version = '2011-10-01'; |
171 | 156 | $this->hostname = self::DEFAULT_URL; |
172 | 157 | |
173 | 158 | if (!$key && !defined('AWS_KEY')) |
— | — | @@ -193,73 +178,96 @@ |
194 | 179 | |
195 | 180 | |
196 | 181 | /*%******************************************************************************************%*/ |
197 | | - // SERVICE METHODS |
| 182 | + // SETTERS |
198 | 183 | |
199 | 184 | /** |
| 185 | + * This allows you to explicitly sets the region for the service to use. |
200 | 186 | * |
201 | | - * Returns a list of your queues. |
202 | | - * |
203 | | - * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul> |
204 | | - * <li><code>QueueNamePrefix</code> - <code>string</code> - Optional - A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned. </li> |
205 | | - * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li> |
206 | | - * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul> |
207 | | - * @return CFResponse A <CFResponse> object containing a parsed HTTP response. |
| 187 | + * @param string $region (Required) The region to explicitly set. Available options are <REGION_US_E1>, <REGION_US_W1>, <REGION_EU_W1>, <REGION_APAC_SE1>, <REGION_APAC_NE1>. |
| 188 | + * @return $this A reference to the current instance. |
208 | 189 | */ |
209 | | - public function list_queues($opt = null) |
| 190 | + public function set_region($region) |
210 | 191 | { |
211 | | - if (!$opt) $opt = array(); |
212 | | - |
213 | | - return $this->authenticate('ListQueues', $opt, $this->hostname); |
| 192 | + $this->set_hostname($region); |
| 193 | + return $this; |
214 | 194 | } |
215 | 195 | |
| 196 | + |
| 197 | + /*%******************************************************************************************%*/ |
| 198 | + // SERVICE METHODS |
| 199 | + |
216 | 200 | /** |
| 201 | + * The AddPermission action adds a permission to a queue for a specific <a href= |
| 202 | + * "http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Glossary.html#d0e3892"> |
| 203 | + * principal</a>. This allows for sharing access to the queue. |
217 | 204 | * |
218 | | - * Sets an attribute of a queue. Currently, you can set only the <code>VisibilityTimeout</code> attribute for a queue. |
| 205 | + * When you create a queue, you have full control access rights for the queue. Only you (as owner |
| 206 | + * of the queue) can grant or deny permissions to the queue. For more information about these |
| 207 | + * permissions, see <a href= |
| 208 | + * "http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/?acp-overview.html"> |
| 209 | + * Shared Queues</a> in the Amazon SQS Developer Guide. |
219 | 210 | * |
| 211 | + * <code>AddPermission</code> writes an SQS-generated policy. If you want to write your own |
| 212 | + * policy, use SetQueueAttributes to upload your policy. For more information about writing your |
| 213 | + * own policy, see <a href= |
| 214 | + * "http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/?AccessPolicyLanguage.html"> |
| 215 | + * Appendix: The Access Policy Language</a> in the Amazon SQS Developer Guide. |
| 216 | + * |
220 | 217 | * @param string $queue_url (Required) The URL of the SQS queue to take action on. |
221 | | - * @param array $attribute (Required) A list of attributes to set. <ul> |
222 | | - * <li><code>x</code> - <code>array</code> - This represents a simple array index. <ul> |
223 | | - * <li><code>Name</code> - <code>string</code> - Optional - The name of the queue attribute to set a custom value for. [Allowed values: <code>Policy</code>, <code>VisibilityTimeout</code>, <code>MaximumMessageSize</code>, <code>MessageRetentionPeriod</code>, <code>ApproximateNumberOfMessages</code>, <code>ApproximateNumberOfMessagesNotVisible</code>, <code>CreatedTimestamp</code>, <code>LastModifiedTimestamp</code>]</li> |
224 | | - * <li><code>Value</code> - <code>string</code> - Optional - The custom value to assign for the matching attribute key. </li> |
225 | | - * </ul></li> |
226 | | - * </ul> |
| 218 | + * @param string $label (Required) The unique identification of the permission you're setting (e.g., <code>AliceSendMessage</code>). Constraints: Maximum 80 characters; alphanumeric characters, hyphens (-), and underscores (_) are allowed. |
| 219 | + * @param string|array $aws_account_id (Required) The AWS account number of the <a href="http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Glossary.html">principal</a> who will be given permission. The principal must have an AWS account, but does not need to be signed up for Amazon SQS. Pass a string for a single value, or an indexed array for multiple values. |
| 220 | + * @param string|array $action_name (Required) The action the client wants to allow for the specified principal. Pass a string for a single value, or an indexed array for multiple values. |
227 | 221 | * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul> |
228 | 222 | * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li> |
229 | 223 | * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul> |
230 | 224 | * @return CFResponse A <CFResponse> object containing a parsed HTTP response. |
231 | 225 | */ |
232 | | - public function set_queue_attributes($queue_url, $attribute, $opt = null) |
| 226 | + public function add_permission($queue_url, $label, $aws_account_id, $action_name, $opt = null) |
233 | 227 | { |
234 | 228 | if (!$opt) $opt = array(); |
| 229 | + $opt['Label'] = $label; |
235 | 230 | |
236 | | - // Required parameter |
| 231 | + // Required list (non-map) |
237 | 232 | $opt = array_merge($opt, CFComplexType::map(array( |
238 | | - 'Attribute' => (is_array($attribute) ? $attribute : array($attribute)) |
| 233 | + 'AWSAccountId' => (is_array($aws_account_id) ? $aws_account_id : array($aws_account_id)) |
239 | 234 | ))); |
240 | 235 | |
241 | | - return $this->authenticate('SetQueueAttributes', $opt, $queue_url); |
| 236 | + // Required list (non-map) |
| 237 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 238 | + 'ActionName' => (is_array($action_name) ? $action_name : array($action_name)) |
| 239 | + ))); |
| 240 | + |
| 241 | + return $this->authenticate('AddPermission', $opt, $queue_url); |
242 | 242 | } |
243 | 243 | |
244 | 244 | /** |
| 245 | + * The <code>ChangeMessageVisibility</code> action changes the visibility timeout of a specified |
| 246 | + * message in a queue to a new value. The maximum allowed timeout value you can set the value to |
| 247 | + * is 12 hours. This means you can't extend the timeout of a message in an existing queue to more |
| 248 | + * than a total visibility timeout of 12 hours. (For more information visibility timeout, see |
| 249 | + * <a href= |
| 250 | + * "http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AboutVT.html"> |
| 251 | + * Visibility Timeout</a> in the Amazon SQS Developer Guide.) |
245 | 252 | * |
246 | | - * The <code>ChangeMessageVisibility</code> action changes the visibility timeout of a specified message in a queue to a new value. The maximum |
247 | | - * allowed timeout value you can set the value to is 12 hours. This means you can't extend the timeout of a message in an existing queue to |
248 | | - * more than a total visibility timeout of 12 hours. (For more information visibility timeout, see <a |
249 | | - * href="http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AboutVT.html">Visibility Timeout</a> in the Amazon |
250 | | - * SQS Developer Guide.) |
| 253 | + * For example, let's say you have a message and its default message visibility timeout is 30 |
| 254 | + * minutes. You could call <code>ChangeMessageVisiblity</code> with a value of two hours and the |
| 255 | + * effective timeout would be two hours and 30 minutes. When that time comes near you could again |
| 256 | + * extend the time out by calling ChangeMessageVisiblity, but this time the maximum allowed |
| 257 | + * timeout would be 9 hours and 30 minutes. |
251 | 258 | * |
252 | | - * For example, let's say you have a message and its default message visibility timeout is 30 minutes. You could call |
253 | | - * <code>ChangeMessageVisiblity</code> with a value of two hours and the effective timeout would be two hours and 30 minutes. When that time |
254 | | - * comes near you could again extend the time out by calling ChangeMessageVisiblity, but this time the maximum allowed timeout would be 9 hours |
255 | | - * and 30 minutes. |
| 259 | + * <p class="important"> |
| 260 | + * If you attempt to set the <code>VisibilityTimeout</code> to an amount more than the maximum |
| 261 | + * time left, Amazon SQS returns an error. It will not automatically recalculate and increase the |
| 262 | + * timeout to the maximum time remaining. |
| 263 | + * </p> |
| 264 | + * <p class="important"> |
| 265 | + * Unlike with a queue, when you change the visibility timeout for a specific message, that |
| 266 | + * timeout value is applied immediately but is not saved in memory for that message. If you don't |
| 267 | + * delete a message after it is received, the visibility timeout for the message the next time it |
| 268 | + * is received reverts to the original timeout value, not the value you set with the |
| 269 | + * ChangeMessageVisibility action. |
| 270 | + * </p> |
256 | 271 | * |
257 | | - * If you attempt to set the <code>VisibilityTimeout</code> to an amount more than the maximum time left, Amazon SQS returns an error. It will |
258 | | - * not automatically recalculate and increase the timeout to the maximum time remaining. |
259 | | - * |
260 | | - * Unlike with a queue, when you change the visibility timeout for a specific message, that timeout value is applied immediately but is not |
261 | | - * saved in memory for that message. If you don't delete a message after it is received, the visibility timeout for the message the next time |
262 | | - * it is received reverts to the original timeout value, not the value you set with the ChangeMessageVisibility action. |
263 | | - * |
264 | 272 | * @param string $queue_url (Required) The URL of the SQS queue to take action on. |
265 | 273 | * @param string $receipt_handle (Required) The receipt handle associated with the message whose visibility timeout should be changed. |
266 | 274 | * @param integer $visibility_timeout (Required) The new value (in seconds) for the message's visibility timeout. |
— | — | @@ -278,18 +286,56 @@ |
279 | 287 | } |
280 | 288 | |
281 | 289 | /** |
| 290 | + * This is a batch version of <code>ChangeMessageVisibility</code>. It takes multiple receipt |
| 291 | + * handles and performs the operation on each of the them. The result of the operation on each |
| 292 | + * message is reported individually in the response. |
282 | 293 | * |
283 | | - * The <code>CreateQueue</code> action creates a new queue, or returns the URL of an existing one. When you request <code>CreateQueue</code>, |
284 | | - * you provide a name for the queue. To successfully create a new queue, you must provide a name that is unique within the scope of your own |
285 | | - * queues. If you provide the name of an existing queue, a new queue isn't created and an error isn't returned. Instead, the request succeeds |
286 | | - * and the queue URL for the existing queue is returned. |
| 294 | + * @param string $queue_url (Required) The URL of the SQS queue to take action on. |
| 295 | + * @param array $change_message_visibility_batch_request_entry (Required) A list of receipt handles of the messages for which the visibility timeout must be changed. <ul> |
| 296 | + * <li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul> |
| 297 | + * <li><code>Id</code> - <code>string</code> - Required - An identifier for this particular receipt handle. This is used to communicate the result. Note that the <code>Id</code> s of a batch request need to be unique within the request.</li> |
| 298 | + * <li><code>ReceiptHandle</code> - <code>string</code> - Required - A receipt handle.</li> |
| 299 | + * <li><code>VisibilityTimeout</code> - <code>integer</code> - Optional - The new value (in seconds) for the message's visibility timeout.</li> |
| 300 | + * </ul></li> |
| 301 | + * </ul> |
| 302 | + * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul> |
| 303 | + * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li> |
| 304 | + * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul> |
| 305 | + * @return CFResponse A <CFResponse> object containing a parsed HTTP response. |
| 306 | + */ |
| 307 | + public function change_message_visibility_batch($queue_url, $change_message_visibility_batch_request_entry, $opt = null) |
| 308 | + { |
| 309 | + if (!$opt) $opt = array(); |
| 310 | + |
| 311 | + // Required list + map |
| 312 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 313 | + 'ChangeMessageVisibilityBatchRequestEntry' => (is_array($change_message_visibility_batch_request_entry) ? $change_message_visibility_batch_request_entry : array($change_message_visibility_batch_request_entry)) |
| 314 | + ))); |
| 315 | + |
| 316 | + return $this->authenticate('ChangeMessageVisibilityBatch', $opt, $queue_url); |
| 317 | + } |
| 318 | + |
| 319 | + /** |
| 320 | + * The <code>CreateQueue</code> action creates a new queue, or returns the URL of an existing one. |
| 321 | + * When you request <code>CreateQueue</code>, you provide a name for the queue. To successfully |
| 322 | + * create a new queue, you must provide a name that is unique within the scope of your own queues. |
287 | 323 | * |
288 | | - * If you provide a value for <code>DefaultVisibilityTimeout</code> that is different from the value for the existing queue, you receive an |
289 | | - * error. |
| 324 | + * You may pass one or more attributes in the request. If you do not provide a value for any |
| 325 | + * attribute, the queue will have the default value for that attribute. Permitted attributes are |
| 326 | + * the same that can be set using <code>SetQueueAttributes</code>. |
290 | 327 | * |
| 328 | + * If you provide the name of an existing queue, a new queue isn't created. If the values of |
| 329 | + * attributes provided with the request match up with those on the existing queue, the queue URL |
| 330 | + * is returned. Otherwise, a <code>QueueNameExists</code> error is returned. |
| 331 | + * |
291 | 332 | * @param string $queue_name (Required) The name for the queue to be created. |
292 | 333 | * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul> |
293 | | - * <li><code>DefaultVisibilityTimeout</code> - <code>integer</code> - Optional - The visibility timeout (in seconds) to use for the created queue. </li> |
| 334 | + * <li><code>Attribute</code> - <code>array</code> - Optional - A map of attributes with their corresponding values. <ul> |
| 335 | + * <li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul> |
| 336 | + * <li><code>Name</code> - <code>string</code> - Optional - The name of a queue attribute. [Allowed values: <code>Policy</code>, <code>VisibilityTimeout</code>, <code>MaximumMessageSize</code>, <code>MessageRetentionPeriod</code>, <code>ApproximateNumberOfMessages</code>, <code>ApproximateNumberOfMessagesNotVisible</code>, <code>CreatedTimestamp</code>, <code>LastModifiedTimestamp</code>, <code>QueueArn</code>, <code>ApproximateNumberOfMessagesDelayed</code>, <code>DelaySeconds</code>]</li> |
| 337 | + * <li><code>Value</code> - <code>string</code> - Optional - The value of a queue attribute.</li> |
| 338 | + * </ul></li> |
| 339 | + * </ul></li> |
294 | 340 | * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li> |
295 | 341 | * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul> |
296 | 342 | * @return CFResponse A <CFResponse> object containing a parsed HTTP response. |
— | — | @@ -299,46 +345,128 @@ |
300 | 346 | if (!$opt) $opt = array(); |
301 | 347 | $opt['QueueName'] = $queue_name; |
302 | 348 | |
| 349 | + // Optional map (non-list) |
| 350 | + if (isset($opt['Attribute'])) |
| 351 | + { |
| 352 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 353 | + 'Attribute' => $opt['Attribute'] |
| 354 | + ))); |
| 355 | + unset($opt['Attribute']); |
| 356 | + } |
| 357 | + |
303 | 358 | return $this->authenticate('CreateQueue', $opt, $this->hostname); |
304 | 359 | } |
305 | 360 | |
306 | 361 | /** |
| 362 | + * The <code>DeleteMessage</code> action unconditionally removes the specified message from the |
| 363 | + * specified queue. Even if the message is locked by another reader due to the visibility timeout |
| 364 | + * setting, it is still deleted from the queue. |
307 | 365 | * |
308 | | - * The <code>RemovePermission</code> action revokes any permissions in the queue policy that matches the specified <code>Label</code> |
309 | | - * parameter. Only the owner of the queue can remove permissions. |
| 366 | + * @param string $queue_url (Required) The URL of the SQS queue to take action on. |
| 367 | + * @param string $receipt_handle (Required) The receipt handle associated with the message to delete. |
| 368 | + * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul> |
| 369 | + * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li> |
| 370 | + * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul> |
| 371 | + * @return CFResponse A <CFResponse> object containing a parsed HTTP response. |
| 372 | + */ |
| 373 | + public function delete_message($queue_url, $receipt_handle, $opt = null) |
| 374 | + { |
| 375 | + if (!$opt) $opt = array(); |
| 376 | + $opt['ReceiptHandle'] = $receipt_handle; |
| 377 | + |
| 378 | + return $this->authenticate('DeleteMessage', $opt, $queue_url); |
| 379 | + } |
| 380 | + |
| 381 | + /** |
| 382 | + * This is a batch version of <code>DeleteMessage</code>. It takes multiple receipt handles and |
| 383 | + * deletes each one of the messages. The result of the delete operation on each message is |
| 384 | + * reported individually in the response. |
310 | 385 | * |
311 | 386 | * @param string $queue_url (Required) The URL of the SQS queue to take action on. |
312 | | - * @param string $label (Required) The identfication of the permission to remove. This is the label added with the AddPermission operation. |
| 387 | + * @param array $delete_message_batch_request_entry (Required) A list of receipt handles for the messages to be deleted. <ul> |
| 388 | + * <li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul> |
| 389 | + * <li><code>Id</code> - <code>string</code> - Required - An identifier for this particular receipt handle. This is used to communicate the result. Note that the <code>Id</code> s of a batch request need to be unique within the request.</li> |
| 390 | + * <li><code>ReceiptHandle</code> - <code>string</code> - Required - A receipt handle.</li> |
| 391 | + * </ul></li> |
| 392 | + * </ul> |
313 | 393 | * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul> |
314 | 394 | * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li> |
315 | 395 | * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul> |
316 | 396 | * @return CFResponse A <CFResponse> object containing a parsed HTTP response. |
317 | 397 | */ |
318 | | - public function remove_permission($queue_url, $label, $opt = null) |
| 398 | + public function delete_message_batch($queue_url, $delete_message_batch_request_entry, $opt = null) |
319 | 399 | { |
320 | 400 | if (!$opt) $opt = array(); |
321 | | - $opt['Label'] = $label; |
322 | 401 | |
323 | | - return $this->authenticate('RemovePermission', $opt, $queue_url); |
| 402 | + // Required list + map |
| 403 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 404 | + 'DeleteMessageBatchRequestEntry' => (is_array($delete_message_batch_request_entry) ? $delete_message_batch_request_entry : array($delete_message_batch_request_entry)) |
| 405 | + ))); |
| 406 | + |
| 407 | + return $this->authenticate('DeleteMessageBatch', $opt, $queue_url); |
324 | 408 | } |
325 | 409 | |
326 | 410 | /** |
| 411 | + * This action unconditionally deletes the queue specified by the queue URL. Use this operation |
| 412 | + * WITH CARE! The queue is deleted even if it is NOT empty. |
327 | 413 | * |
328 | | - * Gets one or all attributes of a queue. Queues currently have two attributes you can get: <code>ApproximateNumberOfMessages</code> and |
329 | | - * <code>VisibilityTimeout</code>. |
| 414 | + * Once a queue has been deleted, the queue name is unavailable for use with new queues for 60 |
| 415 | + * seconds. |
330 | 416 | * |
331 | 417 | * @param string $queue_url (Required) The URL of the SQS queue to take action on. |
332 | 418 | * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul> |
333 | | - * <li><code>AttributeName</code> - <code>string|array</code> - Optional - A list of attributes to retrieve information for. Pass a string for a single value, or an indexed array for multiple values. </li> |
334 | 419 | * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li> |
335 | 420 | * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul> |
336 | 421 | * @return CFResponse A <CFResponse> object containing a parsed HTTP response. |
337 | 422 | */ |
| 423 | + public function delete_queue($queue_url, $opt = null) |
| 424 | + { |
| 425 | + if (!$opt) $opt = array(); |
| 426 | + |
| 427 | + return $this->authenticate('DeleteQueue', $opt, $queue_url); |
| 428 | + } |
| 429 | + |
| 430 | + /** |
| 431 | + * Gets attributes for the specified queue. The following attributes are supported: |
| 432 | + * |
| 433 | + * <ul> |
| 434 | + * <li><code>All</code> - returns all values.</li> |
| 435 | + * <li><code>ApproximateNumberOfMessages</code> - returns the approximate number of visible |
| 436 | + * messages in a queue. For more information, see Resources Required to Process Messages in |
| 437 | + * the Amazon SQS Developer Guide.</li> |
| 438 | + * <li><code>ApproximateNumberOfMessagesNotVisible</code> - returns the approximate number of |
| 439 | + * messages that are not timed-out and not deleted. For more information, see Resources |
| 440 | + * Required to Process Messages in the Amazon SQS Developer Guide.</li> |
| 441 | + * <li><code>VisibilityTimeout</code> - returns the visibility timeout for the queue. For more |
| 442 | + * information about visibility timeout, see Visibility Timeout in the Amazon SQS Developer |
| 443 | + * Guide.</li> |
| 444 | + * <li><code>CreatedTimestamp</code> - returns the time when the queue was created (epoch time in |
| 445 | + * seconds).</li> |
| 446 | + * <li><code>LastModifiedTimestamp</code> - returns the time when the queue was last changed |
| 447 | + * (epoch time in seconds).</li> |
| 448 | + * <li><code>Policy</code> - returns the queue's policy.</li> |
| 449 | + * <li><code>MaximumMessageSize</code> - returns the limit of how many bytes a message can contain |
| 450 | + * before Amazon SQS rejects it.</li> |
| 451 | + * <li><code>MessageRetentionPeriod</code> - returns the number of seconds Amazon SQS retains a |
| 452 | + * message.</li> |
| 453 | + * <li><code>QueueArn</code> - returns the queue's Amazon resource name (ARN).</li> |
| 454 | + * <li><code>ApproximateNumberOfMessagesDelayed</code> - returns the approximate number of |
| 455 | + * messages that are pending to be added to the queue.</li> |
| 456 | + * <li><code>DelaySeconds</code> - returns the default delay on the queue in seconds.</li> |
| 457 | + * </ul> |
| 458 | + * |
| 459 | + * @param string $queue_url (Required) The URL of the SQS queue to take action on. |
| 460 | + * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul> |
| 461 | + * <li><code>AttributeName</code> - <code>string|array</code> - Optional - A list of attributes to retrieve information for. Pass a string for a single value, or an indexed array for multiple values.</li> |
| 462 | + * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li> |
| 463 | + * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul> |
| 464 | + * @return CFResponse A <CFResponse> object containing a parsed HTTP response. |
| 465 | + */ |
338 | 466 | public function get_queue_attributes($queue_url, $opt = null) |
339 | 467 | { |
340 | 468 | if (!$opt) $opt = array(); |
341 | 469 | |
342 | | - // Optional parameter |
| 470 | + // Optional list (non-map) |
343 | 471 | if (isset($opt['AttributeName'])) |
344 | 472 | { |
345 | 473 | $opt = array_merge($opt, CFComplexType::map(array( |
— | — | @@ -351,95 +479,99 @@ |
352 | 480 | } |
353 | 481 | |
354 | 482 | /** |
| 483 | + * The <code>GetQueueUrl</code> action returns the URL of an existing queue. |
355 | 484 | * |
356 | | - * The AddPermission action adds a permission to a queue for a specific <a |
357 | | - * href="http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/APIReference/Glossary.html#d0e3892">principal</a>. This allows for |
358 | | - * sharing access to the queue. |
359 | | - * |
360 | | - * When you create a queue, you have full control access rights for the queue. Only you (as owner of the queue) can grant or deny permissions |
361 | | - * to the queue. For more information about these permissions, see <a |
362 | | - * href="http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/?acp-overview.html">Shared Queues</a> in the Amazon |
363 | | - * SQS Developer Guide. |
364 | | - * |
365 | | - * <code>AddPermission</code> writes an SQS-generated policy. If you want to write your own policy, use SetQueueAttributes to upload your |
366 | | - * policy. For more information about writing your own policy, see <a |
367 | | - * href="http://docs.amazonwebservices.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/?AccessPolicyLanguage.html">Appendix: The Access |
368 | | - * Policy Language</a> in the Amazon SQS Developer Guide. |
369 | | - * |
370 | | - * @param string $queue_url (Required) The URL of the SQS queue to take action on. |
371 | | - * @param string $label (Required) The unique identification of the permission you're setting (e.g., <code>AliceSendMessage</code>). Constraints: Maximum 80 characters; alphanumeric characters, hyphens (-), and underscores (_) are allowed. |
372 | | - * @param string|array $account_id (Required) The AWS account number of the principal who will be given permission. The principal must have an AWS account, but does not need to be signed up for Amazon SQS. Pass a string for a single value, or an indexed array for multiple values. |
373 | | - * @param string|array $action_name (Required) The action the client wants to allow for the specified principal. Pass a string for a single value, or an indexed array for multiple values. |
| 485 | + * @param string $queue_name (Required) The name of the queue whose URL must be fetched. |
374 | 486 | * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul> |
| 487 | + * <li><code>QueueOwnerAWSAccountId</code> - <code>string</code> - Optional - The AWS account number of the queue's owner.</li> |
375 | 488 | * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li> |
376 | 489 | * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul> |
377 | 490 | * @return CFResponse A <CFResponse> object containing a parsed HTTP response. |
378 | 491 | */ |
379 | | - public function add_permission($queue_url, $label, $account_id, $action_name, $opt = null) |
| 492 | + public function get_queue_url($queue_name, $opt = null) |
380 | 493 | { |
381 | 494 | if (!$opt) $opt = array(); |
382 | | - $opt['Label'] = $label; |
| 495 | + $opt['QueueName'] = $queue_name; |
383 | 496 | |
384 | | - // Required parameter |
385 | | - $opt = array_merge($opt, CFComplexType::map(array( |
386 | | - 'AWSAccountId' => (is_array($account_id) ? $account_id : array($account_id)) |
387 | | - ))); |
| 497 | + return $this->authenticate('GetQueueUrl', $opt, $this->hostname); |
| 498 | + } |
388 | 499 | |
389 | | - // Required parameter |
390 | | - $opt = array_merge($opt, CFComplexType::map(array( |
391 | | - 'ActionName' => (is_array($action_name) ? $action_name : array($action_name)) |
392 | | - ))); |
| 500 | + /** |
| 501 | + * Returns a list of your queues. |
| 502 | + * |
| 503 | + * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul> |
| 504 | + * <li><code>QueueNamePrefix</code> - <code>string</code> - Optional - A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.</li> |
| 505 | + * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li> |
| 506 | + * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul> |
| 507 | + * @return CFResponse A <CFResponse> object containing a parsed HTTP response. |
| 508 | + */ |
| 509 | + public function list_queues($opt = null) |
| 510 | + { |
| 511 | + if (!$opt) $opt = array(); |
393 | 512 | |
394 | | - return $this->authenticate('AddPermission', $opt, $queue_url); |
| 513 | + return $this->authenticate('ListQueues', $opt, $this->hostname); |
395 | 514 | } |
396 | 515 | |
397 | 516 | /** |
| 517 | + * Retrieves one or more messages from the specified queue, including the message body and message |
| 518 | + * ID of each message. Messages returned by this action stay in the queue until you delete them. |
| 519 | + * However, once a message is returned to a <code>ReceiveMessage</code> request, it is not |
| 520 | + * returned on subsequent <code>ReceiveMessage</code> requests for the duration of the |
| 521 | + * <code>VisibilityTimeout</code>. If you do not specify a <code>VisibilityTimeout</code> in the |
| 522 | + * request, the overall visibility timeout for the queue is used for the returned messages. |
398 | 523 | * |
399 | | - * This action unconditionally deletes the queue specified by the queue URL. Use this operation WITH CARE! The queue is deleted even if it is |
400 | | - * NOT empty. |
401 | | - * |
402 | | - * Once a queue has been deleted, the queue name is unavailable for use with new queues for 60 seconds. |
403 | | - * |
404 | 524 | * @param string $queue_url (Required) The URL of the SQS queue to take action on. |
405 | 525 | * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul> |
| 526 | + * <li><code>AttributeName</code> - <code>string|array</code> - Optional - A list of attributes to retrieve information for. Pass a string for a single value, or an indexed array for multiple values.</li> |
| 527 | + * <li><code>MaxNumberOfMessages</code> - <code>integer</code> - Optional - The maximum number of messages to return. Amazon SQS never returns more messages than this value but may return fewer. All of the messages are not necessarily returned.</li> |
| 528 | + * <li><code>VisibilityTimeout</code> - <code>integer</code> - Optional - The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a <code>ReceiveMessage</code> request.</li> |
406 | 529 | * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li> |
407 | 530 | * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul> |
408 | 531 | * @return CFResponse A <CFResponse> object containing a parsed HTTP response. |
409 | 532 | */ |
410 | | - public function delete_queue($queue_url, $opt = null) |
| 533 | + public function receive_message($queue_url, $opt = null) |
411 | 534 | { |
412 | 535 | if (!$opt) $opt = array(); |
413 | 536 | |
414 | | - return $this->authenticate('DeleteQueue', $opt, $queue_url); |
| 537 | + // Optional list (non-map) |
| 538 | + if (isset($opt['AttributeName'])) |
| 539 | + { |
| 540 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 541 | + 'AttributeName' => (is_array($opt['AttributeName']) ? $opt['AttributeName'] : array($opt['AttributeName'])) |
| 542 | + ))); |
| 543 | + unset($opt['AttributeName']); |
| 544 | + } |
| 545 | + |
| 546 | + return $this->authenticate('ReceiveMessage', $opt, $queue_url); |
415 | 547 | } |
416 | 548 | |
417 | 549 | /** |
| 550 | + * The <code>RemovePermission</code> action revokes any permissions in the queue policy that |
| 551 | + * matches the specified <code>Label</code> parameter. Only the owner of the queue can remove |
| 552 | + * permissions. |
418 | 553 | * |
419 | | - * The <code>DeleteMessage</code> action unconditionally removes the specified message from the specified queue. Even if the message is locked |
420 | | - * by another reader due to the visibility timeout setting, it is still deleted from the queue. |
421 | | - * |
422 | 554 | * @param string $queue_url (Required) The URL of the SQS queue to take action on. |
423 | | - * @param string $receipt_handle (Required) The receipt handle associated with the message to delete. |
| 555 | + * @param string $label (Required) The identification of the permission to remove. This is the label added with the <code>AddPermission</code> operation. |
424 | 556 | * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul> |
425 | 557 | * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li> |
426 | 558 | * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul> |
427 | 559 | * @return CFResponse A <CFResponse> object containing a parsed HTTP response. |
428 | 560 | */ |
429 | | - public function delete_message($queue_url, $receipt_handle, $opt = null) |
| 561 | + public function remove_permission($queue_url, $label, $opt = null) |
430 | 562 | { |
431 | 563 | if (!$opt) $opt = array(); |
432 | | - $opt['ReceiptHandle'] = $receipt_handle; |
| 564 | + $opt['Label'] = $label; |
433 | 565 | |
434 | | - return $this->authenticate('DeleteMessage', $opt, $queue_url); |
| 566 | + return $this->authenticate('RemovePermission', $opt, $queue_url); |
435 | 567 | } |
436 | 568 | |
437 | 569 | /** |
438 | | - * |
439 | 570 | * The <code>SendMessage</code> action delivers a message to the specified queue. |
440 | 571 | * |
441 | 572 | * @param string $queue_url (Required) The URL of the SQS queue to take action on. |
442 | 573 | * @param string $message_body (Required) The message to send. |
443 | 574 | * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul> |
| 575 | + * <li><code>DelaySeconds</code> - <code>integer</code> - Optional - The number of seconds the message has to be delayed.</li> |
444 | 576 | * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li> |
445 | 577 | * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul> |
446 | 578 | * @return CFResponse A <CFResponse> object containing a parsed HTTP response. |
— | — | @@ -453,35 +585,61 @@ |
454 | 586 | } |
455 | 587 | |
456 | 588 | /** |
| 589 | + * This is a batch version of <code>SendMessage</code>. It takes multiple messages and adds each |
| 590 | + * of them to the queue. The result of each add operation is reported individually in the |
| 591 | + * response. |
457 | 592 | * |
458 | | - * Retrieves one or more messages from the specified queue, including the message body and message ID of each message. Messages returned by |
459 | | - * this action stay in the queue until you delete them. However, once a message is returned to a <code>ReceiveMessage</code> request, it is not |
460 | | - * returned on subsequent <code>ReceiveMessage</code> requests for the duration of the <code>VisibilityTimeout</code>. If you do not specify a |
461 | | - * <code>VisibilityTimeout</code> in the request, the overall visibility timeout for the queue is used for the returned messages. |
| 593 | + * @param string $queue_url (Required) The URL of the SQS queue to take action on. |
| 594 | + * @param array $send_message_batch_request_entry (Required) A list of <code>SendMessageBatchRequestEntry</code> s. <ul> |
| 595 | + * <li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul> |
| 596 | + * <li><code>Id</code> - <code>string</code> - Required - An identifier for the message in this batch. This is used to communicate the result. Note that the the <code>Id</code> s of a batch request need to be unique within the request.</li> |
| 597 | + * <li><code>MessageBody</code> - <code>string</code> - Required - Body of the message.</li> |
| 598 | + * <li><code>DelaySeconds</code> - <code>integer</code> - Optional - The number of seconds for which the message has to be delayed.</li> |
| 599 | + * </ul></li> |
| 600 | + * </ul> |
| 601 | + * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul> |
| 602 | + * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li> |
| 603 | + * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul> |
| 604 | + * @return CFResponse A <CFResponse> object containing a parsed HTTP response. |
| 605 | + */ |
| 606 | + public function send_message_batch($queue_url, $send_message_batch_request_entry, $opt = null) |
| 607 | + { |
| 608 | + if (!$opt) $opt = array(); |
| 609 | + |
| 610 | + // Required list + map |
| 611 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 612 | + 'SendMessageBatchRequestEntry' => (is_array($send_message_batch_request_entry) ? $send_message_batch_request_entry : array($send_message_batch_request_entry)) |
| 613 | + ))); |
| 614 | + |
| 615 | + return $this->authenticate('SendMessageBatch', $opt, $queue_url); |
| 616 | + } |
| 617 | + |
| 618 | + /** |
| 619 | + * Sets an attribute of a queue. The set of attributes that can be set are - DelaySeconds, |
| 620 | + * MessageRetentionPeriod, MaximumMessageSize, VisibilityTimeout and Policy. |
462 | 621 | * |
463 | 622 | * @param string $queue_url (Required) The URL of the SQS queue to take action on. |
| 623 | + * @param array $attribute (Required) A map of attributes to set. <ul> |
| 624 | + * <li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul> |
| 625 | + * <li><code>Name</code> - <code>string</code> - Optional - The name of a queue attribute. [Allowed values: <code>Policy</code>, <code>VisibilityTimeout</code>, <code>MaximumMessageSize</code>, <code>MessageRetentionPeriod</code>, <code>ApproximateNumberOfMessages</code>, <code>ApproximateNumberOfMessagesNotVisible</code>, <code>CreatedTimestamp</code>, <code>LastModifiedTimestamp</code>, <code>QueueArn</code>, <code>ApproximateNumberOfMessagesDelayed</code>, <code>DelaySeconds</code>]</li> |
| 626 | + * <li><code>Value</code> - <code>string</code> - Optional - The value of a queue attribute.</li> |
| 627 | + * </ul></li> |
| 628 | + * </ul> |
464 | 629 | * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul> |
465 | | - * <li><code>AttributeName</code> - <code>string|array</code> - Optional - A list of attributes to retrieve information for. Pass a string for a single value, or an indexed array for multiple values. </li> |
466 | | - * <li><code>MaxNumberOfMessages</code> - <code>integer</code> - Optional - The maximum number of messages to return. Amazon SQS never returns more messages than this value but may return fewer. All of the messages are not necessarily returned. </li> |
467 | | - * <li><code>VisibilityTimeout</code> - <code>integer</code> - Optional - The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a <code>ReceiveMessage</code> request. </li> |
468 | 630 | * <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li> |
469 | 631 | * <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul> |
470 | 632 | * @return CFResponse A <CFResponse> object containing a parsed HTTP response. |
471 | 633 | */ |
472 | | - public function receive_message($queue_url, $opt = null) |
| 634 | + public function set_queue_attributes($queue_url, $attribute, $opt = null) |
473 | 635 | { |
474 | 636 | if (!$opt) $opt = array(); |
475 | 637 | |
476 | | - // Optional parameter |
477 | | - if (isset($opt['AttributeName'])) |
478 | | - { |
479 | | - $opt = array_merge($opt, CFComplexType::map(array( |
480 | | - 'AttributeName' => (is_array($opt['AttributeName']) ? $opt['AttributeName'] : array($opt['AttributeName'])) |
481 | | - ))); |
482 | | - unset($opt['AttributeName']); |
483 | | - } |
| 638 | + // Required list + map |
| 639 | + $opt = array_merge($opt, CFComplexType::map(array( |
| 640 | + 'Attribute' => (is_array($attribute) ? $attribute : array($attribute)) |
| 641 | + ))); |
484 | 642 | |
485 | | - return $this->authenticate('ReceiveMessage', $opt, $queue_url); |
| 643 | + return $this->authenticate('SetQueueAttributes', $opt, $queue_url); |
486 | 644 | } |
487 | 645 | } |
488 | 646 | |
— | — | @@ -489,7 +647,4 @@ |
490 | 648 | /*%******************************************************************************************%*/ |
491 | 649 | // EXCEPTIONS |
492 | 650 | |
493 | | -/** |
494 | | - * Default SQS Exception. |
495 | | - */ |
496 | | -class SQS_Exception extends Exception {} |
\ No newline at end of file |
| 651 | +class SQS_Exception extends Exception {} |
Index: trunk/extensions/OpenStackManager/aws-sdk/_docs/CHANGELOG.md |
— | — | @@ -1,3 +1,15 @@ |
| 2 | +# Changelog: 1.4.5 "Weiss" |
| 3 | +<http://finalfantasy.wikia.com/wiki/Weiss> |
| 4 | + |
| 5 | +Launched Friday, October 21, 2011 |
| 6 | + |
| 7 | +## Service Classes |
| 8 | +### AmazonSQS |
| 9 | +* **New:** Support for delayed queues and batch operations has been added to the SDK. |
| 10 | + |
| 11 | + |
| 12 | +---- |
| 13 | + |
2 | 14 | # Changelog: 1.4.4 "Vaan" |
3 | 15 | <http://finalfantasy.wikia.com/wiki/Vaan> |
4 | 16 | |
Index: trunk/extensions/OpenStackManager/aws-sdk/sdk.class.php |
— | — | @@ -125,9 +125,9 @@ |
126 | 126 | // INTERMEDIARY CONSTANTS |
127 | 127 | |
128 | 128 | define('CFRUNTIME_NAME', 'aws-sdk-php'); |
129 | | -define('CFRUNTIME_VERSION', '1.4.4'); |
| 129 | +define('CFRUNTIME_VERSION', '1.4.5'); |
130 | 130 | // define('CFRUNTIME_BUILD', gmdate('YmdHis', filemtime(__FILE__))); // @todo: Hardcode for release. |
131 | | -define('CFRUNTIME_BUILD', '20111012191027'); |
| 131 | +define('CFRUNTIME_BUILD', '20111021191027'); |
132 | 132 | define('CFRUNTIME_USERAGENT', CFRUNTIME_NAME . '/' . CFRUNTIME_VERSION . ' PHP/' . PHP_VERSION . ' ' . str_replace(' ', '_', php_uname('s')) . '/' . str_replace(' ', '_', php_uname('r')) . ' Arch/' . php_uname('m') . ' SAPI/' . php_sapi_name() . ' Integer/' . PHP_INT_MAX . ' Build/' . CFRUNTIME_BUILD . __aws_sdk_ua_callback()); |
133 | 133 | |
134 | 134 | |