I'm trying to get the list of existing Applications using python script. Here is my script which fails. I'm new to python scripting. Basically I want to login to the application first and list the existing applications using the python script.
import requests
import json
url = "https://account.saas.appdynamics.com"
ploads = { 'Account': 'account',
'Username': 'sara',
'Password': 'passwd' }
response = requests.request("GET", url, params=ploads) #this will login to the application.
surl = "https://account.saas.appdynamics.com/controller/restui/v1/app/list/ids" #api call to list the application IDs
sresponse = requests.request("GET", surl)
r = json.loads(sresponse.text)
print(r)
You can directly call for registered applications info from the API if you have the correct credentials. Also note that username is in fact in the format "
<userName>@<accountName>
".I have tested the below script as working against a test controller:
For this call to work your user needs to have the "Account Owner" permission.