Skip to content

Commit 0b41c03

Browse files
Fetch workflow diff JSON raw
1 parent 97051e2 commit 0b41c03

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/commands/workflows.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use datadog_api_client::datadogV2::api_workflow_automation::{
88

99
use crate::config::Config;
1010
use crate::formatter::{self, Metadata};
11+
use crate::raw_client;
1112
use crate::util;
1213
use crate::util_ext;
1314

@@ -62,14 +63,9 @@ pub async fn diff(
6263
ignore: &[String],
6364
) -> Result<()> {
6465
let candidate: serde_json::Value = util::read_json_file(file)?;
65-
let api = make_api(cfg);
66-
let live = api
67-
.get_workflow(workflow_id.to_string())
66+
let live = raw_client::raw_get(cfg, &format!("/api/v2/workflows/{workflow_id}"), &[])
6867
.await
69-
.map_err(|e| anyhow::anyhow!("failed to get workflow: {:?}", e))?;
70-
let live = serde_json::to_value(&live).map_err(|e| {
71-
anyhow::anyhow!("failed to serialize workflow {workflow_id} for diff: {e:?}")
72-
})?;
68+
.map_err(|e| anyhow::anyhow!("failed to get workflow: {e:?}"))?;
7369

7470
let mut options = util_ext::ResourceDiffOptions::new(
7571
"workflows diff",

0 commit comments

Comments
 (0)