示例#1
0
文件: client.py 项目: dgem/go-raml
 def users_byUserId_delete(self, userId, headers=None, query_params=None):
     """
     It is method for DELETE /users/{userId}
     """
     uri = self.url + "/users/"+userId
     uri = uri + build_query_string(query_params)
     return requests.delete(uri, headers=headers)
示例#2
0
 def organisation_post(self, data, headers=None, query_params=None):
     """
     It is method for POST /organisation
     """
     uri = self.url + "/organisation"
     uri = uri + build_query_string(query_params)
     return requests.post(uri, data, headers=headers)
示例#3
0
文件: client.py 项目: dgem/go-raml
 def getuserid(self, userId, headers=None, query_params=None):
     """
     get id
     It is method for GET /users/{userId}
     """
     uri = self.url + "/users/"+userId
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
 def getRepository(self, repository, headers=None, query_params=None):
     """
     Get information of a repository
     It is method for GET /ays/repository/{repository}
     """
     uri = self.url + "/ays/repository/"+repository
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
 def listBlueprints(self, repository, headers=None, query_params=None):
     """
     List all blueprint
     It is method for GET /ays/repository/{repository}/blueprint
     """
     uri = self.url + "/ays/repository/"+repository+"/blueprint"
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
 def createNewRepository(self, data, headers=None, query_params=None):
     """
     create a new repository
     It is method for POST /ays/repository
     """
     uri = self.url + "/ays/repository"
     uri = uri + build_query_string(query_params)
     return requests.post(uri, data, headers=headers)
 def updateBlueprint(self, data, blueprint, repository, headers=None, query_params=None):
     """
     Update existing blueprint
     It is method for PUT /ays/repository/{repository}/blueprint/{blueprint}
     """
     uri = self.url + "/ays/repository/"+repository+"/blueprint/"+blueprint
     uri = uri + build_query_string(query_params)
     return requests.put(uri, data, headers=headers)
示例#8
0
 def UpdateUserBankAccount(self, data, label, username, query_params=None):
     """
     Update an existing bankaccount and label.
     It is method for PUT /users/{username}/banks/{label}
     """
     uri = self.url + "users/" + username + "/banks/" + label
     uri = uri + build_query_string(query_params)
     return self.session.put(uri, json=data)
示例#9
0
 def GetAPIkey(self, label, username, query_params=None):
     """
     Get an API key by label
     It is method for GET /users/{username}/apikeys/{label}
     """
     uri = self.url + "users/" + username + "/apikeys/" + label
     uri = uri + build_query_string(query_params)
     return self.session.get(uri)
示例#10
0
 def AddApiKey(self, data, username, query_params=None):
     """
     Adds an APIKey to the user
     It is method for POST /users/{username}/apikeys
     """
     uri = self.url + "users/" + username + "/apikeys"
     uri = uri + build_query_string(query_params)
     return self.session.post(uri, json=data)
示例#11
0
 def ListAPIKeys(self, username, query_params=None):
     """
     Lists the API keys
     It is method for GET /users/{username}/apikeys
     """
     uri = self.url + "users/" + username + "/apikeys"
     uri = uri + build_query_string(query_params)
     return self.session.get(uri)
示例#12
0
 def ValidateEmailAddress(self, label, username, query_params=None):
     """
     Sends validation email to email address
     It is method for POST /users/{username}/emailaddresses/{label}/validate
     """
     uri = self.url + "users/" + username + "/emailaddresses/" + label + "/validate"
     uri = uri + build_query_string(query_params)
     return self.session.post(uri)
示例#13
0
 def GetEmailAddresses(self, username, query_params=None):
     """
     Get a list of the user his email addresses.
     It is method for GET /users/{username}/emailaddresses
     """
     uri = self.url + "users/" + username + "/emailaddresses"
     uri = uri + build_query_string(query_params)
     return self.session.get(uri)
示例#14
0
 def resources_post(self, data, headers=None, query_params=None):
     """
     Post a resource
     It is method for POST /resources
     """
     uri = self.url + "/resources"
     uri = uri + build_query_string(query_params)
     return requests.post(uri, data, headers=headers)
示例#15
0
 def resources_get(self, headers=None, query_params=None):
     """
     Get a resource
     It is method for GET /resources
     """
     uri = self.url + "/resources"
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
示例#16
0
 def organisation_get(self, headers=None, query_params=None):
     """
     Returns an organisation entity.
     It is method for GET /organisation
     """
     uri = self.url + "/organisation"
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
示例#17
0
 def CreateUserBankAccount(self, data, username, query_params=None):
     """
     Create new bank account
     It is method for POST /users/{username}/banks
     """
     uri = self.url + "users/" + username + "/banks"
     uri = uri + build_query_string(query_params)
     return self.session.post(uri, json=data)
