-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tags field to dashboard API spec (#1277)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
- Loading branch information
1 parent
392024f
commit 12da94a
Showing
12 changed files
with
317 additions
and
8 deletions.
There are no files selected for viewing
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
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
1 change: 1 addition & 0 deletions
1
...hboards/Create-a-new-dashboard-with-invalid-team-tags-returns-Bad-Request-response.frozen
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2023-03-08T22:44:59.472Z |
24 changes: 24 additions & 0 deletions
24
...dashboards/Create-a-new-dashboard-with-invalid-team-tags-returns-Bad-Request-response.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...s/features/v1/dashboards/Create-a-new-dashboard-with-team-tags-returns-OK-response.frozen
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2023-03-08T20:53:52.326Z |
46 changes: 46 additions & 0 deletions
46
...ttes/features/v1/dashboards/Create-a-new-dashboard-with-team-tags-returns-OK-response.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
cassettes/features/v1/dashboards/Update-a-dashboard-with-tags-returns-OK-response.frozen
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2023-03-10T23:23:35.716Z |
74 changes: 74 additions & 0 deletions
74
cassettes/features/v1/dashboards/Update-a-dashboard-with-tags-returns-OK-response.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Create a new dashboard with team tags returns "OK" response | ||
|
||
require "datadog_api_client" | ||
api_instance = DatadogAPIClient::V1::DashboardsAPI.new | ||
|
||
body = DatadogAPIClient::V1::Dashboard.new({ | ||
title: "Example-Create_a_new_dashboard_with_team_tags_returns_OK_response", | ||
widgets: [ | ||
DatadogAPIClient::V1::Widget.new({ | ||
definition: DatadogAPIClient::V1::ChangeWidgetDefinition.new({ | ||
title: "", | ||
title_size: "16", | ||
title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT, | ||
time: DatadogAPIClient::V1::WidgetTime.new({}), | ||
type: DatadogAPIClient::V1::ChangeWidgetDefinitionType::CHANGE, | ||
requests: [ | ||
DatadogAPIClient::V1::ChangeWidgetRequest.new({ | ||
formulas: [ | ||
DatadogAPIClient::V1::WidgetFormula.new({ | ||
formula: "hour_before(query1)", | ||
}), | ||
DatadogAPIClient::V1::WidgetFormula.new({ | ||
formula: "query1", | ||
}), | ||
], | ||
queries: [ | ||
DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinition.new({ | ||
data_source: DatadogAPIClient::V1::FormulaAndFunctionEventsDataSource::LOGS, | ||
name: "query1", | ||
search: DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionSearch.new({ | ||
query: "", | ||
}), | ||
indexes: [ | ||
"*", | ||
], | ||
compute: DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionCompute.new({ | ||
aggregation: DatadogAPIClient::V1::FormulaAndFunctionEventAggregation::COUNT, | ||
}), | ||
group_by: [], | ||
}), | ||
], | ||
response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::SCALAR, | ||
compare_to: DatadogAPIClient::V1::WidgetCompareTo::HOUR_BEFORE, | ||
increase_good: true, | ||
order_by: DatadogAPIClient::V1::WidgetOrderBy::CHANGE, | ||
change_type: DatadogAPIClient::V1::WidgetChangeType::ABSOLUTE, | ||
order_dir: DatadogAPIClient::V1::WidgetSort::DESCENDING, | ||
}), | ||
], | ||
}), | ||
layout: DatadogAPIClient::V1::WidgetLayout.new({ | ||
x: 0, | ||
y: 0, | ||
width: 4, | ||
height: 4, | ||
}), | ||
}), | ||
], | ||
tags: [ | ||
"team:foobar", | ||
], | ||
layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED, | ||
}) | ||
p api_instance.create_dashboard(body) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Update a dashboard with tags returns "OK" response | ||
|
||
require "datadog_api_client" | ||
api_instance = DatadogAPIClient::V1::DashboardsAPI.new | ||
|
||
# there is a valid "dashboard" in the system | ||
DASHBOARD_ID = ENV["DASHBOARD_ID"] | ||
|
||
body = DatadogAPIClient::V1::Dashboard.new({ | ||
layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED, | ||
title: "Example-Update_a_dashboard_with_tags_returns_OK_response with list_stream widget", | ||
description: "Updated description", | ||
tags: [ | ||
"team:foo", | ||
"team:bar", | ||
], | ||
widgets: [ | ||
DatadogAPIClient::V1::Widget.new({ | ||
definition: DatadogAPIClient::V1::ListStreamWidgetDefinition.new({ | ||
type: DatadogAPIClient::V1::ListStreamWidgetDefinitionType::LIST_STREAM, | ||
requests: [ | ||
DatadogAPIClient::V1::ListStreamWidgetRequest.new({ | ||
columns: [ | ||
DatadogAPIClient::V1::ListStreamColumn.new({ | ||
width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO, | ||
field: "timestamp", | ||
}), | ||
], | ||
query: DatadogAPIClient::V1::ListStreamQuery.new({ | ||
data_source: DatadogAPIClient::V1::ListStreamSource::APM_ISSUE_STREAM, | ||
query_string: "", | ||
}), | ||
response_format: DatadogAPIClient::V1::ListStreamResponseFormat::EVENT_LIST, | ||
}), | ||
], | ||
}), | ||
}), | ||
], | ||
}) | ||
p api_instance.update_dashboard(DASHBOARD_ID, body) |
Oops, something went wrong.