sqs-2012-11-05.examples.json (19439B)
1 { 2 "version": "1.0", 3 "examples": { 4 "AddPermission": [ 5 { 6 "input": { 7 "AWSAccountIds": [ 8 "12345EXAMPLE" 9 ], 10 "Actions": [ 11 "SendMessage" 12 ], 13 "Label": "SendMessagesFromMyQueue", 14 "QueueUrl": "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue" 15 }, 16 "output": { 17 }, 18 "comments": { 19 "input": { 20 }, 21 "output": { 22 } 23 }, 24 "description": "This example allows the specified AWS account to send messages to the specified queue.", 25 "id": "to-add-a-permission-to-a-queue-1472079068305", 26 "title": "To add a permission to a queue" 27 } 28 ], 29 "ChangeMessageVisibility": [ 30 { 31 "input": { 32 "QueueUrl": "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue", 33 "ReceiptHandle": "AQEBTpyI...t6HyQg==", 34 "VisibilityTimeout": 36000 35 }, 36 "output": { 37 }, 38 "comments": { 39 "input": { 40 }, 41 "output": { 42 } 43 }, 44 "description": "This example changes the visibility timeout of the specified message to 10 hours (10 hours * 60 minutes * 60 seconds).", 45 "id": "to-change-the-visibility-timeout-of-a-single-message-1472079046292", 46 "title": "To change the visibility timeout of a single message" 47 } 48 ], 49 "ChangeMessageVisibilityBatch": [ 50 { 51 "input": { 52 "Entries": [ 53 { 54 "Id": "FirstMessage", 55 "ReceiptHandle": "AQEBhz2q...Jf3kaw==", 56 "VisibilityTimeout": 36000 57 }, 58 { 59 "Id": "SecondMessage", 60 "ReceiptHandle": "AQEBkTUH...HifSnw==", 61 "VisibilityTimeout": 36000 62 } 63 ], 64 "QueueUrl": "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue" 65 }, 66 "output": { 67 "Failed": [ 68 69 ], 70 "Successful": [ 71 72 ] 73 }, 74 "comments": { 75 "input": { 76 }, 77 "output": { 78 } 79 }, 80 "description": "This example changes the visibility timeout of the two specified messages to 10 hours (10 hours * 60 minutes * 60 seconds).", 81 "id": "to-change-the-visibility-timeout-of-multiple-messages-1472079027081", 82 "title": "To change the visibility timeout of multiple messages" 83 } 84 ], 85 "CreateQueue": [ 86 { 87 "input": { 88 "Attributes": { 89 "MessageRetentionPeriod": "259200", 90 "RedrivePolicy": "{\"deadLetterTargetArn\":\"arn:aws:sqs:us-east-1:80398EXAMPLE:MyDeadLetterQueue\",\"maxReceiveCount\":\"1000\"}" 91 }, 92 "QueueName": "MyQueue" 93 }, 94 "output": { 95 "QueueUrl": "https://queue.amazonaws.com/80398EXAMPLE/MyQueue" 96 }, 97 "comments": { 98 "input": { 99 }, 100 "output": { 101 } 102 }, 103 "description": "The following operation creates an Amazon SQS queue named MyQueue.", 104 "id": "to-create-an-sqs-queue-1472078982579", 105 "title": "To create an Amazon SQS queue" 106 } 107 ], 108 "DeleteMessage": [ 109 { 110 "input": { 111 "QueueUrl": "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue", 112 "ReceiptHandle": "AQEBRXTo...q2doVA==" 113 }, 114 "output": { 115 }, 116 "comments": { 117 "input": { 118 }, 119 "output": { 120 } 121 }, 122 "description": "This example deletes the specified message.", 123 "id": "to-delete-a-single-message-1472078961585", 124 "title": "To delete a single message" 125 } 126 ], 127 "DeleteMessageBatch": [ 128 { 129 "input": { 130 "Entries": [ 131 { 132 "Id": "FirstMessage", 133 "ReceiptHandle": "AQEB1mgl...Z4GuLw==" 134 }, 135 { 136 "Id": "SecondMessage", 137 "ReceiptHandle": "AQEBLsYM...VQubAA==" 138 } 139 ], 140 "QueueUrl": "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue" 141 }, 142 "output": { 143 "Failed": [ 144 145 ], 146 "Successful": [ 147 { 148 "Id": "FirstMessage" 149 }, 150 { 151 "Id": "SecondMessage" 152 } 153 ] 154 }, 155 "comments": { 156 "input": { 157 }, 158 "output": { 159 } 160 }, 161 "description": "This example deletes the two specified messages.", 162 "id": "to-delete-multiple-messages-1472078930327", 163 "title": "To delete multiple messages" 164 } 165 ], 166 "DeleteQueue": [ 167 { 168 "input": { 169 "QueueUrl": "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyNewerQueue" 170 }, 171 "output": { 172 }, 173 "comments": { 174 "input": { 175 }, 176 "output": { 177 } 178 }, 179 "description": "This example deletes the specified queue.", 180 "id": "to-delete-a-queue-1472151853558", 181 "title": "To delete a queue" 182 } 183 ], 184 "GetQueueAttributes": [ 185 { 186 "input": { 187 "AttributeNames": [ 188 "All" 189 ], 190 "QueueUrl": "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue" 191 }, 192 "output": { 193 "Attributes": { 194 "ApproximateNumberOfMessages": "0", 195 "ApproximateNumberOfMessagesDelayed": "0", 196 "ApproximateNumberOfMessagesNotVisible": "0", 197 "CreatedTimestamp": "1442426968", 198 "DelaySeconds": "0", 199 "LastModifiedTimestamp": "1442426968", 200 "MaximumMessageSize": "262144", 201 "MessageRetentionPeriod": "345600", 202 "QueueArn": "arn:aws:sqs:us-east-1:80398EXAMPLE:MyNewQueue", 203 "ReceiveMessageWaitTimeSeconds": "0", 204 "RedrivePolicy": "{\"deadLetterTargetArn\":\"arn:aws:sqs:us-east-1:80398EXAMPLE:MyDeadLetterQueue\",\"maxReceiveCount\":1000}", 205 "VisibilityTimeout": "30" 206 } 207 }, 208 "comments": { 209 "input": { 210 }, 211 "output": { 212 } 213 }, 214 "description": "This example gets all attributes of the specified queue.", 215 "id": "to-get-the-attributes-of-a-queue-1472149421128", 216 "title": "To get the attributes of a queue" 217 }, 218 { 219 "input": { 220 "AttributeNames": [ 221 "MaximumMessageSize VisibilityTimeout" 222 ], 223 "QueueUrl": "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyNewQueue" 224 }, 225 "output": { 226 "Attributes": { 227 "MaximumMessageSize": "262144", 228 "VisibilityTimeout": "30" 229 } 230 }, 231 "comments": { 232 "input": { 233 }, 234 "output": { 235 } 236 }, 237 "description": "This example gets only the specified queue's maximum message size and visibility timeout attributes.", 238 "id": "to-get-the-attributes-of-a-queue-1472517012839", 239 "title": "To get the attributes of a queue" 240 } 241 ], 242 "GetQueueUrl": [ 243 { 244 "input": { 245 "QueueName": "MyQueue", 246 "QueueOwnerAWSAccountId": "123456789101" 247 }, 248 "output": { 249 "QueueUrl": "https://queue.amazonaws.com/123456789101/MyQueue" 250 }, 251 "comments": { 252 "input": { 253 }, 254 "output": { 255 } 256 }, 257 "description": "This example gets the URL of the specified queue.", 258 "id": "to-get-the-url-of-a-queue-1472078901091", 259 "title": "To get the URL of a queue" 260 } 261 ], 262 "ListDeadLetterSourceQueues": [ 263 { 264 "input": { 265 "QueueUrl": "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyDeadLetterQueue" 266 }, 267 "output": { 268 "queueUrls": [ 269 "https://queue.amazonaws.com/80398EXAMPLE/MyQueue", 270 "https://queue.amazonaws.com/80398EXAMPLE/MyOtherQueue" 271 ] 272 }, 273 "comments": { 274 "input": { 275 }, 276 "output": { 277 } 278 }, 279 "description": "This example lists the source queues associated with the specified dead letter queue.", 280 "id": "to-list-the-source-queues-of-a-dead-letter-queue-1472150435081", 281 "title": "To list the source queues of a dead letter queue" 282 } 283 ], 284 "ListQueues": [ 285 { 286 "input": { 287 "QueueNamePrefix": "" 288 }, 289 "output": { 290 "QueueUrls": [ 291 "https://queue.amazonaws.com/80398EXAMPLE/MyDeadLetterQueue", 292 "https://queue.amazonaws.com/80398EXAMPLE/MyQueue", 293 "https://queue.amazonaws.com/80398EXAMPLE/MyOtherQueue", 294 "https://queue.amazonaws.com/80398EXAMPLE/TestQueue1", 295 "https://queue.amazonaws.com/80398EXAMPLE/TestQueue2" 296 ] 297 }, 298 "comments": { 299 "input": { 300 }, 301 "output": { 302 } 303 }, 304 "description": "This example lists all queues.", 305 "id": "to-list-queues-1472150595914", 306 "title": "To list queues" 307 }, 308 { 309 "input": { 310 "QueueNamePrefix": "My" 311 }, 312 "output": { 313 "QueueUrls": [ 314 "https://queue.amazonaws.com/80398EXAMPLE/MyDeadLetterQueue", 315 "https://queue.amazonaws.com/80398EXAMPLE/MyQueue", 316 "https://queue.amazonaws.com/80398EXAMPLE/MyOtherQueue" 317 ] 318 }, 319 "comments": { 320 "input": { 321 }, 322 "output": { 323 } 324 }, 325 "description": "This example lists only queues that start with "Ty".", 326 "id": "to-list-queues-1472517240103", 327 "title": "To list queues" 328 } 329 ], 330 "PurgeQueue": [ 331 { 332 "input": { 333 "QueueUrl": "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyNewQueue" 334 }, 335 "output": { 336 }, 337 "comments": { 338 "input": { 339 }, 340 "output": { 341 } 342 }, 343 "description": "This example deletes all messages in the specified queue.", 344 "id": "to-purge-a-queue-1472150819702", 345 "title": "To purge a queue" 346 } 347 ], 348 "ReceiveMessage": [ 349 { 350 "input": { 351 "AttributeNames": [ 352 "All" 353 ], 354 "MaxNumberOfMessages": 10, 355 "MessageAttributeNames": [ 356 "All" 357 ], 358 "QueueUrl": "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue", 359 "VisibilityTimeout": 123, 360 "WaitTimeSeconds": 123 361 }, 362 "output": { 363 "Messages": [ 364 { 365 "Attributes": { 366 "ApproximateFirstReceiveTimestamp": "1442428276921", 367 "ApproximateReceiveCount": "5", 368 "SenderId": "AIDAIAZKMSNQ7TEXAMPLE", 369 "SentTimestamp": "1442428276921" 370 }, 371 "Body": "My first message.", 372 "MD5OfBody": "1000f835...a35411fa", 373 "MD5OfMessageAttributes": "9424c491...26bc3ae7", 374 "MessageAttributes": { 375 "City": { 376 "DataType": "String", 377 "StringValue": "Any City" 378 }, 379 "PostalCode": { 380 "DataType": "String", 381 "StringValue": "ABC123" 382 } 383 }, 384 "MessageId": "d6790f8d-d575-4f01-bc51-40122EXAMPLE", 385 "ReceiptHandle": "AQEBzbVv...fqNzFw==" 386 } 387 ] 388 }, 389 "comments": { 390 "input": { 391 }, 392 "output": { 393 } 394 }, 395 "description": "This example receives up to 10 available messages, returning all available attributes.", 396 "id": "to-receive-a-message-1472151462717", 397 "title": "To receive a message" 398 }, 399 { 400 "input": { 401 "AttributeNames": [ 402 "SenderId SentTimestamp" 403 ], 404 "MaxNumberOfMessages": 123, 405 "MessageAttributeNames": [ 406 "PostalCode" 407 ], 408 "QueueUrl": "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue", 409 "VisibilityTimeout": 123, 410 "WaitTimeSeconds": 123 411 }, 412 "output": { 413 "Messages": [ 414 { 415 "Attributes": { 416 "SenderId": "AIDAIAZKMSNQ7TEXAMPLE", 417 "SentTimestamp": "1442428276921" 418 }, 419 "Body": "My first message.", 420 "MD5OfBody": "1000f835...a35411fa", 421 "MD5OfMessageAttributes": "b8e89563...e088e74f", 422 "MessageAttributes": { 423 "PostalCode": { 424 "DataType": "String", 425 "StringValue": "ABC123" 426 } 427 }, 428 "MessageId": "d6790f8d-d575-4f01-bc51-40122EXAMPLE", 429 "ReceiptHandle": "AQEB6nR4...HzlvZQ==" 430 } 431 ] 432 }, 433 "comments": { 434 "input": { 435 }, 436 "output": { 437 } 438 }, 439 "description": "This example receives the next available message, returning only the SenderId and SentTimestamp attributes and the PostalCode message attribute.", 440 "id": "to-receive-a-message-1472517398871", 441 "title": "To receive a message" 442 } 443 ], 444 "RemovePermission": [ 445 { 446 "input": { 447 "Label": "SendMessagesFromMyQueue", 448 "QueueUrl": "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue" 449 }, 450 "output": { 451 }, 452 "comments": { 453 "input": { 454 }, 455 "output": { 456 } 457 }, 458 "description": "This example removes the permission with the specified label from the specified queue.", 459 "id": "to-remove-a-permission-from-a-queue-1472151967252", 460 "title": "To remove a permission from a queue" 461 } 462 ], 463 "SendMessage": [ 464 { 465 "input": { 466 "DelaySeconds": 10, 467 "MessageAttributes": { 468 "City": { 469 "DataType": "String", 470 "StringValue": "Any City" 471 }, 472 "Greeting": { 473 "BinaryValue": "Hello, World!", 474 "DataType": "Binary" 475 }, 476 "Population": { 477 "DataType": "Number", 478 "StringValue": "1250800" 479 } 480 }, 481 "MessageBody": "Information about the largest city in Any Region.", 482 "QueueUrl": "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue" 483 }, 484 "output": { 485 "MD5OfMessageAttributes": "00484c68...59e48f06", 486 "MD5OfMessageBody": "51b0a325...39163aa0", 487 "MessageId": "da68f62c-0c07-4bee-bf5f-7e856EXAMPLE" 488 }, 489 "comments": { 490 "input": { 491 }, 492 "output": { 493 } 494 }, 495 "description": "This example sends a message with the specified message body, delay period, and message attributes to the specified queue.", 496 "id": "to-send-a-message-to-a-queue-1472152022619", 497 "title": "To send a message to a queue" 498 } 499 ], 500 "SendMessageBatch": [ 501 { 502 "input": { 503 "Entries": [ 504 { 505 "DelaySeconds": 10, 506 "Id": "FuelReport-0001-2015-09-16T140731Z", 507 "MessageAttributes": { 508 "City": { 509 "DataType": "String", 510 "StringValue": "Any City" 511 }, 512 "PostalCode": { 513 "DataType": "String", 514 "StringValue": "99065" 515 }, 516 "PricePerGallon": { 517 "DataType": "Number", 518 "StringValue": "1.99" 519 }, 520 "Region": { 521 "DataType": "String", 522 "StringValue": "WA" 523 }, 524 "SellerName": { 525 "DataType": "String", 526 "StringValue": "Example Store" 527 } 528 }, 529 "MessageBody": "Fuel report for account 0001 on 2015-09-16 at 02:07:31 PM." 530 }, 531 { 532 "DelaySeconds": 10, 533 "Id": "FuelReport-0002-2015-09-16T140930Z", 534 "MessageAttributes": { 535 "City": { 536 "DataType": "String", 537 "StringValue": "North Town" 538 }, 539 "PostalCode": { 540 "DataType": "String", 541 "StringValue": "99123" 542 }, 543 "PricePerGallon": { 544 "DataType": "Number", 545 "StringValue": "1.87" 546 }, 547 "Region": { 548 "DataType": "String", 549 "StringValue": "WA" 550 }, 551 "SellerName": { 552 "DataType": "String", 553 "StringValue": "Example Fuels" 554 } 555 }, 556 "MessageBody": "Fuel report for account 0002 on 2015-09-16 at 02:09:30 PM." 557 } 558 ], 559 "QueueUrl": "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue" 560 }, 561 "output": { 562 "Failed": [ 563 564 ], 565 "Successful": [ 566 { 567 "Id": "FuelReport-0001-2015-09-16T140731Z", 568 "MD5OfMessageAttributes": "10809b55...baf283ef", 569 "MD5OfMessageBody": "203c4a38...7943237e", 570 "MessageId": "d175070c-d6b8-4101-861d-adeb3EXAMPLE" 571 }, 572 { 573 "Id": "FuelReport-0002-2015-09-16T140930Z", 574 "MD5OfMessageAttributes": "55623928...ae354a25", 575 "MD5OfMessageBody": "2cf0159a...c1980595", 576 "MessageId": "f9b7d55d-0570-413e-b9c5-a9264EXAMPLE" 577 } 578 ] 579 }, 580 "comments": { 581 "input": { 582 }, 583 "output": { 584 } 585 }, 586 "description": "This example sends two messages with the specified message bodies, delay periods, and message attributes to the specified queue.", 587 "id": "to-send-multiple-messages-1472152282144", 588 "title": "To send multiple messages" 589 } 590 ], 591 "SetQueueAttributes": [ 592 { 593 "input": { 594 "Attributes": { 595 "DelaySeconds": "10", 596 "MaximumMessageSize": "131072", 597 "MessageRetentionPeriod": "259200", 598 "ReceiveMessageWaitTimeSeconds": "20", 599 "RedrivePolicy": "{\"deadLetterTargetArn\":\"arn:aws:sqs:us-east-1:80398EXAMPLE:MyDeadLetterQueue\",\"maxReceiveCount\":\"1000\"}", 600 "VisibilityTimeout": "60" 601 }, 602 "QueueUrl": "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyNewQueue" 603 }, 604 "output": { 605 }, 606 "comments": { 607 "input": { 608 }, 609 "output": { 610 } 611 }, 612 "description": "This example sets the specified queue to a delivery delay of 10 seconds, a maximum message size of 128 KB (128 KB * 1,024 bytes), a message retention period of 3 days (3 days * 24 hours * 60 minutes * 60 seconds), a receive message wait time of 20 seconds, and a default visibility timeout of 60 seconds. This example also associates the specified dead letter queue with a maximum receive count of 1,000 messages.", 613 "id": "to-set-the-attributes-of-a-queue-1472152379646", 614 "title": "To set the attributes of a queue" 615 } 616 ] 617 } 618 }