Created
April 10, 2019 08:23
-
-
Save svrnm/eb046298c318b8c7f40e7f308a516cfd to your computer and use it in GitHub Desktop.
AppDynamics Download Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TOKEN=$(curl -s -X POST -d "{\"username\": \"${1}\",\"password\": \"${2}\",\"scopes\": [\"download\"]}" https://identity.msrv.saas.appdynamics.com/v2.0/oauth/token) | |
TOKEN=${TOKEN##*'access_token": "'} | |
FILE=$(curl -s "https://download.appdynamics.com/download/downloadfile/?format=json&page=1&search=${3/ /+}") | |
FILE=${FILE##*'download_path":"'} | |
curl -L -O -H "Authorization: Bearer ${TOKEN%%\",*}" ${FILE%%\",*} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment