Last active
July 12, 2018 09:18
-
-
Save c-success/6ccffdf932a7224221ad3819bbb6bd7b to your computer and use it in GitHub Desktop.
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
# Prepare Headers | |
headers = { | |
"provider": "yourprovidername", | |
"tenant": "yourtenantname", | |
"Content-Type": "application/json", | |
"Authorization":"session " + session_token | |
} | |
# API URLs to collect the logs | |
api_url = a10_api_server + "/analytics/ladc/app-server-health" | |
req_data = { | |
"query": { | |
"fields": ["healthIndex","applicationId","serverId","serviceId","timestamp"], | |
"rangeby": { | |
"start": 1531264180000, | |
"end": 1531269290000, | |
"field": "timestamp" | |
}, | |
"filterby": { | |
"and": { | |
"applicationId": "" | |
} | |
} | |
} | |
} | |
# Making POST call to fetch appservers health index and server IP | |
resp = requests.post(api_url, headers=headers,data=json.dumps(req_data)).json()["query"] | |
for key, value in resp.items(): | |
for key in value: | |
print("{0} = {1} \n".format(key, value[key])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment