diff options
Diffstat (limited to 'makima/src/daemon')
| -rw-r--r-- | makima/src/daemon/api/directive.rs | 20 | ||||
| -rw-r--r-- | makima/src/daemon/cli/mod.rs | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/makima/src/daemon/api/directive.rs b/makima/src/daemon/api/directive.rs index 3589e78..c51882b 100644 --- a/makima/src/daemon/api/directive.rs +++ b/makima/src/daemon/api/directive.rs @@ -71,6 +71,26 @@ impl ApiClient { .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, diff --git a/makima/src/daemon/cli/mod.rs b/makima/src/daemon/cli/mod.rs index c9a8c6f..954f219 100644 --- a/makima/src/daemon/cli/mod.rs +++ b/makima/src/daemon/cli/mod.rs @@ -231,6 +231,9 @@ pub enum DirectiveCommand { /// List evaluation history for a step Evaluations(directive::EvaluationsArgs), + + /// Submit a chain plan for a directive (reads JSON from stdin) + SubmitPlan(DirectiveArgs), } impl Cli { |
