Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 360 lines (294 sloc) 14.816 kB
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
1 # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the
5 # "Software"), to deal in the Software without restriction, including
6 # without limitation the rights to use, copy, modify, merge, publish, dis-
7 # tribute, sublicense, and/or sell copies of the Software, and to permit
8 # persons to whom the Software is furnished to do so, subject to the fol-
9 # lowing conditions:
10 #
11 # The above copyright notice and this permission notice shall be included
12 # in all copies or substantial portions of the Software.
13 #
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
16 # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
17 # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 # IN THE SOFTWARE.
21
22 from boto.connection import AWSQueryConnection
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
23 from boto.sqs.regioninfo import SQSRegionInfo
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
24 from boto.sqs.queue import Queue
25 from boto.sqs.message import Message
26 from boto.sqs.attributes import Attributes
8b04568 @garnaat Initial support for SendMessageBatch request for SQS. Closes #431.
garnaat authored
27 from boto.sqs.batchresults import BatchResults
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
28 from boto.exception import SQSError
29
a498108 cleaned up unused imports in boto.sqs
paltman authored
30
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
31 class SQSConnection(AWSQueryConnection):
32 """
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
33 A Connection to the SQS Service.
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
34 """
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
35 DefaultRegionName = 'us-east-1'
4f148ea @garnaat Correcting some of the changes made to default endpoints. Related to…
garnaat authored
36 DefaultRegionEndpoint = 'sqs.us-east-1.amazonaws.com'
3859a94 upped sqs version, added delay_seconds capability to queue writes
mLewisLogic authored
37 APIVersion = '2011-10-01'
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
38 DefaultContentType = 'text/plain'
bb65559 Finalizing support for 2008-02-01 EC2 API. Also major refactoring an…
Mitch.Garnaat authored
39 ResponseError = SQSError
3859a94 upped sqs version, added delay_seconds capability to queue writes
mLewisLogic authored
40
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
41 def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
d910d48 Add support for Signature Version 2 to address security issues. Also…
Mitch.Garnaat authored
42 is_secure=True, port=None, proxy=None, proxy_port=None,
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
43 proxy_user=None, proxy_pass=None, debug=0,
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
44 https_connection_factory=None, region=None, path='/',
45 security_token=None):
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
46 if not region:
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
47 region = SQSRegionInfo(self, self.DefaultRegionName,
48 self.DefaultRegionEndpoint)
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
49 self.region = region
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
50 AWSQueryConnection.__init__(self, aws_access_key_id,
51 aws_secret_access_key,
52 is_secure, port,
53 proxy, proxy_port,
54 proxy_user, proxy_pass,
55 self.region.endpoint, debug,
56 https_connection_factory, path,
57 security_token=security_token)
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
58
25c98a7 Lots of small changes to accomodate plug-in authentication mechanism.…
Mitch Garnaat authored
59 def _required_auth_capability(self):
60 return ['sqs']
61
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
62 def create_queue(self, queue_name, visibility_timeout=None):
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
63 """
64 Create an SQS Queue.
65
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
66 :type queue_name: str or unicode
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
67 :param queue_name: The name of the new queue. Names are scoped to
68 an account and need to be unique within that
69 account. Calling this method on an existing
70 queue name will not return an error from SQS
71 unless the value for visibility_timeout is
72 different than the value of the existing queue
73 of that name. This is still an expensive operation,
74 though, and not the preferred way to check for
75 the existence of a queue. See the
c9423be updated docs with boto main module and SQS modules and fixed some ref…
paltman authored
76 :func:`boto.sqs.connection.SQSConnection.lookup` method.
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
77
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
78 :type visibility_timeout: int
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
79 :param visibility_timeout: The default visibility timeout for all
80 messages written in the queue. This can
81 be overridden on a per-message.
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
82
c9423be updated docs with boto main module and SQS modules and fixed some ref…
paltman authored
83 :rtype: :class:`boto.sqs.queue.Queue`
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
84 :return: The newly created queue.
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
85
86 """
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
87 params = {'QueueName': queue_name}
88 if visibility_timeout:
e08a5e2 updated queue creation default visibility_timeout to comply with late…
mLewisLogic authored
89 params['Attribute.1.Name'] = 'VisibilityTimeout'
90 params['Attribute.1.Value'] = int(visibility_timeout)
bb65559 Finalizing support for 2008-02-01 EC2 API. Also major refactoring an…
Mitch.Garnaat authored
91 return self.get_object('CreateQueue', params, Queue)
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
92
93 def delete_queue(self, queue, force_deletion=False):
94 """
95 Delete an SQS Queue.
bd2f030 Added a JSON message class and fixed a docstring in connection.py
Mitch.Garnaat authored
96
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
97 :type queue: A Queue object
98 :param queue: The SQS queue to be deleted
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
99
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
100 :type force_deletion: Boolean
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
101 :param force_deletion: Normally, SQS will not delete a queue that
102 contains messages. However, if the
103 force_deletion argument is True, the
104 queue will be deleted regardless of whether
105 there are messages in the queue or not.
106 USE WITH CAUTION. This will delete all
bd2f030 Added a JSON message class and fixed a docstring in connection.py
Mitch.Garnaat authored
107 messages in the queue as well.
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
108
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
109 :rtype: bool
110 :return: True if the command succeeded, False otherwise
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
111 """
d910d48 Add support for Signature Version 2 to address security issues. Also…
Mitch.Garnaat authored
112 return self.get_status('DeleteQueue', None, queue.id)
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
113
8918866 Added delete method to Message. Cleaned up inconsistencies with queu…
Mitch.Garnaat authored
114 def get_queue_attributes(self, queue, attribute='All'):
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
115 """
116 Gets one or all attributes of a Queue
117
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
118 :type queue: A Queue object
119 :param queue: The SQS queue to be deleted
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
120
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
121 :type attribute: str
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
122 :type attribute: The specific attribute requested. If not supplied,
123 the default is to return all attributes.
124 Valid attributes are:
125
126 ApproximateNumberOfMessages|
127 ApproximateNumberOfMessagesNotVisible|
128 VisibilityTimeout|
129 CreatedTimestamp|
130 LastModifiedTimestamp|
3c888df Updating doc strings for new GetQueueAttributes parameters.
Mitch.Garnaat authored
131 Policy
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
132
c9423be updated docs with boto main module and SQS modules and fixed some ref…
paltman authored
133 :rtype: :class:`boto.sqs.attributes.Attributes`
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
134 :return: An Attributes object containing request value(s).
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
135 """
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
136 params = {'AttributeName' : attribute}
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
137 return self.get_object('GetQueueAttributes', params,
138 Attributes, queue.id)
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
139
8918866 Added delete method to Message. Cleaned up inconsistencies with queu…
Mitch.Garnaat authored
140 def set_queue_attribute(self, queue, attribute, value):
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
141 params = {'Attribute.Name' : attribute, 'Attribute.Value' : value}
d910d48 Add support for Signature Version 2 to address security issues. Also…
Mitch.Garnaat authored
142 return self.get_status('SetQueueAttributes', params, queue.id)
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
143
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
144 def receive_message(self, queue, number_messages=1,
145 visibility_timeout=None, attributes=None):
8918866 Added delete method to Message. Cleaned up inconsistencies with queu…
Mitch.Garnaat authored
146 """
147 Read messages from an SQS Queue.
148
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
149 :type queue: A Queue object
150 :param queue: The Queue from which messages are read.
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
151
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
152 :type number_messages: int
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
153 :param number_messages: The maximum number of messages to read
154 (default=1)
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
155
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
156 :type visibility_timeout: int
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
157 :param visibility_timeout: The number of seconds the message should
158 remain invisible to other queue readers
159 (default=None which uses the Queues default)
fd0dba2 Adding the ability to request additional attributes when reading a me…
Mitch.Garnaat authored
160
7f1f4b7 Fixed a doc bug and also fixed a code bug related to retrieving messa…
Mitch.Garnaat authored
161 :type attributes: str
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
162 :param attributes: The name of additional attribute to return
163 with response or All if you want all attributes.
164 The default is to return no additional attributes.
165 Valid values:
166
167 All|SenderId|SentTimestamp|
168 ApproximateReceiveCount|
3c888df Updating doc strings for new GetQueueAttributes parameters.
Mitch.Garnaat authored
169 ApproximateFirstReceiveTimestamp
8918866 Added delete method to Message. Cleaned up inconsistencies with queu…
Mitch.Garnaat authored
170
7f1f4b7 Fixed a doc bug and also fixed a code bug related to retrieving messa…
Mitch.Garnaat authored
171 :rtype: list
172 :return: A list of :class:`boto.sqs.message.Message` objects.
8918866 Added delete method to Message. Cleaned up inconsistencies with queu…
Mitch.Garnaat authored
173 """
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
174 params = {'MaxNumberOfMessages' : number_messages}
175 if visibility_timeout:
176 params['VisibilityTimeout'] = visibility_timeout
fd0dba2 Adding the ability to request additional attributes when reading a me…
Mitch.Garnaat authored
177 if attributes:
7f1f4b7 Fixed a doc bug and also fixed a code bug related to retrieving messa…
Mitch.Garnaat authored
178 self.build_list_params(params, attributes, 'AttributeName')
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
179 return self.get_list('ReceiveMessage', params,
180 [('Message', queue.message_class)],
d910d48 Add support for Signature Version 2 to address security issues. Also…
Mitch.Garnaat authored
181 queue.id, queue)
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
182
8918866 Added delete method to Message. Cleaned up inconsistencies with queu…
Mitch.Garnaat authored
183 def delete_message(self, queue, message):
0c2f0cf Added a delete_message_from_handle method. Fixes issue 326.
Mitch.Garnaat authored
184 """
185 Delete a message from a queue.
186
187 :type queue: A :class:`boto.sqs.queue.Queue` object
188 :param queue: The Queue from which messages are read.
189
190 :type message: A :class:`boto.sqs.message.Message` object
191 :param message: The Message to be deleted
192
193 :rtype: bool
194 :return: True if successful, False otherwise.
195 """
8918866 Added delete method to Message. Cleaned up inconsistencies with queu…
Mitch.Garnaat authored
196 params = {'ReceiptHandle' : message.receipt_handle}
d910d48 Add support for Signature Version 2 to address security issues. Also…
Mitch.Garnaat authored
197 return self.get_status('DeleteMessage', params, queue.id)
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
198
0c2f0cf Added a delete_message_from_handle method. Fixes issue 326.
Mitch.Garnaat authored
199 def delete_message_from_handle(self, queue, receipt_handle):
200 """
201 Delete a message from a queue, given a receipt handle.
202
203 :type queue: A :class:`boto.sqs.queue.Queue` object
204 :param queue: The Queue from which messages are read.
205
206 :type receipt_handle: str
207 :param receipt_handle: The receipt handle for the message
208
209 :rtype: bool
210 :return: True if successful, False otherwise.
211 """
212 params = {'ReceiptHandle' : receipt_handle}
213 return self.get_status('DeleteMessage', params, queue.id)
214
3859a94 upped sqs version, added delay_seconds capability to queue writes
mLewisLogic authored
215 def send_message(self, queue, message_content, delay_seconds=None):
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
216 params = {'MessageBody' : message_content}
3859a94 upped sqs version, added delay_seconds capability to queue writes
mLewisLogic authored
217 if delay_seconds:
218 params['DelaySeconds'] = int(delay_seconds)
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
219 return self.get_object('SendMessage', params, Message,
220 queue.id, verb='POST')
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
221
8b04568 @garnaat Initial support for SendMessageBatch request for SQS. Closes #431.
garnaat authored
222 def send_message_batch(self, queue, messages):
223 """
224 Delivers up to 10 messages to a queue in a single request.
225
226 :type queue: A :class:`boto.sqs.queue.Queue` object.
227 :param queue: The Queue to which the messages will be written.
228
229 :type messages: List of lists.
230 :param messages: A list of lists or tuples. Each inner
231 tuple represents a single message to be written
232 and consists of and ID (string) that must be unique
233 within the list of messages, the message body itself
234 which can be a maximum of 64K in length, and an
235 integer which represents the delay time (in seconds)
236 for the message (0-900) before the message will
237 be delivered to the queue.
238 """
239 params = {}
240 for i, msg in enumerate(messages):
241 p_name = 'SendMessageBatchRequestEntry.%i.Id' % (i+1)
242 params[p_name] = msg[0]
243 p_name = 'SendMessageBatchRequestEntry.%i.MessageBody' % (i+1)
244 params[p_name] = msg[1]
245 p_name = 'SendMessageBatchRequestEntry.%i.DelaySeconds' % (i+1)
246 params[p_name] = msg[2]
247 return self.get_object('SendMessageBatch', params, BatchResults,
248 queue.id, verb='POST')
249
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
250 def change_message_visibility(self, queue, receipt_handle,
251 visibility_timeout):
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
252 """
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
253 Extends the read lock timeout for the specified message from
254 the specified queue to the specified value.
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
255
c9423be updated docs with boto main module and SQS modules and fixed some ref…
paltman authored
256 :type queue: A :class:`boto.sqs.queue.Queue` object
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
257 :param queue: The Queue from which messages are read.
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
258
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
259 :type receipt_handle: str
260 :param queue: The receipt handle associated with the message whose
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
261 visibility timeout will be changed.
262
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
263 :type visibility_timeout: int
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
264 :param visibility_timeout: The new value of the message's visibility
265 timeout in seconds.
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
266 """
267 params = {'ReceiptHandle' : receipt_handle,
268 'VisibilityTimeout' : visibility_timeout}
269 return self.get_status('ChangeMessageVisibility', params, queue.id)
270
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
271 def get_all_queues(self, prefix=''):
5ba0149 @gtaylor Documenting SQSConnection.get_queue.
gtaylor authored
272 """
273 Retrieves all queues.
274
275 :keyword str prefix: Optionally, only return queues that start with
276 this value.
277 :rtype: list
278 :returns: A list of :py:class:`boto.sqs.queue.Queue` instances.
279 """
631853f Adding initial support for 20080101 SQS API based on contributions fr…
Mitch.Garnaat authored
280 params = {}
281 if prefix:
282 params['QueueNamePrefix'] = prefix
bb65559 Finalizing support for 2008-02-01 EC2 API. Also major refactoring an…
Mitch.Garnaat authored
283 return self.get_list('ListQueues', params, [('QueueUrl', Queue)])
3859a94 upped sqs version, added delay_seconds capability to queue writes
mLewisLogic authored
284
81f4ae3 No need to import os in __init__.py anymore. Added a delete method t…
Mitch.Garnaat authored
285 def get_queue(self, queue_name):
5ba0149 @gtaylor Documenting SQSConnection.get_queue.
gtaylor authored
286 """
287 Retrieves the queue with the given name, or ``None`` if no match
288 was found.
289
290 :param str queue_name: The name of the queue to retrieve.
291 :rtype: :py:class:`boto.sqs.queue.Queue` or ``None``
292 :returns: The requested queue, or ``None`` if no match was found.
293 """
81f4ae3 No need to import os in __init__.py anymore. Added a delete method t…
Mitch.Garnaat authored
294 rs = self.get_all_queues(queue_name)
bae71d8 Fixed a bug in get_queue/lookup which would fail to return a queue if…
Mitch.Garnaat authored
295 for q in rs:
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
296 if q.url.endswith(queue_name):
bae71d8 Fixed a bug in get_queue/lookup which would fail to return a queue if…
Mitch.Garnaat authored
297 return q
270a647 Cleaning up a perplexing implementation of get_queue that snuck in so…
Mitch.Garnaat authored
298 return None
81f4ae3 No need to import os in __init__.py anymore. Added a delete method t…
Mitch.Garnaat authored
299
61f71e7 Adding convenience method, lookup, to boto module to allow easy looku…
Mitch.Garnaat authored
300 lookup = get_queue
301
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
302 #
303 # Permissions methods
304 #
305
306 def add_permission(self, queue, label, aws_account_id, action_name):
307 """
308 Add a permission to a queue.
309
c9423be updated docs with boto main module and SQS modules and fixed some ref…
paltman authored
310 :type queue: :class:`boto.sqs.queue.Queue`
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
311 :param queue: The queue object
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
312
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
313 :type label: str or unicode
314 :param label: A unique identification of the permission you are setting.
c9423be updated docs with boto main module and SQS modules and fixed some ref…
paltman authored
315 Maximum of 80 characters ``[0-9a-zA-Z_-]``
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
316 Example, AliceSendMessage
317
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
318 :type aws_account_id: str or unicode
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
319 :param principal_id: The AWS account number of the principal who will
320 be given permission. The principal must have
321 an AWS account, but does not need to be signed
322 up for Amazon SQS. For information
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
323 about locating the AWS account identification.
324
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
325 :type action_name: str or unicode
326 :param action_name: The action. Valid choices are:
c9423be updated docs with boto main module and SQS modules and fixed some ref…
paltman authored
327 \*|SendMessage|ReceiveMessage|DeleteMessage|
f79c9de Add permissions methods to Queue class. Cleaned up some doc strings.
Mitch.Garnaat authored
328 ChangeMessageVisibility|GetQueueAttributes
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
329
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
330 :rtype: bool
331 :return: True if successful, False otherwise.
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
332
333 """
334 params = {'Label': label,
335 'AWSAccountId' : aws_account_id,
336 'ActionName' : action_name}
337 return self.get_status('AddPermission', params, queue.id)
338
339 def remove_permission(self, queue, label):
340 """
f79c9de Add permissions methods to Queue class. Cleaned up some doc strings.
Mitch.Garnaat authored
341 Remove a permission from a queue.
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
342
c9423be updated docs with boto main module and SQS modules and fixed some ref…
paltman authored
343 :type queue: :class:`boto.sqs.queue.Queue`
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
344 :param queue: The queue object
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
345
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
346 :type label: str or unicode
f28b593 @garnaat Adding STS support for SignatureV2-based services like ec2, simpledb.…
garnaat authored
347 :param label: The unique label associated with the permission
348 being removed.
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
349
8e07b77 global search and replace on @param => :param, @type => :type, @rtype…
paltman authored
350 :rtype: bool
351 :return: True if successful, False otherwise.
0e21923 Initial support for 2009-02-01 API. Also fixes issue 216.
Mitch.Garnaat authored
352 """
353 params = {'Label': label}
354 return self.get_status('RemovePermission', params, queue.id)
355
356
3859a94 upped sqs version, added delay_seconds capability to queue writes
mLewisLogic authored
357
358
359
Something went wrong with that request. Please try again.