Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dashboards] Implement support for sunburst widget #1324

Merged
merged 5 commits into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
386 changes: 386 additions & 0 deletions datadog/resource_datadog_dashboard.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2022-01-11T16:09:15.467771-05:00
236 changes: 236 additions & 0 deletions datadog/tests/cassettes/TestAccDatadogDashboardSunburst.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
---
version: 1
interactions:
- request:
body: |
{"description":"Created using the Datadog provider in Terraform","id":"","is_read_only":true,"layout_type":"ordered","notify_list":[],"template_variable_presets":[],"template_variables":[],"title":"tf-TestAccDatadogDashboardSunburst-local-1641935355","widgets":[{"definition":{"custom_links":[{"label":"Test Custom Link label","link":"https://app.datadoghq.com/dashboard/lists"}],"legend":{"hide_percent":false,"hide_value":true,"type":"automatic"},"requests":[{"formulas":[{"alias":"my ff query","formula":"my_query_1 + my_query_2"}],"queries":[{"aggregator":"sum","data_source":"metrics","name":"my_query_1","query":"avg:system.cpu.user{foo:bar} by {env}"}],"response_format":"scalar"}],"type":"sunburst"}},{"definition":{"hide_total":true,"legend":{"type":"table"},"requests":[{"queries":[{"compute":{"aggregation":"count"},"data_source":"rum","indexes":["*"],"name":"query1","search":{"query":"abc"}}],"response_format":"scalar"}],"type":"sunburst"}}]}
form: {}
headers:
Accept:
- application/json
Content-Length:
- "957"
Content-Type:
- application/json
Dd-Operation-Id:
- CreateDashboard
User-Agent:
- terraform-provider-datadog/dev (terraform 2.10.0; terraform-cli 1.1.3) datadog-api-client-go/1.7.1+dev (go go1.16.4; os darwin; arch amd64)
url: https://api.datadoghq.com/api/v1/dashboard
method: POST
response:
body: '{"notify_list":[],"description":"Created using the Datadog provider in Terraform","author_name":null,"template_variable_presets":[],"template_variables":[],"is_read_only":true,"id":"g8i-bnr-xup","title":"tf-TestAccDatadogDashboardSunburst-local-1641935355","url":"/dashboard/g8i-bnr-xup/tf-testaccdatadogdashboardsunburst-local-1641935355","created_at":"2022-01-11T21:09:17.624176+00:00","modified_at":"2022-01-11T21:09:17.624176+00:00","author_handle":"[email protected]","widgets":[{"definition":{"requests":[{"formulas":[{"alias":"my ff query","formula":"my_query_1 + my_query_2"}],"response_format":"scalar","queries":[{"aggregator":"sum","data_source":"metrics","name":"my_query_1","query":"avg:system.cpu.user{foo:bar} by {env}"}]}],"custom_links":[{"link":"https://app.datadoghq.com/dashboard/lists","label":"Test Custom Link label"}],"type":"sunburst","legend":{"type":"automatic","hide_percent":false,"hide_value":true}},"id":5232427207874989},{"definition":{"requests":[{"response_format":"scalar","queries":[{"search":{"query":"abc"},"data_source":"rum","compute":{"aggregation":"count"},"name":"query1","indexes":["*"]}]}],"type":"sunburst","hide_total":true,"legend":{"type":"table"}},"id":44699149071502}],"layout_type":"ordered"}'
headers:
Cache-Control:
- no-cache
Connection:
- keep-alive
Content-Security-Policy:
- frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report
Content-Type:
- application/json
Date:
- Tue, 11 Jan 2022 21:09:17 GMT
Pragma:
- no-cache
Strict-Transport-Security:
- max-age=15724800;
Vary:
- Accept-Encoding
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- SAMEORIGIN
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Dd-Operation-Id:
- GetDashboard
User-Agent:
- terraform-provider-datadog/dev (terraform 2.10.0; terraform-cli 1.1.3) datadog-api-client-go/1.7.1+dev (go go1.16.4; os darwin; arch amd64)
url: https://api.datadoghq.com/api/v1/dashboard/g8i-bnr-xup
method: GET
response:
body: '{"notify_list":[],"description":"Created using the Datadog provider in Terraform","author_name":null,"template_variable_presets":[],"template_variables":[],"is_read_only":true,"id":"g8i-bnr-xup","title":"tf-TestAccDatadogDashboardSunburst-local-1641935355","url":"/dashboard/g8i-bnr-xup/tf-testaccdatadogdashboardsunburst-local-1641935355","created_at":"2022-01-11T21:09:17.624176+00:00","modified_at":"2022-01-11T21:09:17.624176+00:00","author_handle":"[email protected]","widgets":[{"definition":{"requests":[{"formulas":[{"alias":"my ff query","formula":"my_query_1 + my_query_2"}],"response_format":"scalar","queries":[{"aggregator":"sum","data_source":"metrics","name":"my_query_1","query":"avg:system.cpu.user{foo:bar} by {env}"}]}],"custom_links":[{"link":"https://app.datadoghq.com/dashboard/lists","label":"Test Custom Link label"}],"type":"sunburst","legend":{"type":"automatic","hide_percent":false,"hide_value":true}},"id":5232427207874989},{"definition":{"requests":[{"response_format":"scalar","queries":[{"search":{"query":"abc"},"data_source":"rum","compute":{"aggregation":"count"},"name":"query1","indexes":["*"]}]}],"type":"sunburst","hide_total":true,"legend":{"type":"table"}},"id":44699149071502}],"layout_type":"ordered"}'
headers:
Cache-Control:
- no-cache
Connection:
- keep-alive
Content-Security-Policy:
- frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report
Content-Type:
- application/json
Date:
- Tue, 11 Jan 2022 21:09:17 GMT
Pragma:
- no-cache
Strict-Transport-Security:
- max-age=15724800;
Vary:
- Accept-Encoding
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- SAMEORIGIN
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Dd-Operation-Id:
- GetDashboard
User-Agent:
- terraform-provider-datadog/dev (terraform 2.10.0; terraform-cli 1.1.3) datadog-api-client-go/1.7.1+dev (go go1.16.4; os darwin; arch amd64)
url: https://api.datadoghq.com/api/v1/dashboard/g8i-bnr-xup
method: GET
response:
body: '{"notify_list":[],"description":"Created using the Datadog provider in Terraform","author_name":null,"template_variable_presets":[],"template_variables":[],"is_read_only":true,"id":"g8i-bnr-xup","title":"tf-TestAccDatadogDashboardSunburst-local-1641935355","url":"/dashboard/g8i-bnr-xup/tf-testaccdatadogdashboardsunburst-local-1641935355","created_at":"2022-01-11T21:09:17.624176+00:00","modified_at":"2022-01-11T21:09:17.624176+00:00","author_handle":"[email protected]","widgets":[{"definition":{"requests":[{"formulas":[{"alias":"my ff query","formula":"my_query_1 + my_query_2"}],"response_format":"scalar","queries":[{"aggregator":"sum","data_source":"metrics","name":"my_query_1","query":"avg:system.cpu.user{foo:bar} by {env}"}]}],"custom_links":[{"link":"https://app.datadoghq.com/dashboard/lists","label":"Test Custom Link label"}],"type":"sunburst","legend":{"type":"automatic","hide_percent":false,"hide_value":true}},"id":5232427207874989},{"definition":{"requests":[{"response_format":"scalar","queries":[{"search":{"query":"abc"},"data_source":"rum","compute":{"aggregation":"count"},"name":"query1","indexes":["*"]}]}],"type":"sunburst","hide_total":true,"legend":{"type":"table"}},"id":44699149071502}],"layout_type":"ordered"}'
headers:
Cache-Control:
- no-cache
Connection:
- keep-alive
Content-Security-Policy:
- frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report
Content-Type:
- application/json
Date:
- Tue, 11 Jan 2022 21:09:18 GMT
Pragma:
- no-cache
Strict-Transport-Security:
- max-age=15724800;
Vary:
- Accept-Encoding
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- SAMEORIGIN
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Dd-Operation-Id:
- GetDashboard
User-Agent:
- terraform-provider-datadog/dev (terraform 2.10.0; terraform-cli 1.1.3) datadog-api-client-go/1.7.1+dev (go go1.16.4; os darwin; arch amd64)
url: https://api.datadoghq.com/api/v1/dashboard/g8i-bnr-xup
method: GET
response:
body: '{"notify_list":[],"description":"Created using the Datadog provider in Terraform","author_name":null,"template_variable_presets":[],"template_variables":[],"is_read_only":true,"id":"g8i-bnr-xup","title":"tf-TestAccDatadogDashboardSunburst-local-1641935355","url":"/dashboard/g8i-bnr-xup/tf-testaccdatadogdashboardsunburst-local-1641935355","created_at":"2022-01-11T21:09:17.624176+00:00","modified_at":"2022-01-11T21:09:17.624176+00:00","author_handle":"[email protected]","widgets":[{"definition":{"requests":[{"formulas":[{"alias":"my ff query","formula":"my_query_1 + my_query_2"}],"response_format":"scalar","queries":[{"aggregator":"sum","data_source":"metrics","name":"my_query_1","query":"avg:system.cpu.user{foo:bar} by {env}"}]}],"custom_links":[{"link":"https://app.datadoghq.com/dashboard/lists","label":"Test Custom Link label"}],"type":"sunburst","legend":{"type":"automatic","hide_percent":false,"hide_value":true}},"id":5232427207874989},{"definition":{"requests":[{"response_format":"scalar","queries":[{"search":{"query":"abc"},"data_source":"rum","compute":{"aggregation":"count"},"name":"query1","indexes":["*"]}]}],"type":"sunburst","hide_total":true,"legend":{"type":"table"}},"id":44699149071502}],"layout_type":"ordered"}'
headers:
Cache-Control:
- no-cache
Connection:
- keep-alive
Content-Security-Policy:
- frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report
Content-Type:
- application/json
Date:
- Tue, 11 Jan 2022 21:09:18 GMT
Pragma:
- no-cache
Strict-Transport-Security:
- max-age=15724800;
Vary:
- Accept-Encoding
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- SAMEORIGIN
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Dd-Operation-Id:
- DeleteDashboard
User-Agent:
- terraform-provider-datadog/dev (terraform 2.10.0; terraform-cli 1.1.3) datadog-api-client-go/1.7.1+dev (go go1.16.4; os darwin; arch amd64)
url: https://api.datadoghq.com/api/v1/dashboard/g8i-bnr-xup
method: DELETE
response:
body: '{"deleted_dashboard_id":"g8i-bnr-xup"}'
headers:
Cache-Control:
- no-cache
Connection:
- keep-alive
Content-Security-Policy:
- frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report
Content-Type:
- application/json
Date:
- Tue, 11 Jan 2022 21:09:20 GMT
Pragma:
- no-cache
Strict-Transport-Security:
- max-age=15724800;
Vary:
- Accept-Encoding
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- SAMEORIGIN
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Dd-Operation-Id:
- GetDashboard
User-Agent:
- terraform-provider-datadog/dev (terraform 2.10.0; terraform-cli 1.1.3) datadog-api-client-go/1.7.1+dev (go go1.16.4; os darwin; arch amd64)
url: https://api.datadoghq.com/api/v1/dashboard/g8i-bnr-xup
method: GET
response:
body: '{"errors": ["Dashboard with ID g8i-bnr-xup not found"]}'
headers:
Cache-Control:
- no-cache
Connection:
- keep-alive
Content-Security-Policy:
- frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report
Content-Type:
- application/json
Date:
- Tue, 11 Jan 2022 21:09:20 GMT
Pragma:
- no-cache
Strict-Transport-Security:
- max-age=15724800;
Vary:
- Accept-Encoding
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- SAMEORIGIN
status: 404 Not Found
code: 404
duration: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2022-01-11T16:09:15.46721-05:00
Loading