From d49cd9df79101af3aa422e9224939b6e92417a4e Mon Sep 17 00:00:00 2001 From: Brett Williams Date: Sat, 6 Jun 2026 06:47:04 -0500 Subject: [PATCH] More API cleanup --- docs/API.md | 514 +++++++++++++++++++++++++++++++++ docs/api.html | 596 +++++++++++++++++++++++++++++++++++++++ src/api/api_server.py | 22 +- src/api/server_proxy.py | 6 +- src/ui/add_job_window.py | 2 +- 5 files changed, 1127 insertions(+), 13 deletions(-) create mode 100644 docs/API.md create mode 100644 docs/api.html diff --git a/docs/API.md b/docs/API.md new file mode 100644 index 0000000..d57be1a --- /dev/null +++ b/docs/API.md @@ -0,0 +1,514 @@ +# Zordon API Reference + +Zordon exposes a Flask API from `src/api/api_server.py`. The server is started by +`start_api_server()` and listens on `Config.port_number` with all application +routes mounted under `/api`. + +The in-repo client wrapper is `src/api/server_proxy.py`. Most UI and distributed +rendering code should prefer `RenderServerProxy` instead of constructing request +URLs directly. + +## Versioning + +- Current API version: `0.1` +- `RenderServerProxy.request()` sends `X-API-Version` with the current + `API_VERSION`, but the server does not currently validate this header. + +## Response Conventions + +- JSON endpoints return Flask-serialized dictionaries or lists. +- File endpoints return `send_file()` responses. +- Most error responses are plain text with HTTP `400`, `404`, `500`, or `503`. +- `JobNotFoundError` is mapped to HTTP `400`. +- Unhandled exceptions are mapped to HTTP `500` with a plain-text message. + +## Jobs + +### `GET /api/jobs` + +Returns all render jobs and a cache token. + +Response: + +```json +{ + "jobs": [ + { + "id": "job-id", + "name": "job name", + "status": "running" + } + ], + "token": "cache-token" +} +``` + +Known callers: + +- `RenderServerProxy.get_all_jobs()` +- `src/ui/main_window.py` + +### `GET /api/jobs_long_poll` + +Long-polls the job list until the supplied cache token changes or 30 seconds +elapse. + +Query parameters: + +| Name | Required | Description | +| --- | --- | --- | +| `token` | No | Cache token returned by `/api/jobs`. | + +Responses: + +- `200` with the same shape as `/api/jobs` when jobs changed. +- `204` with an empty body when no changes arrive before timeout. + +Known callers: + +- `RenderServerProxy.get_all_jobs()` through the background cache updater. + +### `GET /api/jobs/` + +Returns jobs matching a render status. + +Path parameters: + +| Name | Description | +| --- | --- | +| `status_val` | Status string converted by `string_to_status()`. | + +Responses: + +- `200` with a list of job JSON objects when matches exist. +- `400` when no jobs match the requested status. + +Review note: this route is not currently wrapped by `RenderServerProxy` and no +in-repo callers were found. + +### `GET /api/job/` + +Returns one job as JSON. + +Known callers: + +- `RenderServerProxy.get_job_info()` +- `add_job.py` +- `src/ui/main_window.py` +- `src/distributed_job_manager.py` +- `tests/job_creation_tests.py` + +### `GET /api/job//logs` + +Returns the job log file as `text/plain`. + +Known callers: + +- `src/ui/main_window.py` opens this URL directly. + +### `GET /api/job//file_list` + +Returns a list of output filenames for the job. + +Known callers: + +- `RenderServerProxy.get_job_files_list()` +- `src/utilities/server_helper.py` + +### `GET /api/job//download` + +Downloads one output file. + +Query parameters: + +| Name | Required | Description | +| --- | --- | --- | +| `filename` | Yes | Case-insensitive filename from the job file list. | + +Responses: + +- `200` with the requested file as an attachment. +- `400` when `filename` is missing. +- `404` when the file is not found. + +Known callers: + +- `RenderServerProxy.download_job_file()` +- `src/utilities/server_helper.py` + +### `GET /api/job//download_all` + +Creates a temporary zip of the job output directory and downloads it. + +Known callers: + +- `RenderServerProxy.download_all_job_files()` +- `src/ui/main_window.py` +- `src/utilities/server_helper.py` + +### `GET /api/job//thumbnail` + +Returns a generated preview image or video for a job. + +Query parameters: + +| Name | Required | Description | +| --- | --- | --- | +| `size` | No | `big` selects the larger preview path. Currently parsed but not applied. | +| `video_ok` | No | If truthy and a video preview exists, video can be returned. | + +Responses: + +- `200` with `image/jpeg` or `video/mp4`. +- `404` when no thumbnail is available. +- `500` on preview generation errors. + +Known callers: + +- `src/ui/main_window.py` + +Review note: `size=big` is parsed into `big_thumb` but not used. + +## Job Lifecycle + +### `POST /api/add_job` + +Adds one or more render jobs. + +Request formats: + +- JSON request body. +- Multipart form with a `json` field and optional `file` upload. + +Common job fields include: + +| Name | Description | +| --- | --- | +| `name` | Display name for the render job. | +| `renderer` | Render engine name such as `blender` or `ffmpeg`. | +| `start_frame` | First frame to render. | +| `end_frame` | Last frame to render. | +| `args` | Engine-specific render arguments. | +| `enable_split_jobs` | Whether distributed subjobs may be created. | +| `child_jobs` | Optional subjob definitions. | +| `local_path` | Local file path used when posting to localhost. | + +Responses: + +- `200` with created job data. +- `400` for invalid or missing job data. +- `500` for unexpected processing or creation errors. + +Known callers: + +- `RenderServerProxy.post_job_to_server()` +- `add_job.py` +- `src/ui/add_job_window.py` +- `src/distributed_job_manager.py` +- `tests/job_creation_tests.py` + +### `POST /api/job//cancel` + +Cancels a job. + +Query parameters: + +| Name | Required | Description | +| --- | --- | --- | +| `confirm` | Yes | Must be truthy or the request is rejected. | +| `redirect` | No | If truthy, redirects to `index`. | + +Known callers: + +- `RenderServerProxy.cancel_job()` +- `src/ui/main_window.py` +- `src/distributed_job_manager.py` + +### `POST /api/job//delete` + +Deletes a job, stops it first, deletes previews, and removes owned upload/output +directories when safe. + +Query parameters: + +| Name | Required | Description | +| --- | --- | --- | +| `confirm` | Yes | Must be truthy or the request is rejected. | + +Known callers: + +- `RenderServerProxy.delete_job()` +- `src/ui/main_window.py` + +### `POST /api/job//send_subjob_update_notification` + +Notifies a parent job that a child/subjob changed state. + +Request body: + +- JSON representation of a subjob. + +Known callers: + +- `RenderServerProxy.send_subjob_update_notification()` +- `src/distributed_job_manager.py` + +## Status and Environment + +### `GET /api/heartbeat` + +Returns the current timestamp as plain text. Used for fast connectivity checks. + +Known callers: + +- `RenderServerProxy.check_connection()` + +### `GET /api/status` + +Returns local system and queue status. + +Response includes: + +- timestamp +- operating system and version +- CPU brand, count, and current utilization +- memory totals and current utilization +- job counts +- hostname and port +- app and API versions + +Known callers: + +- `RenderServerProxy.get_status()` + +### `GET /api/snapshot` + +Returns local status, all jobs, and a timestamp. + +Known callers: + +- `full_status()` internally. + +Review note: no direct in-repo HTTP callers were found. It overlaps with +`/api/status` plus `/api/jobs`. + +### `GET /api/full_status` + +Returns a multi-server shaped status payload with the local server populated. + +Known callers: + +- `RenderServerProxy.get_data()` +- `dashboard.py` + +Review note: this currently reports only the local server. The response shape +suggests an intended future aggregation point. + +### `GET /api/presets` + +Returns `config/presets.yaml`. + +Review note: no in-repo callers were found. + +### `GET /api/cpu_benchmark` + +Runs a CPU benchmark for 10 seconds and returns the score as plain text. + +Known callers: + +- `src/utilities/server_helper.py` + +### `GET /api/disk_benchmark` + +Runs a disk I/O benchmark and returns write/read speeds. + +Review note: no in-repo callers were found. + +## Engines + +### `GET /api/engines/for_filename` + +Returns the engine name suitable for a project filename. + +Query parameters: + +| Name | Required | Description | +| --- | --- | --- | +| `filename` | Yes | Project filename or path. The client currently sends only the basename. | + +Known callers: + +- `RenderServerProxy.get_engine_for_filename()` +- `src/ui/add_job_window.py` + +### `GET /api/engines` + +Returns installed engine data keyed by engine name. + +Query parameters: + +| Name | Required | Description | +| --- | --- | --- | +| `response_type` | No | `standard` or `full`; defaults to `standard`. | + +`full` responses also include supported extensions, supported export formats, +system info, and UI options. + +Known callers: + +- `RenderServerProxy.get_engines()` +- `src/ui/settings_window.py` +- `src/ui/engine_browser.py` + +### `GET /api/engines/names` + +Returns installed engine names as a list without instantiating engine classes. +Use this for lightweight selection UIs that only need engine names. + +Known callers: + +- `RenderServerProxy.get_engine_names()` +- `src/ui/add_job_window.py` + +### `GET /api/engines/` + +Returns installed version data for a single engine. + +Query parameters: + +| Name | Required | Description | +| --- | --- | --- | +| `response_type` | No | `standard` or `full`; defaults to `standard`. | + +`full` responses also include supported extensions, supported export formats, +system info, and UI options. + +Known callers: + +- `RenderServerProxy.get_engine()` +- `src/ui/add_job_window.py` + +### `GET /api/engines//availability` + +Returns whether an engine can accept jobs on this server, plus CPU count, +installed versions, and hostname. + +Known callers: + +- `RenderServerProxy.get_engine_availability()` +- `src/distributed_job_manager.py` + +### `GET /api/engines//args` + +Returns engine arguments. + +Review note: no in-repo callers were found. + +### `GET /api/engines//help` + +Returns engine help text. + +Known callers: + +- `src/ui/add_job_window.py` opens this URL directly. + +### `GET /api/engines/download_available` + +Checks whether a managed engine version is available to download. + +Query parameters: + +| Name | Required | Description | +| --- | --- | --- | +| `engine` | Yes | Engine name. | +| `version` | Yes | Engine version. | +| `system_os` | No | Target OS. | +| `cpu` | No | Target CPU architecture. | + +Review note: no in-repo callers were found. + +### `GET /api/engines/most_recent_version` + +Finds the most recent downloadable version for an engine. + +Query parameters: + +| Name | Required | Description | +| --- | --- | --- | +| `engine` | Yes | Engine name. | +| `system_os` | No | Target OS. | +| `cpu` | No | Target CPU architecture. | + +Review note: no in-repo callers were found. + +### `POST /api/engines/download` + +Downloads a managed engine version. + +Query parameters: + +| Name | Required | Description | +| --- | --- | --- | +| `engine` | Yes | Engine name. | +| `version` | Yes | Engine version. | +| `system_os` | No | Target OS. | +| `cpu` | No | Target CPU architecture. | + +Review note: no in-repo callers were found. Settings currently calls +`EngineManager.download_engine()` directly instead of this API route. + +### `POST /api/engines/delete` + +Deletes a managed engine download. + +JSON body: + +| Name | Required | Description | +| --- | --- | --- | +| `engine` | Yes | Engine name. | +| `version` | Yes | Engine version. | +| `system_os` | No | Target OS. | +| `cpu` | No | Target CPU architecture. | + +Known callers: + +- `RenderServerProxy.delete_engine_download()` +- `src/ui/engine_browser.py` + +## Debug + +### `GET /api/_debug/detected_clients` + +Returns hostnames detected by Zeroconf. + +Review note: development/debug only, with an inline comment saying it probably +should not ship. + +### `POST /api/_debug/clear_history` + +Clears render queue history and returns `success`. + +Review note: development/debug only. + +## Redundancy and Cleanup Review + +Likely redundant or overlapping routes: + +- `/api/snapshot` overlaps with `/api/status` and `/api/jobs`. It is currently + used internally by `/api/full_status`. +Routes with no in-repo callers found: + +- `GET /api/jobs/` +- `GET /api/presets` +- `GET /api/disk_benchmark` +- `GET /api/engines//args` +- `GET /api/engines/download_available` +- `GET /api/engines/most_recent_version` +- `POST /api/engines/download` +- `GET /api/_debug/detected_clients` +- `POST /api/_debug/clear_history` + +Routes or methods with cleanup risks: + +- `job_thumbnail()` parses `size=big` but never uses the resulting `big_thumb` + value. diff --git a/docs/api.html b/docs/api.html new file mode 100644 index 0000000..b4a65b1 --- /dev/null +++ b/docs/api.html @@ -0,0 +1,596 @@ + + + + + +Zordon API Reference + + + +
+

Zordon API Reference

+

Flask endpoints exposed by src/api/api_server.py, with the in-repo client wrapper in src/api/server_proxy.py.

+
+ +
+ + +
+
+

Overview

+
+
+

Versioning

+
    +
  • Current API version: 0.1
  • +
  • RenderServerProxy.request() sends X-API-Version.
  • +
  • The server does not currently validate that header.
  • +
+
+
+

Response Conventions

+
    +
  • JSON endpoints return Flask-serialized dictionaries or lists.
  • +
  • File endpoints return send_file() responses.
  • +
  • Most errors are plain text with 400, 404, 500, or 503.
  • +
  • JobNotFoundError maps to HTTP 400.
  • +
+
+
+
+ +
+

Jobs

+ +
+
GET/api/jobs
+

Returns all render jobs and a cache token.

+
{
+  "jobs": [{"id": "job-id", "name": "job name", "status": "running"}],
+  "token": "cache-token"
+}
+

Known callers:

+
    +
  • RenderServerProxy.get_all_jobs()
  • +
  • src/ui/main_window.py
  • +
+
+ +
+
GET/api/jobs_long_poll
+

Long-polls the job list until the supplied cache token changes or 30 seconds elapse.

+ + + +
Query ParameterRequiredDescription
tokenNoCache token returned by /api/jobs.
+

