Skip to content

Commit

Permalink
Regenerate client from commit 1bab7e2e of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Apr 5, 2022
1 parent 865bf75 commit 108279d
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 11 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.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"
}
}
}
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)
}
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

0 comments on commit 108279d

Please sign in to comment.