Beispiel #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
 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)
 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
 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
Beispiel #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)
Beispiel #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
Beispiel #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
 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)
 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)
 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)
 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)
 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)