示例#18
0
 def UpdateAPIkey(self, data, label, username, query_params=None):
     """
     Updates the label for the api key
     It is method for PUT /users/{username}/apikeys/{label}
     """
     uri = self.url + "users/" + username + "/apikeys/" + label
     uri = uri + build_query_string(query_params)
     return self.session.put(uri, json=data)
 def deleteBlueprint(self, blueprint, repository, headers=None, query_params=None):
     """
     delete blueprint
     It is method for DELETE /ays/repository/{repository}/blueprint/{blueprint}
     """
     uri = self.url + "/ays/repository/"+repository+"/blueprint/"+blueprint
     uri = uri + build_query_string(query_params)
     return requests.delete(uri, headers=headers)
示例#20
0
 def GetNotifications(self, username, query_params=None):
     """
     Get the list of notifications, these are pending invitations or approvals
     It is method for GET /users/{username}/notifications
     """
     uri = self.url + "users/" + username + "/notifications"
     uri = uri + build_query_string(query_params)
     return self.session.get(uri)
 def executeBlueprint(self, data, blueprint, repository, headers=None, query_params=None):
     """
     Execute the blueprint
     It is method for POST /ays/repository/{repository}/blueprint/{blueprint}
     """
     uri = self.url + "/ays/repository/"+repository+"/blueprint/"+blueprint
     uri = uri + build_query_string(query_params)
     return requests.post(uri, data, headers=headers)
示例#22
0
 def DeleteGithubAccount(self, username, query_params=None):
     """
     Unlink Github Account
     It is method for DELETE /users/{username}/github
     """
     uri = self.url + "users/" + username + "/github"
     uri = uri + build_query_string(query_params)
     return self.session.delete(uri)
 def createNewBlueprint(self, data, repository, headers=None, query_params=None):
     """
     Create a new blueprint
     It is method for POST /ays/repository/{repository}/blueprint
     """
     uri = self.url + "/ays/repository/"+repository+"/blueprint"
     uri = uri + build_query_string(query_params)
     return requests.post(uri, data, headers=headers)
示例#24
0
 def DeleteFacebookAccount(self, username, query_params=None):
     """
     Delete the associated facebook account
     It is method for DELETE /users/{username}/facebook
     """
     uri = self.url + "users/" + username + "/facebook"
     uri = uri + build_query_string(query_params)
     return self.session.delete(uri)
 def deleteRepository(self, repository, headers=None, query_params=None):
     """
     Delete a repository
     It is method for DELETE /ays/repository/{repository}
     """
     uri = self.url + "/ays/repository/"+repository
     uri = uri + build_query_string(query_params)
     return requests.delete(uri, headers=headers)
示例#26
0
 def RegisterNewUserAddress(self, data, username, query_params=None):
     """
     Register a new address
     It is method for POST /users/{username}/addresses
     """
     uri = self.url + "users/" + username + "/addresses"
     uri = uri + build_query_string(query_params)
     return self.session.post(uri, json=data)
 def oauth_callback_get(self, headers=None, query_params=None):
     """
     oauth endpoint where oauth provider need to send authorization code
     It is method for GET /oauth/callback
     """
     uri = self.url + "/oauth/callback"
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
示例#28
0
 def UpdateUserAddress(self, data, label, username, query_params=None):
     """
     Update the label and/or value of an existing address.
     It is method for PUT /users/{username}/addresses/{label}
     """
     uri = self.url + "users/" + username + "/addresses/" + label
     uri = uri + build_query_string(query_params)
     return self.session.put(uri, json=data)
 def webhooks_github_post(self, data, headers=None, query_params=None):
     """
     Endpoint that receives the events from github
     It is method for POST /webhooks/github
     """
     uri = self.url + "/webhooks/github"
     uri = uri + build_query_string(query_params)
     return requests.post(uri, data, headers=headers)
示例#30
0
 def DeleteUserAddress(self, label, username, query_params=None):
     """
     Removes an address
     It is method for DELETE /users/{username}/addresses/{label}
     """
     uri = self.url + "users/" + username + "/addresses/" + label
     uri = uri + build_query_string(query_params)
     return self.session.delete(uri)
示例#31
0
 def GetUserOrganizations(self, username, query_params=None):
     """
     Get the list organizations a user is owner or member of
     It is method for GET /users/{username}/organizations
     """
     uri = self.url + "users/" + username + "/organizations"
     uri = uri + build_query_string(query_params)
     return self.session.get(uri)
 def getBlueprint(self, blueprint, repository, headers=None, query_params=None):
     """
     Get a blueprint
     It is method for GET /ays/repository/{repository}/blueprint/{blueprint}
     """
     uri = self.url + "/ays/repository/"+repository+"/blueprint/"+blueprint
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
 def getTemplate(self, template, repository, headers=None, query_params=None):
     """
     Get a template
     It is method for GET /ays/repository/{repository}/template/{template}
     """
     uri = self.url + "/ays/repository/"+repository+"/template/"+template
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
 def createNewTemplate(self, data, repository, headers=None, query_params=None):
     """
     Create new template
     It is method for POST /ays/repository/{repository}/template
     """
     uri = self.url + "/ays/repository/"+repository+"/template"
     uri = uri + build_query_string(query_params)
     return requests.post(uri, data, headers=headers)
