Table of contents
curl -k -X GET --header 'Accept: application/json' -b access_token=`cat token.tok` 'https://192.168.0.5/cvpservice/cvpInfo/getCvpInfo.do'
curl -k -X GET --header 'Accept: application/json' -b access_token=`cat token.tok` 'https://192.168.0.5/cvpservice/inventory/devices'
Copy the token in an environment variable
token=xxx
Read the environment variable
echo $token
Use the environment variable from cURL
curl -k -X GET --header 'Accept: application/json' --cookie "access_token=$token" 'https://192.168.0.5/cvpservice/inventory/devices'
sudo apt-get install -y jq
curl -k -s -X GET --header 'Accept: application/json' -b access_token=`cat token.tok` 'https://192.168.0.5/cvpservice/inventory/devices' | jq '.[0]'
curl -k -s -X GET --header 'Accept: application/json' -b access_token=`cat token.tok` 'https://192.168.0.5/cvpservice/inventory/devices' | jq '.[].hostname'