diff --git a/README.md b/README.md index 11a7eed..4d5fb94 100644 --- a/README.md +++ b/README.md @@ -83,18 +83,24 @@ The system works by: Jobs can be submitted via the desktop UI or programmatically via the API: - **Via UI**: Use the desktop interface to upload project files, specify render settings, and queue jobs. -- **Via API**: Send POST requests to `/api/jobs` with job configuration in JSON format. +- **Via API**: Send `POST` requests to `/api/add_job` with job configuration in JSON format. Example API request: ```bash -curl -X POST http://localhost:5000/api/jobs \ +curl -X POST http://localhost:8080/api/add_job \ -H "Content-Type: application/json" \ -d '{ - "engine": "blender", - "project_path": "/path/to/project.blend", - "output_path": "/path/to/output", - "frames": "1-100", - "settings": {"resolution": "1920x1080"} + "name": "example-render", + "engine_name": "blender", + "local_path": "/path/to/project.blend", + "output_path": "example-output", + "start_frame": 1, + "end_frame": 100, + "args": { + "export_format": "PNG", + "resolution": [1920, 1080] + }, + "enable_split_jobs": false }' ``` @@ -103,9 +109,14 @@ curl -X POST http://localhost:5000/api/jobs \ - **UI**: View job status, progress, logs, and worker availability in real-time. - **API Endpoints**: - `GET /api/jobs`: List all jobs - - `GET /api/jobs/{id}`: Get job details - - `DELETE /api/jobs/{id}`: Cancel a job - - `GET /api/workers`: List connected workers + - `GET /api/job/`: Get job details + - `POST /api/job//cancel`: Cancel a job + - `POST /api/job//delete`: Delete a job + - `GET /api/status`: Get server and queue status + - `GET /api/engines`: List engine information + +For the full endpoint reference, see [`docs/api.html`](docs/api.html) or +[`docs/API.md`](docs/API.md). #### Worker Management @@ -193,4 +204,4 @@ Zordon is licensed under the MIT License. See the [LICENSE](LICENSE.txt) file fo ## Notice -This software is in beta and intended for casual/hobbyist use. Not recommended for mission-critical environments. \ No newline at end of file +This software is in beta and intended for casual/hobbyist use. Not recommended for mission-critical environments. diff --git a/src/api/api_server.py b/src/api/api_server.py index a670a9d..8c6d0d9 100755 --- a/src/api/api_server.py +++ b/src/api/api_server.py @@ -380,16 +380,6 @@ def get_engine_for_filename(): return f"Error: cannot find a suitable engine for '{filename}'", 400 return found_engine.name() -@server.get('/api/installed_engines') -def get_installed_engines(): - result = {} - for engine_class in EngineManager.supported_engines(): - data = EngineManager.all_version_data_for_engine(engine_class.name()) - if data: - result[engine_class.name()] = data - return result - - def _validated_engine_response_type(): response_type = request.args.get('response_type', 'standard') if response_type not in ['full', 'standard']: diff --git a/src/api/server_proxy.py b/src/api/server_proxy.py index 168e480..21ad357 100644 --- a/src/api/server_proxy.py +++ b/src/api/server_proxy.py @@ -258,7 +258,7 @@ class RenderServerProxy: return response.text def get_installed_engines(self, timeout=5): - return self.request_data(f'installed_engines', timeout) + return self.get_all_engine_info(timeout=timeout) def is_engine_available(self, engine_name:str, timeout=5): return self.request_data(f'{engine_name}/is_available', timeout)