Skip to content

Commit 7102ea8

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 2defd7d2 of spec repo
1 parent bbc416f commit 7102ea8

13 files changed

+332
-10
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.4",
7-
"regenerated": "2022-09-16 13:42:49.599994",
8-
"spec_repo_commit": "acc0b78b"
7+
"regenerated": "2022-09-22 14:50:10.194876",
8+
"spec_repo_commit": "2defd7d2"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-09-16 13:42:49.615641",
13-
"spec_repo_commit": "acc0b78b"
12+
"regenerated": "2022-09-22 14:50:10.207144",
13+
"spec_repo_commit": "2defd7d2"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,6 +2440,10 @@ components:
24402440
type: string
24412441
search:
24422442
$ref: '#/components/schemas/FormulaAndFunctionEventQueryDefinitionSearch'
2443+
storage:
2444+
description: Option for storage location. Feature in Private Beta.
2445+
example: indexes
2446+
type: string
24432447
required:
24442448
- data_source
24452449
- compute
@@ -4025,6 +4029,10 @@ components:
40254029
description: Widget query.
40264030
example: '@service:app'
40274031
type: string
4032+
storage:
4033+
description: Option for storage location. Feature in Private Beta.
4034+
example: indexes
4035+
type: string
40284036
required:
40294037
- query_string
40304038
- data_source

