diff options
| author | soryu <soryu@soryu.co> | 2026-01-20 00:23:49 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-01-20 00:23:49 +0000 |
| commit | 5d8e3f80254f20eb6672701fad5f116a3b05dbc3 (patch) | |
| tree | 02cc73bd49a416112c9dd7f21c480c156068827c /makima/src/daemon/api/supervisor.rs | |
| parent | 9aac84bb20c4ca73f113fe74b9a293e4d20cdc93 (diff) | |
| download | soryu-5d8e3f80254f20eb6672701fad5f116a3b05dbc3.tar.gz soryu-5d8e3f80254f20eb6672701fad5f116a3b05dbc3.zip | |
Fix: auth for CLI and CLI SIGTERM
Diffstat (limited to 'makima/src/daemon/api/supervisor.rs')
| -rw-r--r-- | makima/src/daemon/api/supervisor.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/makima/src/daemon/api/supervisor.rs b/makima/src/daemon/api/supervisor.rs index 1dc699e..9614cfc 100644 --- a/makima/src/daemon/api/supervisor.rs +++ b/makima/src/daemon/api/supervisor.rs @@ -248,4 +248,29 @@ impl ApiClient { self.get(&format!("/api/v1/mesh/tasks/{}/output", task_id)) .await } + + /// Delete a task. + pub async fn delete_task(&self, task_id: Uuid) -> Result<(), ApiError> { + self.delete(&format!("/api/v1/mesh/tasks/{}", task_id)).await + } + + /// Update a task. + pub async fn update_task( + &self, + task_id: Uuid, + name: Option<String>, + plan: Option<String>, + ) -> Result<JsonValue, ApiError> { + #[derive(Serialize)] + #[serde(rename_all = "camelCase")] + struct UpdateTaskRequest { + #[serde(skip_serializing_if = "Option::is_none")] + name: Option<String>, + #[serde(skip_serializing_if = "Option::is_none")] + plan: Option<String>, + } + let req = UpdateTaskRequest { name, plan }; + self.put(&format!("/api/v1/mesh/tasks/{}", task_id), &req) + .await + } } |