Returns 200 with job data when changed, or 204 when no change arrives before timeout.

+
+ +
+
GET/api/jobs/<status_val>
+

Returns jobs matching a render status converted by string_to_status().

+
No RenderServerProxy wrapper or in-repo caller was found.
+
+ +
+
GET/api/job/<job_id>
+

Returns one job as JSON.

+

Known callers include RenderServerProxy.get_job_info(), add_job.py, src/ui/main_window.py, src/distributed_job_manager.py, and tests/job_creation_tests.py.

+
+ +
+
GET/api/job/<job_id>/logs
+

Returns the job log file as text/plain. The main window opens this URL directly.

+
+ +
+
GET/api/job/<job_id>/file_list
+

Returns a list of output filenames for the job.

+

Known callers: RenderServerProxy.get_job_files_list() and src/utilities/server_helper.py.

+
+ +
+
GET/api/job/<job_id>/download
+

Downloads one output file.

+ + + +
Query ParameterRequiredDescription
filenameYesCase-insensitive filename from the job file list.
+

Returns 200 with an attachment, 400 when filename is missing, or 404 when the file is not found.

+
+ +
+
GET/api/job/<job_id>/download_all
+

Creates a temporary zip of the job output directory and downloads it.

+

Known callers: RenderServerProxy.download_all_job_files(), src/ui/main_window.py, and src/utilities/server_helper.py.

