Example #1
0
 def put_accounts_license_keystring(self,keystring,assigned_email_address):
     url = "/accounts/license/%s" % (keystring)
     headers = {'Authorization': self.token, 'Content-Type': "application/json", 'Accept': "application/vnd.mozy.bifrost+json;v=1"}
     request_url  = ('%s%s' % (self.base_url, url))
     print(request_url)
     body = {"assigned_email_address": assigned_email_address}
     response = RestfulHelper.send_put(request_url,headers,body)
     return response
Example #2
0
    def put_accounts_partner_id(self,id="",body={}):
        url = ('/accounts/partner/%s' % (id))
        headers = {'Authorization': self.token,
                   'Content-Type': "application/json", 'Accept': "application/vnd.mozy.bifrost+json;v=1"}
        request_url = ('%s%s' % (self.base_url, url))
        print(request_url)
        response = RestfulHelper.send_put(request_url, headers, body)
        print(response.text)

        return response
Example #3
0
 def put_accounts_user_id(self,id="",body={},extend_with=None):
     url = "/accounts/user/%s" % (id)
     headers = {'Authorization': self.token,
                'Content-Type': "application/json", 'Accept': "application/vnd.mozy.bifrost+json;v=1"}
     if extend_with != None:
         url += "?extend_with=%s" % (extend_with)
     request_url = ('%s%s' % (self.base_url, url))
     print(request_url)
     response = RestfulHelper.send_put(request_url, headers, body)
     print(response.text)
     return response
Example #4
0
    def put_accounts_licenses(self,parameters={},body={}):
        url = "/accounts/licenses"
        headers = {'Authorization': self.token,
                   'Content-Type': "application/json", 'Accept': "application/vnd.mozy.bifrost+json;v=1"}
        query_string = ""
        if parameters is not None:
            query_string = urlencode(parameters)
        if query_string != "":
            request_url = ('%s%s?%s' % (self.base_url, url, query_string))
        else:
            request_url = ('%s%s' % (self.base_url, url))
        response = RestfulHelper.send_put(request_url, headers, body)
        print(response.text)

        return response