MCPcopy
hub / github.com/aptly-dev/aptly / post_task

Method post_task

system/api_lib.py:84–94  ·  view source on GitHub ↗
(self, uri, *args, **kwargs)

Source from the content-addressed store, hash-verified

82 kwargs['params'] = params
83
84 def post_task(self, uri, *args, **kwargs):
85 self._ensure_async(kwargs)
86 resp = self.post(uri, *args, **kwargs)
87 if resp.status_code != 202:
88 raise Exception("async api error: " + resp.text)
89
90 _id = resp.json()['ID']
91 resp = self.get("/api/tasks/" + str(_id) + "/wait")
92 self.check_equal(resp.status_code, 200)
93
94 return self.get("/api/tasks/" + str(_id))
95
96 def check_task(self, task):
97 self.check_equal(task.status_code, 200)

Callers 15

checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80

Calls 4

_ensure_asyncMethod · 0.95
postMethod · 0.95
getMethod · 0.95
check_equalMethod · 0.80

Tested by

no test coverage detected