+
+ +
+
GET/api/job/<job_id>/thumbnail
+

Returns a generated preview image or video for a job.

+ + + + +
Query ParameterRequiredDescription
sizeNobig is parsed but not currently applied.
video_okNoIf truthy and a video preview exists, video can be returned.
+
Cleanup note: size=big is parsed into big_thumb but not used.
+
+
+ +
+

Job Lifecycle

+ +
+
POST/api/add_job
+

Adds one or more render jobs. Accepts either a JSON request body or multipart form data with a json field and optional file upload.

+ + + + + + + + + + +
Common FieldDescription
nameDisplay name for the render job.
rendererRender engine name such as blender or ffmpeg.
start_frameFirst frame to render.
end_frameLast frame to render.
argsEngine-specific render arguments.
enable_split_jobsWhether distributed subjobs may be created.
child_jobsOptional subjob definitions.
local_pathLocal file path used when posting to localhost.
+

Known callers include RenderServerProxy.post_job_to_server(), add_job.py, src/ui/add_job_window.py, src/distributed_job_manager.py, and integration tests.

+
+ +
+
POST/api/job/<job_id>/cancel
+

Cancels a job. Requires a truthy confirm query parameter.

+ + + + +
Query ParameterRequiredDescription
confirmYesMust be truthy or the request is rejected.
redirectNoIf truthy, redirects to index.
+
+ +
+
POST/api/job/<job_id>/delete
+

