Commit efad160b by Máhonfai Bálint

Add new requests to store api for SSH disk export

parent b7436aa6
...@@ -47,7 +47,7 @@ class NoStoreException(StoreApiException): ...@@ -47,7 +47,7 @@ class NoStoreException(StoreApiException):
class Store(object): class Store(object):
def __init__(self, user, default_timeout=0.5): def __init__(self, user, default_timeout=5):
self.store_url = settings.STORE_URL self.store_url = settings.STORE_URL
if not self.store_url: if not self.store_url:
raise NoStoreException raise NoStoreException
...@@ -127,6 +127,17 @@ class Store(object): ...@@ -127,6 +127,17 @@ class Store(object):
r = self._request_cmd("UPLOAD", PATH=path) r = self._request_cmd("UPLOAD", PATH=path)
return r.json()['LINK'] return r.json()['LINK']
def request_disk_export(self):
r = self._request_cmd("EXPORT_DISK")
return r.json()['LINK'], r.json()['PORT']
def disk_export_finished(self, file_name, new_name):
self._request_cmd(
"EXPORT_DISK_FINISHED",
FILENAME=file_name,
NEWNAME=new_name
)
def remove(self, path): def remove(self, path):
self._request_cmd("REMOVE", PATH=path) self._request_cmd("REMOVE", PATH=path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment