summaryrefslogtreecommitdiff
path: root/makima/src/daemon/api
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/daemon/api')
-rw-r--r--makima/src/daemon/api/directive.rs106
-rw-r--r--makima/src/daemon/api/mod.rs1
2 files changed, 0 insertions, 107 deletions
diff --git a/makima/src/daemon/api/directive.rs b/makima/src/daemon/api/directive.rs
deleted file mode 100644
index c51882b..0000000
--- a/makima/src/daemon/api/directive.rs
+++ /dev/null
@@ -1,106 +0,0 @@
-//! Directive API methods.
-
-use serde::Serialize;
-use uuid::Uuid;
-
-use super::client::{ApiClient, ApiError};
-use super::supervisor::JsonValue;
-
-/// Request to update a directive.
-#[derive(Serialize)]
-#[serde(rename_all = "camelCase")]
-pub struct UpdateDirectiveRequest {
- #[serde(skip_serializing_if = "Option::is_none")]
- pub status: Option<String>,
- #[serde(skip_serializing_if = "Option::is_none")]
- pub version: Option<i32>,
-}
-
-impl ApiClient {
- /// Get directive status and details.
- pub async fn directive_status(&self, directive_id: Uuid) -> Result<JsonValue, ApiError> {
- self.get(&format!("/api/v1/directives/{}", directive_id))
- .await
- }
-
- /// List chains for a directive.
- pub async fn directive_chains(&self, directive_id: Uuid) -> Result<JsonValue, ApiError> {
- self.get(&format!("/api/v1/directives/{}/chains", directive_id))
- .await
- }
-
- /// Get a chain with its steps.
- pub async fn directive_chain(
- &self,
- directive_id: Uuid,
- chain_id: Uuid,
- ) -> Result<JsonValue, ApiError> {
- self.get(&format!(
- "/api/v1/directives/{}/chains/{}",
- directive_id, chain_id
- ))
- .await
- }
-
- /// Update a directive.
- pub async fn directive_update(
- &self,
- directive_id: Uuid,
- req: UpdateDirectiveRequest,
- ) -> Result<JsonValue, ApiError> {
- self.put(&format!("/api/v1/directives/{}", directive_id), &req)
- .await
- }
-
- /// Start a directive (transition from draft to planning).
- pub async fn directive_start(&self, directive_id: Uuid) -> Result<JsonValue, ApiError> {
- self.post_empty(&format!("/api/v1/directives/{}/start", directive_id))
- .await
- }
-
- /// Trigger a manual evaluation for a step.
- pub async fn directive_evaluate_step(
- &self,
- directive_id: Uuid,
- step_id: Uuid,
- ) -> Result<JsonValue, ApiError> {
- self.post_empty(&format!(
- "/api/v1/directives/{}/steps/{}/evaluate",
- directive_id, step_id
- ))
- .await
- }
-
- /// Submit a chain plan for a directive.
- pub async fn directive_submit_plan(
- &self,
- directive_id: Uuid,
- plan_json: &str,
- ) -> Result<JsonValue, ApiError> {
- #[derive(serde::Serialize)]
- #[serde(rename_all = "camelCase")]
- struct SubmitPlanBody {
- plan: String,
- }
- self.post(
- &format!("/api/v1/directives/{}/submit-plan", directive_id),
- &SubmitPlanBody {
- plan: plan_json.to_string(),
- },
- )
- .await
- }
-
- /// List evaluations for a step.
- pub async fn directive_evaluations(
- &self,
- directive_id: Uuid,
- step_id: Uuid,
- ) -> Result<JsonValue, ApiError> {
- self.get(&format!(
- "/api/v1/directives/{}/steps/{}/evaluations",
- directive_id, step_id
- ))
- .await
- }
-}
diff --git a/makima/src/daemon/api/mod.rs b/makima/src/daemon/api/mod.rs
index 2d1efbf..49d80e0 100644
--- a/makima/src/daemon/api/mod.rs
+++ b/makima/src/daemon/api/mod.rs
@@ -2,7 +2,6 @@
pub mod client;
pub mod contract;
-pub mod directive;
pub mod supervisor;
pub use client::ApiClient;