Deletes a job, stops it first, deletes previews, and removes owned upload/output directories when safe.

+ + + +
Query ParameterRequiredDescription
confirmYesMust be truthy or the request is rejected.
+
+ +
+
POST/api/job/<job_id>/send_subjob_update_notification
+

Notifies a parent job that a child/subjob changed state. The request body is the JSON representation of the subjob.

+
+
+ +
+

Status and Environment

+ +
+
GET/api/heartbeat
+

Returns the current timestamp as plain text. Used by RenderServerProxy.check_connection().

+
+ +
+
GET/api/status
+

Returns local system and queue status, including operating system, CPU, memory, job counts, hostname, port, app version, and API version.

+
+ +
+
GET/api/snapshot
+

Returns local status, all jobs, and a timestamp.

+
No direct in-repo HTTP callers were found. It overlaps with /api/status plus /api/jobs and is used internally by /api/full_status.
+
+ +
+
GET/api/full_status
+

Returns a multi-server shaped status payload with the local server populated. Used by RenderServerProxy.get_data() and dashboard.py.

+
The response shape suggests an intended future aggregation point, but it currently reports only the local server.
+
+ +
+
GET/api/presets
+

Returns config/presets.yaml.

+
No in-repo callers were found.
+
+ +
+
GET/api/cpu_benchmark
+

Runs a CPU benchmark for 10 seconds and returns the score as plain text. Used by src/utilities/server_helper.py.

+
+ +
+
GET/api/disk_benchmark
+

Runs a disk I/O benchmark and returns write/read speeds.

+
No in-repo callers were found.
+
+
+ +
+

Engines

+ +
+
GET/api/engines/for_filename
+

Returns the engine name suitable for a project filename.

+ + + +
Query ParameterRequiredDescription
filenameYesProject filename or path. The client currently sends only the basename.
+
+ +
+
GET/api/engines
+

Returns installed engine data keyed by engine name.

+ + + +
Query ParameterRequiredDescription
response_typeNostandard or full; defaults to standard.
+

full responses include supported extensions, supported export formats, system info, and UI options.

+

Known callers: RenderServerProxy.get_engines(), src/ui/settings_window.py, and src/ui/engine_browser.py.

+
+ +
+
GET/api/engines/names
+

Returns installed engine names as a list without instantiating engine classes. Use this for lightweight selection UIs that only need engine names.

+

Known callers: RenderServerProxy.get_engine_names() and src/ui/add_job_window.py.

+
+ +
+
GET/api/engines/<engine_name>
+

Returns installed version data for a single engine.

