Created
May 27, 2016 21:14
-
-
Save mannytoledo/1a6c0ef04abc3412f98c82b568c8aba0 to your computer and use it in GitHub Desktop.
Inspecting and sharing datadog dashboards
This file contains hidden or 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
from datadog import initialize, api | |
import json | |
options = { | |
'api_key': '', | |
'app_key': '' | |
} | |
initialize(**options) | |
def print_dashboards(): | |
"""Prints out dashboards available in your datadog account. | |
:returns: nothing | |
""" | |
screen_list = api.Screenboard.get_all() | |
for key,dash in enumerate(screen_list["screenboards"]): | |
print(dash['resource']+' '+dash['title']+' '+str(dash['id'])) | |
def grab_screenboard(boardid): | |
return api.Screenboard.get(boardid) | |
docker_board=grab_screenboard(12345) | |
print(json.dumps(docker_board, sort_keys=True, | |
indent=4, separators=(',', ': '))) | |
print(len(docker_board['widgets'])) | |
for w,t in enumerate(docker_board['widgets']): | |
print(t['title_text']+' | '+t['type']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment