Skip to content

Commit

Permalink
Add tags field to dashboard API spec (#1277)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Mar 27, 2023
1 parent 392024f commit 12da94a
Show file tree
Hide file tree
Showing 12 changed files with 317 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.4",
"regenerated": "2023-03-24 16:41:55.214844",
"spec_repo_commit": "9bdb5ee6"
"regenerated": "2023-03-27 19:48:11.680896",
"spec_repo_commit": "b6741167"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-03-24 16:41:55.227275",
"spec_repo_commit": "9bdb5ee6"
"regenerated": "2023-03-27 19:48:11.693806",
"spec_repo_commit": "b6741167"
}
}
}
8 changes: 8 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,14 @@ components:
description: A role UUID.
type: string
type: array
tags:
description: List of team names representing ownership of a dashboard.
items:
description: The name of a Datadog team of the form `team:<name>`
type: string
maxItems: 5
nullable: true
type: array
template_variable_presets:
description: Array of template variables saved views.
items:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2023-03-08T22:44:59.472Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2023-03-08T20:53:52.326Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2023-03-10T23:23:35.716Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions examples/v1/dashboards/CreateDashboard_2064651578.rb
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)
40 changes: 40 additions & 0 deletions examples/v1/dashboards/UpdateDashboard_3454865944.rb
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)
Loading

0 comments on commit 12da94a

Please sign in to comment.