diff --git a/.apigentools-info b/.apigentools-info index 00645f2db7b..dbce99be433 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.2", - "regenerated": "2022-04-05 15:57:44.374646", - "spec_repo_commit": "18d4cb45" + "regenerated": "2022-04-05 17:18:52.443477", + "spec_repo_commit": "1bab7e2e" }, "v2": { "apigentools_version": "1.6.2", - "regenerated": "2022-04-05 15:57:44.390708", - "spec_repo_commit": "18d4cb45" + "regenerated": "2022-04-05 17:18:52.462926", + "spec_repo_commit": "1bab7e2e" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 20763c84f6a..b21b114e8bd 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -3815,18 +3815,22 @@ components: x-enum-varnames: - EVENT_LIST ListStreamSource: - default: issue_stream + default: apm_issue_stream description: Source from which to query items to display in the stream. enum: - issue_stream - logs_stream - audit_stream - example: issue_stream + - rum_issue_stream + - apm_issue_stream + example: apm_issue_stream type: string x-enum-varnames: - ISSUE_STREAM - LOGS_STREAM - AUDIT_STREAM + - RUM_ISSUE_STREAM + - APM_ISSUE_STREAM ListStreamWidgetDefinition: description: 'The list stream visualization displays a table of recent events in your application that @@ -3844,7 +3848,7 @@ components: - field: timestamp width: auto query: - data_source: issue_stream + data_source: apm_issue_stream query_string: '@data_source:APM' response_format: event_list items: diff --git a/api/v1/datadog/model_list_stream_query.go b/api/v1/datadog/model_list_stream_query.go index 32b767da6db..eb36385b089 100644 --- a/api/v1/datadog/model_list_stream_query.go +++ b/api/v1/datadog/model_list_stream_query.go @@ -40,7 +40,7 @@ func NewListStreamQuery(dataSource ListStreamSource, queryString string) *ListSt // but it doesn't guarantee that properties required by API are set func NewListStreamQueryWithDefaults() *ListStreamQuery { this := ListStreamQuery{} - var dataSource ListStreamSource = LISTSTREAMSOURCE_ISSUE_STREAM + var dataSource ListStreamSource = LISTSTREAMSOURCE_APM_ISSUE_STREAM this.DataSource = dataSource return &this } diff --git a/api/v1/datadog/model_list_stream_source.go b/api/v1/datadog/model_list_stream_source.go index d339b13aee9..e29f0df6948 100644 --- a/api/v1/datadog/model_list_stream_source.go +++ b/api/v1/datadog/model_list_stream_source.go @@ -16,15 +16,19 @@ type ListStreamSource string // List of ListStreamSource const ( - LISTSTREAMSOURCE_ISSUE_STREAM ListStreamSource = "issue_stream" - LISTSTREAMSOURCE_LOGS_STREAM ListStreamSource = "logs_stream" - LISTSTREAMSOURCE_AUDIT_STREAM ListStreamSource = "audit_stream" + LISTSTREAMSOURCE_ISSUE_STREAM ListStreamSource = "issue_stream" + LISTSTREAMSOURCE_LOGS_STREAM ListStreamSource = "logs_stream" + LISTSTREAMSOURCE_AUDIT_STREAM ListStreamSource = "audit_stream" + LISTSTREAMSOURCE_RUM_ISSUE_STREAM ListStreamSource = "rum_issue_stream" + LISTSTREAMSOURCE_APM_ISSUE_STREAM ListStreamSource = "apm_issue_stream" ) var allowedListStreamSourceEnumValues = []ListStreamSource{ LISTSTREAMSOURCE_ISSUE_STREAM, LISTSTREAMSOURCE_LOGS_STREAM, LISTSTREAMSOURCE_AUDIT_STREAM, + LISTSTREAMSOURCE_RUM_ISSUE_STREAM, + LISTSTREAMSOURCE_APM_ISSUE_STREAM, } func (w *ListStreamSource) GetAllowedValues() []ListStreamSource { diff --git a/examples/v1/dashboards/CreateDashboard_4026341408.go b/examples/v1/dashboards/CreateDashboard_4026341408.go new file mode 100644 index 00000000000..a71af033e7f --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_4026341408.go @@ -0,0 +1,54 @@ +// Create a new dashboard with apm_issue_stream list_stream widget + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog" +) + +func main() { + body := datadog.Dashboard{ + LayoutType: datadog.DASHBOARDLAYOUTTYPE_ORDERED, + Title: "Example-Create_a_new_dashboard_with_apm_issue_stream_list_stream_widget with list_stream widget", + Widgets: []datadog.Widget{ + { + Definition: datadog.WidgetDefinition{ + ListStreamWidgetDefinition: &datadog.ListStreamWidgetDefinition{ + Type: datadog.LISTSTREAMWIDGETDEFINITIONTYPE_LIST_STREAM, + Requests: []datadog.ListStreamWidgetRequest{ + { + Columns: []datadog.ListStreamColumn{ + { + Width: datadog.LISTSTREAMCOLUMNWIDTH_AUTO, + Field: "timestamp", + }, + }, + Query: datadog.ListStreamQuery{ + DataSource: datadog.LISTSTREAMSOURCE_APM_ISSUE_STREAM, + QueryString: "", + }, + ResponseFormat: datadog.LISTSTREAMRESPONSEFORMAT_EVENT_LIST, + }, + }, + }}, + }, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + resp, r, err := apiClient.DashboardsApi.CreateDashboard(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.CreateDashboard`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `DashboardsApi.CreateDashboard`:\n%s\n", responseContent) +} diff --git a/examples/v1/dashboards/CreateDashboard_4076476470.go b/examples/v1/dashboards/CreateDashboard_4076476470.go new file mode 100644 index 00000000000..c39b4d7b5b3 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_4076476470.go @@ -0,0 +1,54 @@ +// Create a new dashboard with rum_issue_stream list_stream widget + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog" +) + +func main() { + body := datadog.Dashboard{ + LayoutType: datadog.DASHBOARDLAYOUTTYPE_ORDERED, + Title: "Example-Create_a_new_dashboard_with_rum_issue_stream_list_stream_widget with list_stream widget", + Widgets: []datadog.Widget{ + { + Definition: datadog.WidgetDefinition{ + ListStreamWidgetDefinition: &datadog.ListStreamWidgetDefinition{ + Type: datadog.LISTSTREAMWIDGETDEFINITIONTYPE_LIST_STREAM, + Requests: []datadog.ListStreamWidgetRequest{ + { + Columns: []datadog.ListStreamColumn{ + { + Width: datadog.LISTSTREAMCOLUMNWIDTH_AUTO, + Field: "timestamp", + }, + }, + Query: datadog.ListStreamQuery{ + DataSource: datadog.LISTSTREAMSOURCE_RUM_ISSUE_STREAM, + QueryString: "", + }, + ResponseFormat: datadog.LISTSTREAMRESPONSEFORMAT_EVENT_LIST, + }, + }, + }}, + }, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + resp, r, err := apiClient.DashboardsApi.CreateDashboard(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.CreateDashboard`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `DashboardsApi.CreateDashboard`:\n%s\n", responseContent) +} diff --git a/tests/scenarios/features/v1/dashboards.feature b/tests/scenarios/features/v1/dashboards.feature index 4f5cc6bc609..2833530ba44 100644 --- a/tests/scenarios/features/v1/dashboards.feature +++ b/tests/scenarios/features/v1/dashboards.feature @@ -123,6 +123,13 @@ Feature: Dashboards And the response "widgets[0].definition.requests[0].queries[0].primary_tag_name" is equal to "datacenter" And the response "widgets[0].definition.requests[0].queries[0].operation_name" is equal to "cassandra.query" + @team:DataDog/dashboards + Scenario: Create a new dashboard with apm_issue_stream list_stream widget + Given new "CreateDashboard" request + And body with value {"layout_type": "ordered", "title": "{{ unique }} with list_stream widget","widgets": [{"definition": {"type": "list_stream","requests": [{"columns":[{"width":"auto","field":"timestamp"}],"query":{"data_source":"apm_issue_stream","query_string":""},"response_format":"event_list"}]}}]} + When the request is sent + Then the response status is 200 OK + @team:DataDog/dashboards Scenario: Create a new dashboard with check_status widget Given new "CreateDashboard" request @@ -297,6 +304,13 @@ Feature: Dashboards And the response "widgets[0].definition.type" is equal to "query_value" And the response "widgets[0].definition.requests[0].queries[0].query" is equal to "avg:system.cpu.user{*}" + @team:DataDog/dashboards + Scenario: Create a new dashboard with rum_issue_stream list_stream widget + Given new "CreateDashboard" request + And body with value {"layout_type": "ordered", "title": "{{ unique }} with list_stream widget","widgets": [{"definition": {"type": "list_stream","requests": [{"columns":[{"width":"auto","field":"timestamp"}],"query":{"data_source":"rum_issue_stream","query_string":""},"response_format":"event_list"}]}}]} + When the request is sent + Then the response status is 200 OK + @team:DataDog/dashboards Scenario: Create a new dashboard with scatterplot widget Given new "CreateDashboard" request