Created
February 27, 2019 15:18
-
-
Save horttanainen/2abd23a0c9ced13c6c660e5329928dcd to your computer and use it in GitHub Desktop.
Create a datadog screenboard from a timeboard
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
#!/usr/bin/env bash | |
#params | |
#dd_api_key= | |
#dd_app_key= | |
#dash_id= | |
curl -sX GET "https://app.datadoghq.com/api/v1/dash/${dash_id}?api_key=${dd_api_key}&application_key=${dd_app_key}" \ | |
| jq '{ | |
board_title: .dash.title, | |
description: .dash.description, | |
template_variables: .dash.template_variables, | |
widgets: [.dash.graphs[] | { type: .definition.viz, tile_def: .definition, title: true, title_text: .title, autoscale: true, x: 0, y: 0 }] | |
}' \ | |
| curl -H "Content-type: application/json" -d @- \ | |
"https://app.datadoghq.com/api/v1/screen?api_key=${dd_api_key}&application_key=${dd_app_key}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is an updated script for the current API:
It doesn't support groups as free form dashboard don't have groups, so either you'll have to remove them from the original dashboard or extend this to validate if .widget[i].type != groups.