Ejemplo n.º 1
0
 def _getjob(self, root, jobname, xa=None):
     root_type = root.__class__.__name__
     root_id = root.id
     url = "/rest/api/uom/%s/%s/do/%s" % (root_type, root_id, jobname,)
     k2resp = self.api.client.get(url, xa=xa)
     obj = k2web.JobRequest()
     v1k2loader.process_root("web", obj, k2resp.entry.element)
     obj._k2resp = k2resp
     return obj
Ejemplo n.º 2
0
 def _runjob(self, root, child, xa=None):
     service = "web"
     root_type = root.__class__.__name__
     root_id = root.id
     element = v1k2creater.process_root(service,
                                        v1k2creater.Mode.UPDATE,
                                        child)
     k2resp = self.api.client.runjob(element,
                                     root_type,
                                     root_id=root_id,
                                     xa=xa)
     obj = k2web.JobResponse()
     v1k2loader.process_root("web", obj, k2resp.entry.element)
     obj._k2resp = k2resp
     return obj
Ejemplo n.º 3
0
 def _readjob(self, job_id, xa=None):
     k2resp = self.api.client.readjob(job_id, xa=xa)
     obj = k2web.JobResponse()
     v1k2loader.process_root("web", obj, k2resp.entry.element)
     obj._k2resp = k2resp
     return obj