.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) .\" .\" 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" '' '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 turned on, 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. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Amazon::SQS::Simple 3pm" .TH Amazon::SQS::Simple 3pm "2010-03-31" "perl v5.10.1" "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($access_key, $secret_key); \& \& # Create a new queue \& my $q = $sqs\->CreateQueue(\*(Aqqueue_name\*(Aq); \& \& # Send a message \& $q\->SendMessage(\*(AqHello world!\*(Aq); \& \& # Retrieve a message \& my $msg = $q\->ReceiveMessage(); \& print $msg\->MessageBody() # Hello world! \& \& # Delete the message \& $q\->DeleteMessage($msg\->ReceiptHandle()); \& \& # Delete the queue \& $q\->Delete(); .Ve .SH "INTRODUCTION" .IX Header "INTRODUCTION" Amazon::SQS::Simple is an \s-1OO\s0 \s-1API\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\s0 \s-1API\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\s0 \s-1API\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 \fIAmazon::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. .SH "AUTHOR" .IX Header "AUTHOR" Copyright 2007\-2008 Simon Whitaker .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.