mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'refactor/backups' into refactor/upload-api
This commit is contained in:
commit
7c8781e09e
@ -229,11 +229,6 @@ def api_handlers(handler_args):
|
|||||||
ApiServersServerBackupsBackupFilesIndexHandler,
|
ApiServersServerBackupsBackupFilesIndexHandler,
|
||||||
handler_args,
|
handler_args,
|
||||||
),
|
),
|
||||||
(
|
|
||||||
r"/api/v2/servers/([a-z0-9-]+)/files(?:/([a-zA-Z0-9-]+))?/?",
|
|
||||||
ApiServersServerFilesIndexHandler,
|
|
||||||
handler_args,
|
|
||||||
),
|
|
||||||
(
|
(
|
||||||
r"/api/v2/servers/([a-z0-9-]+)/files/create/?",
|
r"/api/v2/servers/([a-z0-9-]+)/files/create/?",
|
||||||
ApiServersServerFilesCreateHandler,
|
ApiServersServerFilesCreateHandler,
|
||||||
@ -249,6 +244,11 @@ def api_handlers(handler_args):
|
|||||||
ApiServersServerFilesUploadHandler,
|
ApiServersServerFilesUploadHandler,
|
||||||
handler_args,
|
handler_args,
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
r"/api/v2/servers/([a-z0-9-]+)/files(?:/([a-zA-Z0-9-]+))?/?",
|
||||||
|
ApiServersServerFilesIndexHandler,
|
||||||
|
handler_args,
|
||||||
|
),
|
||||||
(
|
(
|
||||||
r"/api/v2/servers/([a-z0-9-]+)/tasks/?",
|
r"/api/v2/servers/([a-z0-9-]+)/tasks/?",
|
||||||
ApiServersServerTasksIndexHandler,
|
ApiServersServerTasksIndexHandler,
|
||||||
|
@ -204,7 +204,7 @@ class ApiServersServerFilesIndexHandler(BaseApiHandler):
|
|||||||
)
|
)
|
||||||
self.finish_json(200, {"status": "ok", "data": file_contents})
|
self.finish_json(200, {"status": "ok", "data": file_contents})
|
||||||
|
|
||||||
def delete(self, server_id: str):
|
def delete(self, server_id: str, _backup_id=None):
|
||||||
auth_data = self.authenticate_user()
|
auth_data = self.authenticate_user()
|
||||||
if not auth_data:
|
if not auth_data:
|
||||||
return
|
return
|
||||||
@ -262,7 +262,7 @@ class ApiServersServerFilesIndexHandler(BaseApiHandler):
|
|||||||
return self.finish_json(200, {"status": "ok"})
|
return self.finish_json(200, {"status": "ok"})
|
||||||
return self.finish_json(500, {"status": "error", "error": str(proc)})
|
return self.finish_json(500, {"status": "error", "error": str(proc)})
|
||||||
|
|
||||||
def patch(self, server_id: str):
|
def patch(self, server_id: str, _backup_id):
|
||||||
auth_data = self.authenticate_user()
|
auth_data = self.authenticate_user()
|
||||||
if not auth_data:
|
if not auth_data:
|
||||||
return
|
return
|
||||||
@ -316,7 +316,7 @@ class ApiServersServerFilesIndexHandler(BaseApiHandler):
|
|||||||
file_object.write(file_contents)
|
file_object.write(file_contents)
|
||||||
return self.finish_json(200, {"status": "ok"})
|
return self.finish_json(200, {"status": "ok"})
|
||||||
|
|
||||||
def put(self, server_id: str):
|
def put(self, server_id: str, _backup_id):
|
||||||
auth_data = self.authenticate_user()
|
auth_data = self.authenticate_user()
|
||||||
if not auth_data:
|
if not auth_data:
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user