+ + + +
Query ParameterRequiredDescription
response_typeNostandard or full; defaults to standard.
+

full responses include supported extensions, supported export formats, system info, and UI options.

+

Known caller: RenderServerProxy.get_engine() in the add-job window.

+
+ +
+
GET/api/engines/<engine_name>/availability
+

Returns whether an engine can accept jobs on this server, plus CPU count, installed versions, and hostname.

+
+ +
+
GET/api/engines/<engine_name>/args
+

Returns engine arguments.

+
No in-repo callers were found.
+
+ +
+
GET/api/engines/<engine_name>/help
+

Returns engine help text. The add-job window opens this URL directly.

+
+ +
+
GET/api/engines/download_available
+

Checks whether a managed engine version is available to download.

+ + + + + + +
Query ParameterRequiredDescription
engineYesEngine name.
versionYesEngine version.
system_osNoTarget OS.
cpuNoTarget CPU architecture.
+
No in-repo callers were found.
+
+ +
+
GET/api/engines/most_recent_version
+

Finds the most recent downloadable version for an engine.

+ + + + + +
Query ParameterRequiredDescription
engineYesEngine name.
system_osNoTarget OS.
cpuNoTarget CPU architecture.
+
No in-repo callers were found.
+
+ +
+
POST/api/engines/download
+

Downloads a managed engine version.

+ + + + + + +
Query ParameterRequiredDescription
engineYesEngine name.
versionYesEngine version.
system_osNoTarget OS.
cpuNoTarget CPU architecture.
+
Settings currently calls EngineManager.download_engine() directly instead of this API route.
+
+ +
+
POST/api/engines/delete
+

Deletes a managed engine download.

+ + + + + + +
JSON FieldRequiredDescription
engineYesEngine name.
versionYesEngine version.
system_osNoTarget OS.
cpuNoTarget CPU architecture.
+
+
+ +
+

Debug

+ +
+
GET/api/_debug/detected_clients
+

Returns hostnames detected by Zeroconf.

+
Development/debug only, with an inline comment saying it probably should not ship.
+
+ +
+
POST/api/_debug/clear_history
+

Clears render queue history and returns success.

+
Development/debug only.
+
+
+ +
+

Cleanup Review

+
+

Likely Redundant Or Overlapping Routes

+
    +
  • /api/snapshot overlaps with /api/status and /api/jobs. It is currently used internally by /api/full_status.
  • +
+
+ +
+

Routes With No In-Repo Callers Found

+
    +
  • GET /api/jobs/<status_val>
  • +
  • GET /api/presets
  • +
  • GET /api/disk_benchmark
  • +
  • GET /api/engines/<engine_name>/args
  • +
  • GET /api/engines/download_available
  • +
  • GET /api/engines/most_recent_version
  • +
  • POST /api/engines/download
  • +
  • GET /api/_debug/detected_clients
  • +
  • POST /api/_debug/clear_history
  • +
+
+ +
+

Cleanup Risks

+
    +
  • job_thumbnail() parses size=big but never uses the resulting big_thumb value.
  • +
