Exemple #1
0
    def __init__(self, endpoint, access_key, secret_key, _ioloop=None, accNumber=None, secure=False):
        """
        @type endpoint: the amazon endpoint of the service
        @type endpoint: str
        @type access_key: amazon access key
        @type access_key: str
        @type secret_key: amazon secret key
        @type secret_key: str
        @type _ioloop: the tornado ioloop for processing the events
        @type _ioloop: tornado.ioloop.IOLoop
        @type accNumber: the amazon user id (account number), if None the client will try to fetch the info with IAMClient
        @type accNumber: str
        @type secure: use https
        @type secure: bool
        """

        self.checkForErrors = MethodType(awsutils.sqsclient.SQSClient.checkForErrors, self)

        AWSClient.__init__(self, endpoint, access_key, secret_key, secure, _ioloop = _ioloop)
        #try to retrieve the curent user's account number
        if accNumber is None:
            #TODO, we should do this asynchronous
            iam = IAMClient(access_key, secret_key)
            userinfo = iam.getUser()
            self.accNumber = userinfo['UserId']
            iam.closeConnections()
            iam = None
        else:
            self.accNumber = accNumber
Exemple #2
0
 def __init__(self, access_key, secret_key, _ioloop=None):
     """
     @type access_key: amazon access key
     @type access_key: str
     @type secret_key: amazon secret key
     @type secret_key: str
     @type _ioloop: the tornado ioloop for processing the events
     @type _ioloop: tornado.ioloop.IOLoop
     """
     AWSClient.__init__(self, 'iam.amazonaws.com', access_key, secret_key, secure=True, _ioloop = _ioloop)
Exemple #3
0
 def __init__(self, endpoint, access_key, secret_key, _ioloop=None, secure=False):
     """
     @type endpoint: the amazon endpoint of the service
     @type endpoint: str
     @type access_key: amazon access key
     @type access_key: str
     @type secret_key: amazon secret key
     @type secret_key: str
     @type secure: use https
     @type secure: bool
     @type _ioloop: the tornado ioloop for processing the events
     @type _ioloop: tornado.ioloop.IOLoop
     """
     self.boxUssage = 0
     AWSClient.__init__(self, endpoint, access_key, secret_key, secure, _ioloop=_ioloop)
Exemple #4
0
 def __init__(self, endpoint, access_key, secret_key, _ioloop=None, secure=False):
     """
     @type endpoint: the amazon endpoint of the service
     @type endpoint: str
     @type access_key: amazon access key
     @type access_key: str
     @type secret_key: amazon secret key
     @type secret_key: str
     @type _ioloop: the tornado ioloop for processing the events
     @type _ioloop: tornado.ioloop.IOLoop
     @type secure: use https
     @type secure: bool
     """
     self.checkForErrors = MethodType(awsutils.s3client.S3Client.checkForErrors, self)
     AWSClient.__init__(self, endpoint, access_key, secret_key, secure, _ioloop=_ioloop)