Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
37 changes: 37 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1390,6 +1390,13 @@ components:
description: A role UUID.
type: string
type: array
tabs:
description: List of tabs for organizing dashboard widgets into groups.
items:
$ref: '#/components/schemas/DashboardTab'
maxItems: 100
nullable: true
type: array
tags:
description: List of team names representing ownership of a dashboard.
items:
Expand Down Expand Up @@ -1681,6 +1688,36 @@ components:
description: URL of the dashboard.
type: string
type: object
DashboardTab:
description: Dashboard tab for organizing widgets.
properties:
id:
description: UUID of the tab.
example: ''
format: uuid
type: string
name:
description: Name of the tab.
example: L
maxLength: 100
minLength: 1
type: string
widget_ids:
description: List of widget IDs belonging to this tab. The backend also
accepts positional references in @N format (1-indexed) as a convenience
for Terraform and other declarative tools.
example:
- 0
items:
description: Widget ID.
format: int64
type: integer
type: array
required:
- id
- name
- widget_ids
type: object
DashboardTemplateVariable:
description: Template variable.
properties:
Expand Down
6 changes: 3 additions & 3 deletions features/v1/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Feature: Dashboards
@generated @skip @team:DataDog/dashboards-backend
Scenario: Create a new dashboard returns "Bad Request" response
Given new "CreateDashboard" request
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host", "type": "group"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tabs": [{"id": "", "name": "L", "widget_ids": [0]}], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host", "type": "group"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
When the request is sent
Then the response status is 400 Bad Request

Expand Down Expand Up @@ -1342,15 +1342,15 @@ Feature: Dashboards
Scenario: Update a dashboard returns "Bad Request" response
Given new "UpdateDashboard" request
And request contains "dashboard_id" parameter from "REPLACE.ME"
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host", "type": "group"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tabs": [{"id": "", "name": "L", "widget_ids": [0]}], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host", "type": "group"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/dashboards-backend
Scenario: Update a dashboard returns "Item Not Found" response
Given new "UpdateDashboard" request
And request contains "dashboard_id" parameter from "REPLACE.ME"
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host", "type": "group"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tabs": [{"id": "", "name": "L", "widget_ids": [0]}], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host", "type": "group"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
When the request is sent
Then the response status is 404 Item Not Found

Expand Down
1 change: 1 addition & 0 deletions services/dashboards/src/v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export { DashboardRestoreRequest } from "./models/DashboardRestoreRequest";
export { DashboardShareType } from "./models/DashboardShareType";
export { DashboardSummary } from "./models/DashboardSummary";
export { DashboardSummaryDefinition } from "./models/DashboardSummaryDefinition";
export { DashboardTab } from "./models/DashboardTab";
export { DashboardTemplateVariable } from "./models/DashboardTemplateVariable";
export { DashboardTemplateVariablePreset } from "./models/DashboardTemplateVariablePreset";
export { DashboardTemplateVariablePresetValue } from "./models/DashboardTemplateVariablePresetValue";
Expand Down
9 changes: 9 additions & 0 deletions services/dashboards/src/v1/models/Dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { AttributeTypeMap } from "@datadog/datadog-api-client";

import { DashboardLayoutType } from "./DashboardLayoutType";
import { DashboardReflowType } from "./DashboardReflowType";
import { DashboardTab } from "./DashboardTab";
import { DashboardTemplateVariable } from "./DashboardTemplateVariable";
import { DashboardTemplateVariablePreset } from "./DashboardTemplateVariablePreset";
import { Widget } from "./Widget";
Expand Down Expand Up @@ -59,6 +60,10 @@ export class Dashboard {
* A list of role identifiers. Only the author and users associated with at least one of these roles can edit this dashboard.
*/
"restrictedRoles"?: Array<string>;
/**
* List of tabs for organizing dashboard widgets into groups.
*/
"tabs"?: Array<DashboardTab>;
/**
* List of team names representing ownership of a dashboard.
*/
Expand Down Expand Up @@ -145,6 +150,10 @@ export class Dashboard {
baseName: "restricted_roles",
type: "Array<string>",
},
tabs: {
baseName: "tabs",
type: "Array<DashboardTab>",
},
tags: {
baseName: "tags",
type: "Array<string>",
Expand Down
65 changes: 65 additions & 0 deletions services/dashboards/src/v1/models/DashboardTab.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { AttributeTypeMap } from "@datadog/datadog-api-client";

/**
* Dashboard tab for organizing widgets.
*/
export class DashboardTab {
/**
* UUID of the tab.
*/
"id": string;
/**
* Name of the tab.
*/
"name": string;
/**
* List of widget IDs belonging to this tab. The backend also accepts positional references in @N format (1-indexed) as a convenience for Terraform and other declarative tools.
*/
"widgetIds": Array<number>;
/**
* A container for additional, undeclared properties.
* This is a holder for any undeclared properties as specified with
* the 'additionalProperties' keyword in the OAS document.
*/
"additionalProperties"?: { [key: string]: any };
/**
* @ignore
*/
"_unparsed"?: boolean;

/**
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
id: {
baseName: "id",
type: "string",
required: true,
format: "uuid",
},
name: {
baseName: "name",
type: "string",
required: true,
},
widgetIds: {
baseName: "widget_ids",
type: "Array<number>",
required: true,
format: "int64",
},
additionalProperties: {
baseName: "additionalProperties",
type: "{ [key: string]: any; }",
},
};

/**
* @ignore
*/
static getAttributeTypeMap(): AttributeTypeMap {
return DashboardTab.attributeTypeMap;
}

public constructor() {}
}
2 changes: 2 additions & 0 deletions services/dashboards/src/v1/models/TypingInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { DashboardGlobalTime } from "./DashboardGlobalTime";
import { DashboardRestoreRequest } from "./DashboardRestoreRequest";
import { DashboardSummary } from "./DashboardSummary";
import { DashboardSummaryDefinition } from "./DashboardSummaryDefinition";
import { DashboardTab } from "./DashboardTab";
import { DashboardTemplateVariable } from "./DashboardTemplateVariable";
import { DashboardTemplateVariablePreset } from "./DashboardTemplateVariablePreset";
import { DashboardTemplateVariablePresetValue } from "./DashboardTemplateVariablePresetValue";
Expand Down Expand Up @@ -618,6 +619,7 @@ export const TypingInfo: ModelTypingInfo = {
DashboardRestoreRequest: DashboardRestoreRequest,
DashboardSummary: DashboardSummary,
DashboardSummaryDefinition: DashboardSummaryDefinition,
DashboardTab: DashboardTab,
DashboardTemplateVariable: DashboardTemplateVariable,
DashboardTemplateVariablePreset: DashboardTemplateVariablePreset,
DashboardTemplateVariablePresetValue: DashboardTemplateVariablePresetValue,
Expand Down