From 5bb1c357830db9a881265c944ac56b3b6ea5cdcd Mon Sep 17 00:00:00 2001 From: worm Date: Fri, 30 Dec 2022 16:06:15 -0800 Subject: [PATCH] get_run_details up to testable state --- tfc-api-functions.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tfc-api-functions.js diff --git a/tfc-api-functions.js b/tfc-api-functions.js new file mode 100644 index 0000000..0716229 --- /dev/null +++ b/tfc-api-functions.js @@ -0,0 +1,12 @@ +import axios from 'axios'; + +// This will use the TFC get run details API, and return the response +// https://developer.hashicorp.com/terraform/cloud-docs/api-docs/run#get-run-details +export const get_run_details = async (base_url, run_id, token) => { + const response = await axios.get( + `${base_url}/api/v2/runs/${run_id}`, + { + headers: {Authorization :`Bearer ${token}`}, + } + ); +}; \ No newline at end of file