mirror of
https://github.com/blw1138/Zordon.git
synced 2026-06-09 21:49:23 -05:00
Change api methods to use POST when possible
This commit is contained in:
@@ -109,6 +109,11 @@ class RenderServerProxy:
|
||||
return requests.get(f'http://{self.hostname}:{self.port}/api/{payload}', timeout=timeout,
|
||||
headers={"X-API-Version": str(API_VERSION)})
|
||||
|
||||
def _post(self, payload, timeout=5, **kwargs):
|
||||
from src.api.api_server import API_VERSION
|
||||
return requests.post(f'http://{self.hostname}:{self.port}/api/{payload}', timeout=timeout,
|
||||
headers={"X-API-Version": str(API_VERSION)}, **kwargs)
|
||||
|
||||
# --------------------------------------------
|
||||
# Background Updates:
|
||||
# --------------------------------------------
|
||||
@@ -225,10 +230,10 @@ class RenderServerProxy:
|
||||
return response
|
||||
|
||||
def cancel_job(self, job_id, confirm=False):
|
||||
return self.request_data(f'job/{job_id}/cancel?confirm={confirm}')
|
||||
return self._post(f'job/{job_id}/cancel', params={'confirm': confirm})
|
||||
|
||||
def delete_job(self, job_id, confirm=False):
|
||||
return self.request_data(f'job/{job_id}/delete?confirm={confirm}')
|
||||
return self._post(f'job/{job_id}/delete', params={'confirm': confirm})
|
||||
|
||||
def send_subjob_update_notification(self, parent_id, subjob):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user