I had created a simple python program to send Post Api request using request module
# importing the requests library
import requests
import json
headers = {
'PRIVATE-TOKEN': 'XXXXXXXXXXXXX',
'Content-Type': 'application/json',
}
data = '{ "ref": "cd-pipeline", "variables": [ {"key": "STAGE", "value": "CD"}, {"key": "DEPLOYMENT_STATUS", "value": "failed"} ] }'
response = requests.post('https://gitlab.kazan.atosworldline.com/api/v4/projects/28427/pipeline', headers=headers, data=data)
print(response)
However, I wish to replace the below string to use a variable
"value": "failed"
something to below
"value": deployment_status