+
+
+
+
+ + diff --git a/src/api/api_server.py b/src/api/api_server.py index ad768c9..7124327 100755 --- a/src/api/api_server.py +++ b/src/api/api_server.py @@ -370,7 +370,7 @@ def delete_job(job_id): # Engine Info and Management: # -------------------------------------------- -@server.get('/api/engine_for_filename') +@server.get('/api/engines/for_filename') def get_engine_for_filename(): filename = request.args.get("filename") if not filename: @@ -463,27 +463,31 @@ def get_engine(engine_name): return {} -@server.get('/api//is_available') +@server.get('/api/engines//availability') def get_engine_availability(engine_name): return {'engine': engine_name, 'available': RenderQueue.is_available_for_job(engine_name), 'cpu_count': int(psutil.cpu_count(logical=False)), 'versions': EngineManager.all_version_data_for_engine(engine_name), - 'hostname': server.config['HOSTNAME']} + 'hostname': server.config.get('HOSTNAME', socket.gethostname())} -@server.get('/api/engine//args') +@server.get('/api/engines//args') def get_engine_args(engine_name): try: engine_class = EngineManager.engine_class_with_name(engine_name) + if not engine_class: + return f"Cannot find engine '{engine_name}'", 400 return engine_class().get_arguments() except LookupError: return f"Cannot find engine '{engine_name}'", 400 -@server.get('/api/engine//help') +@server.get('/api/engines//help') def get_engine_help(engine_name): try: engine_class = EngineManager.engine_class_with_name(engine_name) + if not engine_class: + return f"Cannot find engine '{engine_name}'", 400 return engine_class().get_help() except LookupError: return f"Cannot find engine '{engine_name}'", 400 @@ -492,7 +496,7 @@ def get_engine_help(engine_name): # Engine Downloads and Updates: # -------------------------------------------- -@server.get('/api/is_engine_available_to_download') +@server.get('/api/engines/download_available') def is_engine_available_to_download(): available_result = EngineManager.version_is_available_to_download(request.args.get('engine'), request.args.get('version'), @@ -502,7 +506,7 @@ def is_engine_available_to_download(): (f"Cannot find available download for {request.args.get('engine')} {request.args.get('version')}", 500) -@server.get('/api/find_most_recent_version') +@server.get('/api/engines/most_recent_version') def find_most_recent_version(): most_recent = EngineManager.find_most_recent_version(request.args.get('engine'), request.args.get('system_os'), @@ -511,7 +515,7 @@ def find_most_recent_version(): (f"Error finding most recent version of {request.args.get('engine')}", 500) -@server.post('/api/download_engine') +@server.post('/api/engines/download') def download_engine(): download_result = EngineManager.download_engine(request.args.get('engine'), request.args.get('version'), @@ -521,7 +525,7 @@ def download_engine(): (f"Error downloading {request.args.get('engine')} {request.args.get('version')}", 500) -@server.post('/api/delete_engine') +@server.post('/api/engines/delete') def delete_engine_download(): json_data = request.json delete_result = EngineManager.delete_engine_download(json_data.get('engine'), diff --git a/src/api/server_proxy.py b/src/api/server_proxy.py index 6ff7e17..76bde84 100644 --- a/src/api/server_proxy.py +++ b/src/api/server_proxy.py @@ -254,11 +254,11 @@ class RenderServerProxy: # -------------------------------------------- def get_engine_for_filename(self, filename:str, timeout=5): - response = self.request(f'engine_for_filename?filename={os.path.basename(filename)}', timeout) + response = self.request(f'engines/for_filename?filename={os.path.basename(filename)}', timeout) return response.text def get_engine_availability(self, engine_name:str, timeout=5): - return self.request_data(f'{engine_name}/is_available', timeout) + return self.request_data(f'engines/{engine_name}/availability', timeout) def get_engine_names(self, timeout=5): return self.request_data('engines/names', timeout=timeout) @@ -305,7 +305,7 @@ class RenderServerProxy: Response: The response from the server. """ form_data = {'engine': engine_name, 'version': version, 'system_os': system_os, 'cpu': cpu} - return self._post('delete_engine', json=form_data) + return self._post('engines/delete', json=form_data) # -------------------------------------------- # Download Files: diff --git a/src/ui/add_job_window.py b/src/ui/add_job_window.py index 0da814f..0ba4d75 100644 --- a/src/ui/add_job_window.py +++ b/src/ui/add_job_window.py @@ -386,7 +386,7 @@ class NewRenderJobForm(QWidget): self.job_name_input.setText(directory) def args_help_button_clicked(self): - url = (f'http://{self.server_proxy.hostname}:{self.server_proxy.port}/api/engine/' + url = (f'http://{self.server_proxy.hostname}:{self.server_proxy.port}/api/engines/' f'{self.engine_type.currentText()}/help') self.engine_help_viewer = EngineHelpViewer(url) self.engine_help_viewer.show()