So, I tried with both Python and Curl following this article:
https://circleci.com/docs/api/v2/index.html#operation/listWorkflowsByPipelineId
curl --request POST \
--url https://circleci.com/api/v2/project/gh/abc/xyz/pipeline \
--header 'authorization: xxxx' \
--header 'content-type: application/json' \
--data '{"parameters":{"USE_RUNNER_AGENT": true, "TAGS": "'tf_init,eks_application'"},"branch": "dev"}'
Error:
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
Python:
import requests
import json
headers = {"authorization": "XXXX",
"Content-type": "application/json"}
data = {"branch": "fmdev",
"tag": "(tf_init,eks_application)",
"parameters": {"USE_RUNNER_AGENT": True},
}
post_url = f"https://circleci.com/api/v2/project/gh/abc/xyz/pipeline "
print(f"Data: {data}, URL: {post_url}")
r = requests.post(
post_url,
headers=headers,
data=json.dumps(data),
timeout=60,
verify=False
)
print(r.status_code)
print(r.json)
Getting 404 as response code for the python code.
Note: I have entered the relevant values in place of abc
& xyz
.