示例#35
0
文件: client.py 项目: dgem/go-raml
 def create_users(self, data, headers=None, query_params=None):
     """
     create users
     It is method for POST /users
     """
     uri = self.url + "/users"
     uri = uri + build_query_string(query_params)
     return requests.post(uri, data, headers=headers)
 def executeServiceActionByInstance(self, data, action, instance, role, repository, headers=None, query_params=None):
     """
     Perform an action on a services
     It is method for POST /ays/repository/{repository}/service/{role}/{instance}/{action}
     """
     uri = self.url + "/ays/repository/"+repository+"/service/"+role+"/"+instance+"/"+action
     uri = uri + build_query_string(query_params)
     return requests.post(uri, data, headers=headers)
 def listTemplates(self, repository, headers=None, query_params=None):
     """
     list all templates
     It is method for GET /ays/repository/{repository}/template
     """
     uri = self.url + "/ays/repository/"+repository+"/template"
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
 def deleteServiceByInstance(self, instance, role, repository, headers=None, query_params=None):
     """
     uninstall and delete a service
     It is method for DELETE /ays/repository/{repository}/service/{role}/{instance}
     """
     uri = self.url + "/ays/repository/"+repository+"/service/"+role+"/"+instance
     uri = uri + build_query_string(query_params)
     return requests.delete(uri, headers=headers)
 def listServiceActions(self, instance, role, repository, headers=None, query_params=None):
     """
     Get list of action available on this service
     It is method for GET /ays/repository/{repository}/service/{role}/{instance}/action
     """
     uri = self.url + "/ays/repository/"+repository+"/service/"+role+"/"+instance+"/action"
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
 def getServiceByInstance(self, instance, role, repository, headers=None, query_params=None):
     """
     Get a service instance
     It is method for GET /ays/repository/{repository}/service/{role}/{instance}
     """
     uri = self.url + "/ays/repository/"+repository+"/service/"+role+"/"+instance
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
 def executeServiceActionByRole(self, data, action, role, repository, headers=None, query_params=None):
     """
     Perform an action on all service with the role 'role'
     It is method for POST /ays/repository/{repository}/service/{role}/action/{action}
     """
     uri = self.url + "/ays/repository/"+repository+"/service/"+role+"/action/"+action
     uri = uri + build_query_string(query_params)
     return requests.post(uri, data, headers=headers)
 def listServicesByRole(self, role, repository, headers=None, query_params=None):
     """
     List all services of role 'role' in the repository
     It is method for GET /ays/repository/{repository}/service/{role}
     """
     uri = self.url + "/ays/repository/"+repository+"/service/"+role
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
 def listRepositories(self, headers=None, query_params=None):
     """
     list all repositorys
     It is method for GET /ays/repository
     """
     uri = self.url + "/ays/repository"
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
示例#44
0
 def get_users(self, headers=None, query_params=None):
     """
     Get a list of test, this comment is very long, to test our comment generator. Is it
     good?
     It is method for GET /users
     """
     uri = self.url + "/users"
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
示例#45
0
文件: client.py 项目: dgem/go-raml
 def users_byUserId_address_byAddressId_get(self, addressId, userId, headers=None, query_params=None):
     """
     get address id
     of address
     It is method for GET /users/{userId}/address/{addressId}
     """
     uri = self.url + "/users/"+userId+"/address/"+addressId
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
示例#46
0
文件: client.py 项目: dgem/go-raml
 def get_users(self, headers=None, query_params=None):
     """
     Get a list of test, this comment is very long, to test our comment generator. Is it
     good?
     It is method for GET /users
     """
     uri = self.url + "/users"
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
示例#47
0
 def GetOrganizationDescriptionWithfallback(self,
                                            langkey,
                                            globalid,
                                            query_params=None):
     """
     It is method for GET organizations/{globalid}/description/{langkey}/withfallback
     """
     uri = self.url + "organizations/" + globalid + "/description/" + langkey + "/withfallback"
     uri = uri + build_query_string(query_params)
     return self.session.get(uri)
示例#48
0
 def DeleteOrganizationDescription(self,
                                   langkey,
                                   globalid,
                                   query_params=None):
     """
     It is method for DELETE organizations/{globalid}/description/{langkey}
     """
     uri = self.url + "organizations/" + globalid + "/description/" + langkey
     uri = uri + build_query_string(query_params)
     return self.session.delete(uri)
