.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Amazon::SQS::Simple 3pm" .TH Amazon::SQS::Simple 3pm "2021-01-09" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Amazon::SQS::Simple \- OO API for accessing the Amazon Simple Queue Service .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Amazon::SQS::Simple; \& \& my $access_key = \*(Aqfoo\*(Aq; # Your AWS Access Key ID \& my $secret_key = \*(Aqbar\*(Aq; # Your AWS Secret Key \& \& # Create an SQS object \& my $sqs = new Amazon::SQS::Simple(AWSAccessKeyId => $access_key, SecretKey => $secret_key); \& \& # Create a new queue \& my $q = $sqs\->CreateQueue(\*(Aqqueue_name\*(Aq); \& \& # Send a message \& my $response = $q\->SendMessage(\*(AqHello world!\*(Aq); \& \& # Send multiple messages \& my @responses = $q\->SendMessageBatch([\*(AqHello world\*(Aq, \*(AqFarewell cruel world\*(Aq]); \& \& # Retrieve a message \& my $msg = $q\->ReceiveMessage(); \& print $msg\->MessageBody() # Hello world! \& \& # Delete the message \& $q\->DeleteMessage($msg\->ReceiptHandle()); \& # or \& $q\->DeleteMessage($msg); \& \& # Delete the queue \& $q\->Delete(); \& \& # Purge the queue \& $q\->Purge(); .Ve .SH "INTRODUCTION" .IX Header "INTRODUCTION" Amazon::SQS::Simple is an \s-1OO API\s0 for the Amazon Simple Queue Service. .SH "IMPORTANT" .IX Header "IMPORTANT" This version of Amazon::SQS::Simple defaults to work against version 2009\-02\-01 of the \s-1SQS API.\s0 .PP Earlier \s-1API\s0 versions may or may not work. .SH "CONSTRUCTOR" .IX Header "CONSTRUCTOR" .ie n .IP "new($access_key, $secret_key, [%opts])" 2 .el .IP "new($access_key, \f(CW$secret_key\fR, [%opts])" 2 .IX Item "new($access_key, $secret_key, [%opts])" Constructs a new Amazon::SQS::Simple object .Sp \&\f(CW$access_key\fR is your Amazon Web Services access key. \f(CW$secret_key\fR is your Amazon Web Services secret key. If you don't have either of these credentials, visit . .Sp Options for new: .RS 2 .IP "Timeout => \s-1SECONDS\s0" 4 .IX Item "Timeout => SECONDS" Set the \s-1HTTP\s0 user agent's timeout (default is 180 seconds) .IP "Version => \s-1VERSION_STRING\s0" 4 .IX Item "Version => VERSION_STRING" Specifies the \s-1SQS API\s0 version you wish to use. E.g.: .Sp .Vb 1 \& my $sqs = new Amazon::SQS::Simple($access_key, $secret_key, Version => \*(Aq2008\-01\-01\*(Aq); .Ve .RE .RS 2 .RE .SH "METHODS" .IX Header "METHODS" .IP "GetQueue($queue_endpoint)" 2 .IX Item "GetQueue($queue_endpoint)" Gets the queue with the given endpoint. Returns a \&\f(CW\*(C`Amazon::SQS::Simple::Queue\*(C'\fR object. (See Amazon::SQS::Simple::Queue for details.) .IP "CreateQueue($queue_name, [%opts])" 2 .IX Item "CreateQueue($queue_name, [%opts])" Creates a new queue with the given name. Returns a \&\f(CW\*(C`Amazon::SQS::Simple::Queue\*(C'\fR object. (See Amazon::SQS::Simple::Queue for details.) .Sp Options for CreateQueue: .RS 2 .IP "DefaultVisibilityTimeout => \s-1SECONDS\s0" 4 .IX Item "DefaultVisibilityTimeout => SECONDS" Set the default visibility timeout for this queue .RE .RS 2 .RE .IP "ListQueues([%opts])" 2 .IX Item "ListQueues([%opts])" Gets a list of all your current queues. Returns an array of \&\f(CW\*(C`Amazon::SQS::Simple::Queue\*(C'\fR objects. (See Amazon::SQS::Simple::Queue for details.) .Sp Options for ListQueues: .RS 2 .IP "QueueNamePrefix => \s-1STRING\s0" 4 .IX Item "QueueNamePrefix => STRING" Only those queues whose name begins with the specified string are returned. .RE .RS 2 .RE .SH "FUNCTIONS" .IX Header "FUNCTIONS" No functions are exported by default; if you want to use them, export them in your use line: .PP .Vb 1 \& use Amazon::SQS::Simple qw( timestamp ); .Ve .IP "timestamp($seconds)" 2 .IX Item "timestamp($seconds)" Takes a time in seconds since the epoch and returns a formatted timestamp suitable for using in a Timestamp or Expires optional method parameter. .SH "STANDARD OPTIONS" .IX Header "STANDARD OPTIONS" The following options can be supplied with any of the listed methods. .IP "AWSAccessKeyId => \s-1STRING\s0" 2 .IX Item "AWSAccessKeyId => STRING" The \s-1AWS\s0 Access Key Id to use with the method call. If not provided, Amazon::SQS::Simple uses the value passed to the constructor. .IP "SecretKey => \s-1STRING\s0" 2 .IX Item "SecretKey => STRING" The Secret Key to use with the method call. If not provided, Amazon::SQS::Simple uses the value passed to the constructor. .IP "Timestamp => \s-1TIMESTAMP\s0" 2 .IX Item "Timestamp => TIMESTAMP" All methods are automatically given a timestamp of the time at which they are called, but you can override this value if you need to. The value for this key should be a timestamp as returned by the \fBAmazon::SQS::Simple::timestamp()\fR function. .Sp You generally do not need to supply this option. .IP "Expires => \s-1TIMESTAMP\s0" 2 .IX Item "Expires => TIMESTAMP" All methods are automatically given a timestamp of the time at which they are called. You can alternatively set an expiry time by providing an Expires option. The value for this key should be a timestamp as returned by the \f(CW\*(C`Amazon::SQS::Simple::timestamp()\*(C'\fR function. .Sp You generally do not need to supply this option. .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Bill Alford wrote the code to support basic functionality of older \s-1API\s0 versions in release 0.9. James Neal provided the proxy support code in release 2.0 Roland Walker provided support for the newer signature version in release 2.0 Chris Jones provied the batch message code in release 2.0 Rusty Conover provided the V4 signature support in release 2.05 .SH "AUTHOR" .IX Header "AUTHOR" Copyright 2007\-2008 Simon Whitaker Copyright 2013\-2017 Mike (no relation) Whitaker .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.