| Index: third_party/boto/boto/ecs/__init__.py
|
| ===================================================================
|
| --- third_party/boto/boto/ecs/__init__.py (revision 33376)
|
| +++ third_party/boto/boto/ecs/__init__.py (working copy)
|
| @@ -21,6 +21,7 @@
|
|
|
| import boto
|
| from boto.connection import AWSQueryConnection, AWSAuthConnection
|
| +from boto.exception import BotoServerError
|
| import time
|
| import urllib
|
| import xml.sax
|
| @@ -41,10 +42,13 @@
|
| def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
|
| is_secure=True, port=None, proxy=None, proxy_port=None,
|
| proxy_user=None, proxy_pass=None, host='ecs.amazonaws.com',
|
| - debug=0, https_connection_factory=None, path='/'):
|
| + debug=0, https_connection_factory=None, path='/',
|
| + security_token=None, profile_name=None):
|
| super(ECSConnection, self).__init__(aws_access_key_id, aws_secret_access_key,
|
| is_secure, port, proxy, proxy_port, proxy_user, proxy_pass,
|
| - host, debug, https_connection_factory, path)
|
| + host, debug, https_connection_factory, path,
|
| + security_token=security_token,
|
| + profile_name=profile_name)
|
|
|
| def _required_auth_capability(self):
|
| return ['ecs']
|
| @@ -64,7 +68,7 @@
|
| if response.status != 200:
|
| boto.log.error('%s %s' % (response.status, response.reason))
|
| boto.log.error('%s' % body)
|
| - raise self.ResponseError(response.status, response.reason, body)
|
| + raise BotoServerError(response.status, response.reason, body)
|
|
|
| if itemSet is None:
|
| rs = ItemSet(self, action, params, page)
|
| @@ -72,6 +76,8 @@
|
| rs = itemSet
|
| h = handler.XmlHandler(rs, self)
|
| xml.sax.parseString(body, h)
|
| + if not rs.is_valid:
|
| + raise BotoServerError(response.status, '{Code}: {Message}'.format(**rs.errors[0]))
|
| return rs
|
|
|
| #
|
| @@ -88,3 +94,12 @@
|
| """
|
| params['SearchIndex'] = search_index
|
| return self.get_response('ItemSearch', params)
|
| +
|
| + def item_lookup(self, **params):
|
| + """
|
| + Returns items that satisfy the lookup query.
|
| +
|
| + For a full list of parameters, see:
|
| + http://s3.amazonaws.com/awsdocs/Associates/2011-08-01/prod-adv-api-dg-2011-08-01.pdf
|
| + """
|
| + return self.get_response('ItemLookup', params)
|
|
|