示例#49
0
 def RemovePendingOrganizationInvitation(self,
                                         username,
                                         globalid,
                                         query_params=None):
     """
     Cancel a pending invitation.
     It is method for DELETE /organizations/{globalid}/invitations/{username}
     """
     uri = self.url + "organizations/" + globalid + "/invitations/" + username
     uri = uri + build_query_string(query_params)
     return self.session.delete(uri)
 def getTemplate(self,
                 template,
                 repository,
                 headers=None,
                 query_params=None):
     """
     Get a template
     It is method for GET /ays/repository/{repository}/template/{template}
     """
     uri = self.url + "/ays/repository/" + repository + "/template/" + template
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
示例#51
0
 def UpdateAuthorization(self,
                         data,
                         grantedTo,
                         username,
                         query_params=None):
     """
     Modify which information an organization is able to see.
     It is method for PUT /users/{username}/authorizations/{grantedTo}
     """
     uri = self.url + "users/" + username + "/authorizations/" + grantedTo
     uri = uri + build_query_string(query_params)
     return self.session.put(uri, json=data)
示例#52
0
 def UpdateOrganizationAPIKey(self,
                              data,
                              label,
                              globalid,
                              query_params=None):
     """
     Updates the label or other properties of a key.
     It is method for PUT /organizations/{globalid}/apikeys/{label}
     """
     uri = self.url + "organizations/" + globalid + "/apikeys/" + label
     uri = uri + build_query_string(query_params)
     return self.session.put(uri, json=data)
示例#53
0
 def UpdateOrganizationDNS(self,
                           data,
                           dnsname,
                           globalid,
                           query_params=None):
     """
     Updates an existing DNS name associated with an organization
     It is method for PUT /organizations/{globalid}/dns/{dnsname}
     """
     uri = self.url + "organizations/" + globalid + "/dns/" + dnsname
     uri = uri + build_query_string(query_params)
     return self.session.put(uri, json=data)
 def deleteBlueprint(self,
                     blueprint,
                     repository,
                     headers=None,
                     query_params=None):
     """
     delete blueprint
     It is method for DELETE /ays/repository/{repository}/blueprint/{blueprint}
     """
     uri = self.url + "/ays/repository/" + repository + "/blueprint/" + blueprint
     uri = uri + build_query_string(query_params)
     return requests.delete(uri, headers=headers)
 def listServicesByRole(self,
                        role,
                        repository,
                        headers=None,
                        query_params=None):
     """
     List all services of role 'role' in the repository
     It is method for GET /ays/repository/{repository}/service/{role}
     """
     uri = self.url + "/ays/repository/" + repository + "/service/" + role
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
 def createNewTemplate(self,
                       data,
                       repository,
                       headers=None,
                       query_params=None):
     """
     Create new template
     It is method for POST /ays/repository/{repository}/template
     """
     uri = self.url + "/ays/repository/" + repository + "/template"
     uri = uri + build_query_string(query_params)
     return requests.post(uri, data, headers=headers)
 def createNewBlueprint(self,
                        data,
                        repository,
                        headers=None,
                        query_params=None):
     """
     Create a new blueprint
     It is method for POST /ays/repository/{repository}/blueprint
     """
     uri = self.url + "/ays/repository/" + repository + "/blueprint"
     uri = uri + build_query_string(query_params)
     return requests.post(uri, data, headers=headers)
 def getBlueprint(self,
                  blueprint,
                  repository,
                  headers=None,
                  query_params=None):
     """
     Get a blueprint
     It is method for GET /ays/repository/{repository}/blueprint/{blueprint}
     """
     uri = self.url + "/ays/repository/" + repository + "/blueprint/" + blueprint
     uri = uri + build_query_string(query_params)
     return requests.get(uri, headers=headers)
示例#59
0
    def users_byUserId_delete(self, userId, headers=None, query_params=None):
        """
        It is method for DELETE /users/{userId}
        """
        if self.auth_header:
            if not headers:
                headers = {'Authorization': self.auth_header}
            else:
                headers['Authorization'] = self.auth_header

        uri = self.url + "/users/"+userId
        uri = uri + build_query_string(query_params)
        return self.session.delete(uri, headers=headers)
示例#60
0
    def getuserid(self, userId, headers=None, query_params=None):
        """
        get id
        It is method for GET /users/{userId}
        """
        if self.auth_header:
            if not headers:
                headers = {'Authorization': self.auth_header}
            else:
                headers['Authorization'] = self.auth_header

        uri = self.url + "/users/"+userId
        uri = uri + build_query_string(query_params)
        return self.session.get(uri, headers=headers)