Last active
November 5, 2020 12:14
-
-
Save pmbauer/4de4871a38246ee9ee77 to your computer and use it in GitHub Desktop.
create a datadog time board from a screen board
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= | |
# screen_id= | |
curl -sX GET "https://app.datadoghq.com/api/v1/screen/${screen_id}?api_key=${dd_api_key}&application_key=${dd_app_key}" \ | |
| jq '{ | |
title: .board_title, | |
description: .board_title, | |
template_variables: .template_variables, | |
graphs: [.widgets[] | {title: .title_text, definition: .tile_def}] | |
}' \ | |
| curl -sX POST -H "Content-type: application/json" -d @- \ | |
"https://app.datadoghq.com/api/v1/dash?api_key=${dd_api_key}&application_key=${dd_app_key}" |
Here is how to do it to the opposite direction: https://gist.github.com/horttanainen/2abd23a0c9ced13c6c660e5329928dcd
This worked great, although the DD API gave me an error due to my query tables. Which is strange, because time boards support query tables...
{"errors": ["Error parsing query: viz type query_table is incorrect"]}
I simply deleted the query tables and it ended up working.
You can also copy and paste individual graphs/metrics -- might be a bummer if you have a lot but was a good fit for my use case
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this works great! thank you!
notes to others: