Skip to content

Instantly share code, notes, and snippets.

@rabidscorpio
Forked from pmbauer/screen-time.sh
Created May 1, 2017 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rabidscorpio/d0893f767cd84f6a80151ea712cfc936 to your computer and use it in GitHub Desktop.
Save rabidscorpio/d0893f767cd84f6a80151ea712cfc936 to your computer and use it in GitHub Desktop.
create a datadog time board from a screen board
#!/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}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment