Exemplo n.º 1
0
 def share(self, **kwargs):
     api_req = utils.create_api_requestor(kwargs)
     url = '%s/%s/share' % (self.class_url(), self.get('id'))
     response = api_req.post(url, kwargs)
     data = response[self.class_name()]
     self.update(data)
     self.clear_unsaved_values()
     return self
Exemplo n.º 2
0
 def remove(cls, id, **kwargs):
     api_req = utils.create_api_requestor()
     url = '%s/%s' % (cls.class_url(), id)
     workspace = kwargs.get('workspace', None)
     if workspace:
         url = '%s?workspace=%s' % (url, workspace)
     response = api_req.delete(url)
     data = response[cls.class_name()]
     return utils.to_object(cls, {}, response)
Exemplo n.º 3
0
 def refresh(self, **kwargs):
     api_req = utils.create_api_requestor(kwargs)
     url = '%s/%s' % (self.class_url(), self.get('id'))
     kwargs = self.__retrieve_params
     response = api_req.get(url, kwargs)
     data = response[self.class_name()]
     self.update(data)
     self.clear_unsaved_values()
     return self
Exemplo n.º 4
0
 def delete(self):
     api_req = utils.create_api_requestor()
     url = '%s/%s' % (self.class_url(), self.get('id'))
     workspace = self.get('workspace', None)
     if workspace:
         url = '%s?workspace=%s' % (url, workspace)
     response = api_req.delete(url)
     data = response[self.class_name()]
     self.clear()
     self.update(data)
     self.clear_unsaved_values()
     return self
Exemplo n.º 5
0
 def run(cls, id, **kwargs):
     api_req = utils.create_api_requestor(kwargs)
     url = '%s/%s/run' % (cls.class_url(), id)
     response = api_req.post(url, kwargs)
     return utils.to_object(WorkflowExecution, kwargs, response)
Exemplo n.º 6
0
 def explore(cls, **kwargs):
     api_req = utils.create_api_requestor(kwargs)
     url = '/%s/explore' % cls.class_name_list()
     response = api_req.post(url, kwargs)
     return response
Exemplo n.º 7
0
 def __call_method(cls, method, **kwargs):
     api_req = utils.create_api_requestor(kwargs)
     url = '%s/%s' % (cls.class_url(), method)
     response = api_req.post(url, kwargs)
     return response
Exemplo n.º 8
0
 def list(cls, **kwargs):
     api_req = utils.create_api_requestor(kwargs)
     url = cls.class_url()
     response = api_req.get(url, kwargs)
     return utils.to_list(cls, kwargs, response)
Exemplo n.º 9
0
 def retrieve(cls, id, **kwargs):
     api_req = utils.create_api_requestor(kwargs)
     url = '%s/%s' % (cls.class_url(), id)
     response = api_req.get(url, kwargs)
     return utils.to_object(cls, kwargs, response)
Exemplo n.º 10
0
 def filter(cls, **kwargs):
     api_req = utils.create_api_requestor(kwargs)
     url = '/%s/filter' % cls.class_name_list()
     response = api_req.post(url, kwargs)
     return utils.to_list(cls, kwargs, response)
Exemplo n.º 11
0
 def modify(cls, id, **kwargs):
     api_req = utils.create_api_requestor(kwargs)
     url = '%s/%s' % (cls.class_url(), id)
     response = api_req.put(url, kwargs)
     data = response[cls.class_name()]
     return utils.to_object(cls, kwargs, response)
Exemplo n.º 12
0
 def create(cls, **kwargs):
     api_req = utils.create_api_requestor(kwargs)
     url = cls.class_url()
     response = api_req.post(url, kwargs)
     return utils.to_object(cls, kwargs, response)