Skip to content
Merged
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
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.5",
"regenerated": "2023-08-30 11:45:15.156195",
"spec_repo_commit": "2f2fd804"
"regenerated": "2023-08-31 13:09:09.843173",
"spec_repo_commit": "87d036cf"
},
"v2": {
"apigentools_version": "1.6.5",
"regenerated": "2023-08-30 11:45:15.170455",
"spec_repo_commit": "2f2fd804"
"regenerated": "2023-08-31 13:09:09.862041",
"spec_repo_commit": "87d036cf"
}
}
}
2 changes: 2 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12165,6 +12165,8 @@ components:
$ref: '#/components/schemas/LogQueryDefinition'
security_query:
$ref: '#/components/schemas/LogQueryDefinition'
style:
$ref: '#/components/schemas/WidgetStyle'
type: object
SyntheticsAPIStep:
description: The steps used in a Synthetic multistep API test.
Expand Down
4 changes: 3 additions & 1 deletion examples/v1/dashboards/CreateDashboard_2705593938.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.datadog.api.client.v1.model.WidgetDefinition;
import com.datadog.api.client.v1.model.WidgetFormula;
import com.datadog.api.client.v1.model.WidgetLayout;
import com.datadog.api.client.v1.model.WidgetStyle;
import com.datadog.api.client.v1.model.WidgetTextAlign;
import java.util.Collections;

Expand Down Expand Up @@ -59,7 +60,8 @@ public static void main(String[] args) {
.name("query1")
.aggregator(
FormulaAndFunctionMetricAggregation
.SUM))))))))
.SUM))))
.style(new WidgetStyle().palette("dog_classic"))))))
.layout(new WidgetLayout().x(0L).y(0L).width(4L).height(4L))))
.layoutType(DashboardLayoutType.ORDERED);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
SunburstWidgetRequest.JSON_PROPERTY_QUERIES,
SunburstWidgetRequest.JSON_PROPERTY_RESPONSE_FORMAT,
SunburstWidgetRequest.JSON_PROPERTY_RUM_QUERY,
SunburstWidgetRequest.JSON_PROPERTY_SECURITY_QUERY
SunburstWidgetRequest.JSON_PROPERTY_SECURITY_QUERY,
SunburstWidgetRequest.JSON_PROPERTY_STYLE
})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
Expand Down Expand Up @@ -77,6 +78,9 @@ public class SunburstWidgetRequest {
public static final String JSON_PROPERTY_SECURITY_QUERY = "security_query";
private LogQueryDefinition securityQuery;

public static final String JSON_PROPERTY_STYLE = "style";
private WidgetStyle style;

public SunburstWidgetRequest apmQuery(LogQueryDefinition apmQuery) {
this.apmQuery = apmQuery;
this.unparsed |= apmQuery.unparsed;
Expand Down Expand Up @@ -388,6 +392,28 @@ public void setSecurityQuery(LogQueryDefinition securityQuery) {
this.securityQuery = securityQuery;
}

public SunburstWidgetRequest style(WidgetStyle style) {
this.style = style;
this.unparsed |= style.unparsed;
return this;
}

/**
* Widget style definition.
*
* @return style
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_STYLE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public WidgetStyle getStyle() {
return style;
}

public void setStyle(WidgetStyle style) {
this.style = style;
}

/**
* A container for additional, undeclared properties. This is a holder for any undeclared
* properties as specified with the 'additionalProperties' keyword in the OAS document.
Expand Down Expand Up @@ -457,6 +483,7 @@ public boolean equals(Object o) {
&& Objects.equals(this.responseFormat, sunburstWidgetRequest.responseFormat)
&& Objects.equals(this.rumQuery, sunburstWidgetRequest.rumQuery)
&& Objects.equals(this.securityQuery, sunburstWidgetRequest.securityQuery)
&& Objects.equals(this.style, sunburstWidgetRequest.style)
&& Objects.equals(this.additionalProperties, sunburstWidgetRequest.additionalProperties);
}

Expand All @@ -476,6 +503,7 @@ public int hashCode() {
responseFormat,
rumQuery,
securityQuery,
style,
additionalProperties);
}

Expand All @@ -498,6 +526,7 @@ public String toString() {
sb.append(" responseFormat: ").append(toIndentedString(responseFormat)).append("\n");
sb.append(" rumQuery: ").append(toIndentedString(rumQuery)).append("\n");
sb.append(" securityQuery: ").append(toIndentedString(securityQuery)).append("\n");
sb.append(" style: ").append(toIndentedString(style)).append("\n");
sb.append(" additionalProperties: ")
.append(toIndentedString(additionalProperties))
.append("\n");
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-01-06T00:50:41.066Z
2023-08-29T23:33:40.928Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_sunburst_widget_and_metrics_data-1641430241\",\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"aggregator\":\"sum\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"sum:system.mem.used{*} by {service}\"}],\"response_format\":\"scalar\"}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"sunburst\"},\"layout\":{\"height\":4,\"width\":4,\"x\":0,\"y\":0}}]}"
"json": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_sunburst_widget_and_metrics_data-1693352020\",\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"aggregator\":\"sum\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"sum:system.mem.used{*} by {service}\"}],\"response_format\":\"scalar\",\"style\":{\"palette\":\"dog_classic\"}}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"sunburst\"},\"layout\":{\"height\":4,\"width\":4,\"x\":0,\"y\":0}}]}"
},
"headers": {},
"method": "POST",
Expand All @@ -12,7 +12,7 @@
"secure": true
},
"httpResponse": {
"body": "{\"notify_list\":null,\"description\":null,\"restricted_roles\":[],\"author_name\":null,\"template_variables\":null,\"is_read_only\":false,\"id\":\"sgm-ici-pnu\",\"title\":\"Test-Create_a_new_dashboard_with_sunburst_widget_and_metrics_data-1641430241\",\"url\":\"/dashboard/sgm-ici-pnu/test-createanewdashboardwithsunburstwidgetandmetricsdata-1641430241\",\"created_at\":\"2022-01-06T00:50:41.250923+00:00\",\"modified_at\":\"2022-01-06T00:50:41.250923+00:00\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"type\":\"sunburst\",\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"response_format\":\"scalar\",\"queries\":[{\"aggregator\":\"sum\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"sum:system.mem.used{*} by {service}\"}]}],\"title_align\":\"left\",\"title_size\":\"16\",\"title\":\"\"},\"layout\":{\"y\":0,\"width\":4,\"x\":0,\"height\":4},\"id\":1079694148435475}],\"layout_type\":\"ordered\"}",
"body": "{\"id\":\"p9p-tab-wa7\",\"title\":\"Test-Create_a_new_dashboard_with_sunburst_widget_and_metrics_data-1693352020\",\"description\":null,\"author_handle\":\"frog@datadoghq.com\",\"author_name\":null,\"layout_type\":\"ordered\",\"url\":\"/dashboard/p9p-tab-wa7/test-createanewdashboardwithsunburstwidgetandmetricsdata-1693352020\",\"is_read_only\":false,\"template_variables\":null,\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"aggregator\":\"sum\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"sum:system.mem.used{*} by {service}\"}],\"response_format\":\"scalar\",\"style\":{\"palette\":\"dog_classic\"}}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"sunburst\"},\"layout\":{\"height\":4,\"width\":4,\"x\":0,\"y\":0},\"id\":4956604535424180}],\"notify_list\":null,\"created_at\":\"2023-08-29T23:33:41.087237+00:00\",\"modified_at\":\"2023-08-29T23:33:41.087237+00:00\",\"restricted_roles\":[]}\n",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -27,18 +27,18 @@
"timeToLive": {
"unlimited": true
},
"id": "d791c0c8-f65f-7381-d709-730ec8b15f09"
"id": "e1a5528e-e87d-7bbc-08b5-97553ee72255"
},
{
"httpRequest": {
"headers": {},
"method": "DELETE",
"path": "/api/v1/dashboard/sgm-ici-pnu",
"path": "/api/v1/dashboard/p9p-tab-wa7",
"keepAlive": false,
"secure": true
},
"httpResponse": {
"body": "{\"deleted_dashboard_id\":\"sgm-ici-pnu\"}",
"body": "{\"deleted_dashboard_id\":\"p9p-tab-wa7\"}\n",
"headers": {
"Content-Type": [
"application/json"
Expand All @@ -53,6 +53,6 @@
"timeToLive": {
"unlimited": true
},
"id": "aa1df354-da30-c460-815c-a2d022f1588b"
"id": "a33fa573-a9be-255f-d7d1-81f47fd79dd9"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ Feature: Dashboards
@team:DataDog/dashboards-backend
Scenario: Create a new dashboard with sunburst widget and metrics data
Given new "CreateDashboard" request
And body with value { "title": "{{ unique }}", "widgets": [ { "definition": { "title": "", "title_size": "16", "title_align": "left", "type": "sunburst", "requests": [ { "response_format": "scalar", "formulas": [ { "formula": "query1" } ], "queries": [ { "query": "sum:system.mem.used{*} by {service}", "data_source": "metrics", "name": "query1", "aggregator": "sum" } ] } ] }, "layout": { "x": 0, "y": 0, "width": 4, "height": 4 } } ], "layout_type": "ordered" }
And body with value { "title": "{{ unique }}", "widgets": [ { "definition": { "title": "", "title_size": "16", "title_align": "left", "type": "sunburst", "requests": [ { "response_format": "scalar", "formulas": [ { "formula": "query1" } ], "queries": [ { "query": "sum:system.mem.used{*} by {service}", "data_source": "metrics", "name": "query1", "aggregator": "sum" } ], "style": { "palette": "dog_classic" } } ] }, "layout": { "x": 0, "y": 0, "width": 4, "height": 4 } } ], "layout_type": "ordered" }
When the request is sent
Then the response status is 200 OK
And the response "widgets[0].definition.requests[0].response_format" is equal to "scalar"
Expand All @@ -630,6 +630,7 @@ Feature: Dashboards
And the response "widgets[0].definition.requests[0].queries[0].name" is equal to "query1"
And the response "widgets[0].definition.requests[0].queries[0].aggregator" is equal to "sum"
And the response "widgets[0].definition.requests[0].formulas[0].formula" is equal to "query1"
And the response "widgets[0].definition.requests[0].style.palette" is equal to "dog_classic"

@team:DataDog/dashboards-backend
Scenario: Create a new dashboard with team tags returns "OK" response
Expand Down