Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new ListStreamSource types in order to deprecate ISSUE_STREAM #1439

Merged
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.2",
"regenerated": "2022-04-05 15:57:44.374646",
"spec_repo_commit": "18d4cb45"
"regenerated": "2022-04-05 18:07:51.604748",
"spec_repo_commit": "7a0287eb"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-04-05 15:57:44.390708",
"spec_repo_commit": "18d4cb45"
"regenerated": "2022-04-05 18:07:51.616826",
"spec_repo_commit": "7a0287eb"
}
}
}
10 changes: 7 additions & 3 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion api/v1/datadog/model_list_stream_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
10 changes: 7 additions & 3 deletions api/v1/datadog/model_list_stream_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
54 changes: 54 additions & 0 deletions examples/v1/dashboards/CreateDashboard_4026341408.go
Original file line number Diff line number Diff line change
@@ -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)
}
54 changes: 54 additions & 0 deletions examples/v1/dashboards/CreateDashboard_4076476470.go
Original file line number Diff line number Diff line change
@@ -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)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2022-04-05T17:19:04.966Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
interactions:
- request:
body: |
{"layout_type":"ordered","title":"Test-Create_a_new_dashboard_with_apm_issue_stream_list_stream_widget-1649179144 with list_stream widget","widgets":[{"definition":{"requests":[{"columns":[{"field":"timestamp","width":"auto"}],"query":{"data_source":"apm_issue_stream","query_string":""},"response_format":"event_list"}],"type":"list_stream"}}]}
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
method: POST
url: https://api.datadoghq.com/api/v1/dashboard
response:
body: '{"notify_list":null,"description":null,"restricted_roles":[],"author_name":null,"template_variables":null,"is_read_only":false,"id":"fbq-m3y-6wb","title":"Test-Create_a_new_dashboard_with_apm_issue_stream_list_stream_widget-1649179144
with list_stream widget","url":"/dashboard/fbq-m3y-6wb/test-createanewdashboardwithapmissuestreamliststreamwidget-1649179144-with-lists","created_at":"2022-04-05T17:19:05.083182+00:00","modified_at":"2022-04-05T17:19:05.083182+00:00","author_handle":"frog@datadoghq.com","widgets":[{"definition":{"requests":[{"query":{"query_string":"","data_source":"apm_issue_stream"},"response_format":"event_list","columns":[{"field":"timestamp","width":"auto"}]}],"type":"list_stream"},"id":2589925713372507}],"layout_type":"ordered"}'
code: 200
duration: ''
headers:
Content-Type:
- application/json
status: 200 OK
- request:
body: ''
form: {}
headers:
Accept:
- application/json
method: DELETE
url: https://api.datadoghq.com/api/v1/dashboard/fbq-m3y-6wb
response:
body: '{"deleted_dashboard_id":"fbq-m3y-6wb"}'
code: 200
duration: ''
headers:
Content-Type:
- application/json
status: 200 OK
version: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2022-04-05T17:19:05.343Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
interactions:
- request:
body: |
{"layout_type":"ordered","title":"Test-Create_a_new_dashboard_with_rum_issue_stream_list_stream_widget-1649179145 with list_stream widget","widgets":[{"definition":{"requests":[{"columns":[{"field":"timestamp","width":"auto"}],"query":{"data_source":"rum_issue_stream","query_string":""},"response_format":"event_list"}],"type":"list_stream"}}]}
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
method: POST
url: https://api.datadoghq.com/api/v1/dashboard
response:
body: '{"notify_list":null,"description":null,"restricted_roles":[],"author_name":null,"template_variables":null,"is_read_only":false,"id":"847-9hf-ftb","title":"Test-Create_a_new_dashboard_with_rum_issue_stream_list_stream_widget-1649179145
with list_stream widget","url":"/dashboard/847-9hf-ftb/test-createanewdashboardwithrumissuestreamliststreamwidget-1649179145-with-lists","created_at":"2022-04-05T17:19:05.444942+00:00","modified_at":"2022-04-05T17:19:05.444942+00:00","author_handle":"frog@datadoghq.com","widgets":[{"definition":{"requests":[{"query":{"query_string":"","data_source":"rum_issue_stream"},"response_format":"event_list","columns":[{"field":"timestamp","width":"auto"}]}],"type":"list_stream"},"id":7299581017937461}],"layout_type":"ordered"}'
code: 200
duration: ''
headers:
Content-Type:
- application/json
status: 200 OK
- request:
body: ''
form: {}
headers:
Accept:
- application/json
method: DELETE
url: https://api.datadoghq.com/api/v1/dashboard/847-9hf-ftb
response:
body: '{"deleted_dashboard_id":"847-9hf-ftb"}'
code: 200
duration: ''
headers:
Content-Type:
- application/json
status: 200 OK
version: 1
14 changes: 14 additions & 0 deletions tests/scenarios/features/v1/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down