Skip to content

Instantly share code, notes, and snippets.

@svrnm
Created April 10, 2019 08:23
Show Gist options
  • Save svrnm/eb046298c318b8c7f40e7f308a516cfd to your computer and use it in GitHub Desktop.
Save svrnm/eb046298c318b8c7f40e7f308a516cfd to your computer and use it in GitHub Desktop.
AppDynamics Download Script
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