I have a shell script in which i get a jsonresponse. I am using python to parse the json , and inside each json object i want to fetch id and again submit a curl request for each application Id from a shell script.
Currently am doing it like this , which am unable to do it successfully due to syntax errors. Can you please help me out
Any suggestions are helpful thank you.
curl -v -X GET -H "Content-Type: application/json" 'http://host/ws/v1/cluster/apps?state=PENDING' |
python3 -c "import sys, json; jsonObject = json.load(sys.stdin)['apps']; for row in jsonObject['app']: print(row['id'])"
Output:
{"apps":{"app":[{"id":1},{"id":2}]}}