Support forwarding POST request to compute nodes

This commit is contained in:
Julien Duponchelle
2016-06-06 15:45:32 +02:00
parent 61ac8763f2
commit 06b54d82dc
4 changed files with 51 additions and 8 deletions

View File

@ -324,9 +324,9 @@ class Compute:
return (yield from self.http_query("DELETE", path, **kwargs))
@asyncio.coroutine
def forward(self, type, path):
def forward(self, method, type, path, data=None):
"""
Forward a call to the emulator on compute
"""
res = yield from self.get("/{}/{}".format(type, path))
res = yield from self.http_query(method, "/{}/{}".format(type, path), data=data)
return res.json