api/datadogV1/model_formula_and_function_event_query_definition.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ type FormulaAndFunctionEventQueryDefinition struct {
2323
Name string `json:"name"`
2424
// Search options.
2525
Search *FormulaAndFunctionEventQueryDefinitionSearch `json:"search,omitempty"`
26+
// Option for storage location. Feature in Private Beta.
27+
Storage *string `json:"storage,omitempty"`
2628
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2729
UnparsedObject map[string]interface{} `json:-`
2830
AdditionalProperties map[string]interface{}
@@ -213,6 +215,38 @@ func (o *FormulaAndFunctionEventQueryDefinition) SetSearch(v FormulaAndFunctionE
213215
o.Search = &v
214216
}
215217

218+
// GetStorage returns the Storage field value if set, zero value otherwise.
219+
func (o *FormulaAndFunctionEventQueryDefinition) GetStorage() string {
220+
if o == nil || o.Storage == nil {
221+
var ret string
222+
return ret
223+
}
224+
return *o.Storage
225+
}
226+
227+
// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise
228+
// and a boolean to check if the value has been set.
229+
func (o *FormulaAndFunctionEventQueryDefinition) GetStorageOk() (*string, bool) {
230+
if o == nil || o.Storage == nil {
231+
return nil, false
232+
}
233+
return o.Storage, true
234+
}
235+
236+
// HasStorage returns a boolean if a field has been set.
237+
func (o *FormulaAndFunctionEventQueryDefinition) HasStorage() bool {
238+
if o != nil && o.Storage != nil {
239+
return true
240+
}
241+
242+
return false
243+
}
244+
245+
// SetStorage gets a reference to the given string and assigns it to the Storage field.
246+
func (o *FormulaAndFunctionEventQueryDefinition) SetStorage(v string) {
247+
o.Storage = &v
248+
}
249+
216250
// MarshalJSON serializes the struct using spec logic.
217251
func (o FormulaAndFunctionEventQueryDefinition) MarshalJSON() ([]byte, error) {
218252
toSerialize := map[string]interface{}{}
@@ -231,6 +265,9 @@ func (o FormulaAndFunctionEventQueryDefinition) MarshalJSON() ([]byte, error) {
231265
if o.Search != nil {
232266
toSerialize["search"] = o.Search
233267
}
268+
if o.Storage != nil {
269+
toSerialize["storage"] = o.Storage
270+
}
234271

235272
for key, value := range o.AdditionalProperties {
236273
toSerialize[key] = value
@@ -253,6 +290,7 @@ func (o *FormulaAndFunctionEventQueryDefinition) UnmarshalJSON(bytes []byte) (er
253290
Indexes []string `json:"indexes,omitempty"`
254291
Name string `json:"name"`
255292
Search *FormulaAndFunctionEventQueryDefinitionSearch `json:"search,omitempty"`
293+
Storage *string `json:"storage,omitempty"`
256294
}{}
257295
err = json.Unmarshal(bytes, &required)
258296
if err != nil {
@@ -304,5 +342,6 @@ func (o *FormulaAndFunctionEventQueryDefinition) UnmarshalJSON(bytes []byte) (er
304342
o.UnparsedObject = raw
305343
}
306344
o.Search = all.Search
345+
o.Storage = all.Storage
307346
return nil
308347
}

api/datadogV1/model_list_stream_query.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ type ListStreamQuery struct {
1717
Indexes []string `json:"indexes,omitempty"`
1818
// Widget query.
1919
QueryString string `json:"query_string"`
20+
// Option for storage location. Feature in Private Beta.
21+
Storage *string `json:"storage,omitempty"`
2022
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2123
UnparsedObject map[string]interface{} `json:-`
2224
AdditionalProperties map[string]interface{}
@@ -121,6 +123,38 @@ func (o *ListStreamQuery) SetQueryString(v string) {
121123
o.QueryString = v
122124
}
123125

126+
// GetStorage returns the Storage field value if set, zero value otherwise.
127+
func (o *ListStreamQuery) GetStorage() string {
128+
if o == nil || o.Storage == nil {
129+
var ret string
130+
return ret
131+
}
132+
return *o.Storage
133+
}
134+
135+
// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise
136+
// and a boolean to check if the value has been set.
137+
func (o *ListStreamQuery) GetStorageOk() (*string, bool) {
138+
if o == nil || o.Storage == nil {
139+
return nil, false
140+
}
141+
return o.Storage, true
142+
}
143+
144+
// HasStorage returns a boolean if a field has been set.
145+
func (o *ListStreamQuery) HasStorage() bool {
146+
if o != nil && o.Storage != nil {
147+
return true
148+
}
149+
150+
return false
151+
}
152+
153+
// SetStorage gets a reference to the given string and assigns it to the Storage field.
154+
func (o *ListStreamQuery) SetStorage(v string) {
155+
o.Storage = &v
156+
}
157+
124158
// MarshalJSON serializes the struct using spec logic.
125159
func (o ListStreamQuery) MarshalJSON() ([]byte, error) {
126160
toSerialize := map[string]interface{}{}
@@ -132,6 +166,9 @@ func (o ListStreamQuery) MarshalJSON() ([]byte, error) {
132166
toSerialize["indexes"] = o.Indexes
133167
}
134168
toSerialize["query_string"] = o.QueryString
169+
if o.Storage != nil {
170+
toSerialize["storage"] = o.Storage
171+
}
135172

136173
for key, value := range o.AdditionalProperties {
137174
toSerialize[key] = value
@@ -150,6 +187,7 @@ func (o *ListStreamQuery) UnmarshalJSON(bytes []byte) (err error) {
150187
DataSource ListStreamSource `json:"data_source"`
151188
Indexes []string `json:"indexes,omitempty"`
152189
QueryString string `json:"query_string"`
190+
Storage *string `json:"storage,omitempty"`
153191
}{}
154192
err = json.Unmarshal(bytes, &required)
155193
if err != nil {
@@ -181,5 +219,6 @@ func (o *ListStreamQuery) UnmarshalJSON(bytes []byte) (err error) {
181219
o.DataSource = all.DataSource
182220
o.Indexes = all.Indexes
183221
o.QueryString = all.QueryString
222+
o.Storage = all.Storage
184223
return nil
185224
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Create a new dashboard with logs_stream list_stream widget and storage parameter
2+
3+
package main
4+
5+
import (
6+
"context"
7+
"encoding/json"
8+
"fmt"
9+
"os"
10+
11+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
12+
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
13+
)
14+
15+
func main() {
16+
body := datadogV1.Dashboard{
17+
LayoutType: datadogV1.DASHBOARDLAYOUTTYPE_ORDERED,
18+
Title: "Example-Create_a_new_dashboard_with_logs_stream_list_stream_widget_and_storage_parameter with list_stream widget",
19+
Widgets: []datadogV1.Widget{
20+
{
21+
Definition: datadogV1.WidgetDefinition{
22+
ListStreamWidgetDefinition: &datadogV1.ListStreamWidgetDefinition{
23+
Type: datadogV1.LISTSTREAMWIDGETDEFINITIONTYPE_LIST_STREAM,
24+
Requests: []datadogV1.ListStreamWidgetRequest{
25+
{
26+
Columns: []datadogV1.ListStreamColumn{
27+
{
28+
Width: datadogV1.LISTSTREAMCOLUMNWIDTH_AUTO,
29+
Field: "timestamp",
30+
},
31+
},
32+
Query: datadogV1.ListStreamQuery{
33+
DataSource: datadogV1.LISTSTREAMSOURCE_LOGS_STREAM,
34+
QueryString: "",
35+
Storage: datadog.PtrString("hot"),
36+
},
37+
ResponseFormat: datadogV1.LISTSTREAMRESPONSEFORMAT_EVENT_LIST,
38+
},
39+
},
40+
}},
41+
},
42+
},
43+
}
44+
ctx := datadog.NewDefaultContext(context.Background())
45+
configuration := datadog.NewConfiguration()
46+
apiClient := datadog.NewAPIClient(configuration)
47+
api := datadogV1.NewDashboardsApi(apiClient)
48+
resp, r, err := api.CreateDashboard(ctx, body)
49+
50+
if err != nil {
51+
fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.CreateDashboard`: %v\n", err)
52+
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
53+
}
54+
55+
responseContent, _ := json.MarshalIndent(resp, "", " ")
56+
fmt.Fprintf(os.Stdout, "Response from `DashboardsApi.CreateDashboard`:\n%s\n", responseContent)
57+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// Create a new dashboard with logs query table widget and storage parameter
2+
3+
package main
4+
5+
import (
6+
"context"
7+
"encoding/json"
8+
"fmt"
9+
"os"
10+
11+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
12+
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
13+
)
14+
15+
func main() {
16+
body := datadogV1.Dashboard{
17+
LayoutType: datadogV1.DASHBOARDLAYOUTTYPE_ORDERED,
18+
Title: "Example-Create_a_new_dashboard_with_logs_query_table_widget_and_storage_parameter with query table widget and storage parameter",
19+
Widgets: []datadogV1.Widget{
20+
{
21+
Definition: datadogV1.WidgetDefinition{
22+
TableWidgetDefinition: &datadogV1.TableWidgetDefinition{
23+
Type: datadogV1.TABLEWIDGETDEFINITIONTYPE_QUERY_TABLE,
24+
Requests: []datadogV1.TableWidgetRequest{
25+
{
26+
Queries: []datadogV1.FormulaAndFunctionQueryDefinition{
27+
datadogV1.FormulaAndFunctionQueryDefinition{
28+
FormulaAndFunctionEventQueryDefinition: &datadogV1.FormulaAndFunctionEventQueryDefinition{
29+
DataSource: datadogV1.FORMULAANDFUNCTIONEVENTSDATASOURCE_LOGS,
30+
Name: "query1",
31+
Search: &datadogV1.FormulaAndFunctionEventQueryDefinitionSearch{
32+
Query: "",
33+
},
34+
Indexes: []string{
35+
"*",
36+
},
37+
Compute: datadogV1.FormulaAndFunctionEventQueryDefinitionCompute{
38+
Aggregation: datadogV1.FORMULAANDFUNCTIONEVENTAGGREGATION_COUNT,
39+
},
40+
GroupBy: []datadogV1.FormulaAndFunctionEventQueryGroupBy{},
41+
Storage: datadog.PtrString("online_archives"),
42+
}},
43+
},
44+
Formulas: []datadogV1.WidgetFormula{
45+
{
46+
ConditionalFormats: []datadogV1.WidgetConditionalFormat{},
47+
CellDisplayMode: datadogV1.TABLEWIDGETCELLDISPLAYMODE_BAR.Ptr(),
48+
Formula: "query1",
49+
Limit: &datadogV1.WidgetFormulaLimit{
50+
Count: datadog.PtrInt64(50),
51+
Order: datadogV1.QUERYSORTORDER_DESC.Ptr(),
52+
},
53+
},
54+
},
55+
ResponseFormat: datadogV1.FORMULAANDFUNCTIONRESPONSEFORMAT_SCALAR.Ptr(),
56+
},
57+
},
58+
}},
59+
},
60+
},
61+
}
62+
ctx := datadog.NewDefaultContext(context.Background())
63+
configuration := datadog.NewConfiguration()
64+
apiClient := datadog.NewAPIClient(configuration)
65+
api := datadogV1.NewDashboardsApi(apiClient)
66+
resp, r, err := api.CreateDashboard(ctx, body)
67+
68+
if err != nil {
69+
fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.CreateDashboard`: %v\n", err)
70+
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
71+
}
72+
73+
responseContent, _ := json.MarshalIndent(resp, "", " ")
74+
fmt.Fprintf(os.Stdout, "Response from `DashboardsApi.CreateDashboard`:\n%s\n", responseContent)
75+
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-04-05T17:19:04.966Z
1+
2022-09-22T14:46:14.443Z

tests/scenarios/cassettes/TestScenarios/v1/Feature_Dashboards/Scenario_Create_a_new_dashboard_with_apm_issue_stream_list_stream_widget.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: |
4-
{"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"}}]}
4+
{"layout_type":"ordered","title":"Test-Create_a_new_dashboard_with_apm_issue_stream_list_stream_widget-1663857974 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"}}]}
55
form: {}
66
headers:
77
Accept:
@@ -11,8 +11,10 @@ interactions:
1111
method: POST
1212
url: https://api.datadoghq.com/api/v1/dashboard
1313
response:
14-
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
15-
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":"[email protected]","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"}'
14+
body: '{"notify_list":null,"description":null,"restricted_roles":[],"author_name":null,"template_variables":null,"is_read_only":false,"id":"xhp-ymt-7mz","title":"Test-Create_a_new_dashboard_with_apm_issue_stream_list_stream_widget-1663857974
15+
with list_stream widget","url":"/dashboard/xhp-ymt-7mz/test-createanewdashboardwithapmissuestreamliststreamwidget-1663857974-with-lists","created_at":"2022-09-22T14:46:14.861195+00:00","modified_at":"2022-09-22T14:46:14.861195+00:00","author_handle":"[email protected]","widgets":[{"definition":{"requests":[{"query":{"query_string":"","data_source":"apm_issue_stream"},"response_format":"event_list","columns":[{"field":"timestamp","width":"auto"}]}],"type":"list_stream"},"id":8154733979358236}],"layout_type":"ordered"}
16+
17+
'
1618
code: 200
1719
duration: ''
1820
headers:
@@ -26,9 +28,11 @@ interactions:
2628
Accept:
2729
- application/json
2830
method: DELETE
29-
url: https://api.datadoghq.com/api/v1/dashboard/fbq-m3y-6wb
31+
url: https://api.datadoghq.com/api/v1/dashboard/xhp-ymt-7mz
3032
response:
31-
body: '{"deleted_dashboard_id":"fbq-m3y-6wb"}'
33+
body: '{"deleted_dashboard_id":"xhp-ymt-7mz"}
34+
35+
'
3236
code: 200
3337
duration: ''
3438
headers:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2022-09-22T14:46:31.887Z

0 commit comments

Comments
 (0)