-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit 116ef08 of spec repo (#1271)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
- Loading branch information
1 parent
9e2043c
commit 1b07a9d
Showing
86 changed files
with
3,295 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Create a new dashboard with heatmap 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{ | ||
Title: "Example-Create_a_new_dashboard_with_heatmap_widget", | ||
Description: *datadog.NewNullableString(nil), | ||
Widgets: []datadog.Widget{ | ||
{ | ||
Layout: &datadog.WidgetLayout{ | ||
X: 0, | ||
Y: 0, | ||
Width: 47, | ||
Height: 15, | ||
}, | ||
Definition: datadog.WidgetDefinition{ | ||
HeatMapWidgetDefinition: &datadog.HeatMapWidgetDefinition{ | ||
Title: datadog.PtrString(""), | ||
TitleSize: datadog.PtrString("16"), | ||
TitleAlign: datadog.WIDGETTEXTALIGN_LEFT.Ptr(), | ||
Time: &datadog.WidgetTime{}, | ||
Type: datadog.HEATMAPWIDGETDEFINITIONTYPE_HEATMAP, | ||
Requests: []datadog.HeatMapWidgetRequest{ | ||
{ | ||
Q: datadog.PtrString("avg:system.cpu.user{*} by {service}"), | ||
Style: &datadog.WidgetStyle{ | ||
Palette: datadog.PtrString("dog_classic"), | ||
}, | ||
}, | ||
}, | ||
}}, | ||
}, | ||
}, | ||
TemplateVariables: []datadog.DashboardTemplateVariable{}, | ||
LayoutType: datadog.DASHBOARDLAYOUTTYPE_FREE, | ||
IsReadOnly: datadog.PtrBool(false), | ||
NotifyList: []string{}, | ||
} | ||
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Create a new dashboard with hostmap 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{ | ||
Title: "Example-Create_a_new_dashboard_with_hostmap_widget", | ||
Description: *datadog.NewNullableString(nil), | ||
Widgets: []datadog.Widget{ | ||
{ | ||
Layout: &datadog.WidgetLayout{ | ||
X: 0, | ||
Y: 0, | ||
Width: 47, | ||
Height: 22, | ||
}, | ||
Definition: datadog.WidgetDefinition{ | ||
HostMapWidgetDefinition: &datadog.HostMapWidgetDefinition{ | ||
Title: datadog.PtrString(""), | ||
TitleSize: datadog.PtrString("16"), | ||
TitleAlign: datadog.WIDGETTEXTALIGN_LEFT.Ptr(), | ||
Type: datadog.HOSTMAPWIDGETDEFINITIONTYPE_HOSTMAP, | ||
Requests: datadog.HostMapWidgetDefinitionRequests{ | ||
Fill: &datadog.HostMapRequest{ | ||
Q: datadog.PtrString("avg:system.cpu.user{*} by {host}"), | ||
}, | ||
}, | ||
NodeType: datadog.WIDGETNODETYPE_HOST.Ptr(), | ||
NoMetricHosts: datadog.PtrBool(true), | ||
NoGroupHosts: datadog.PtrBool(true), | ||
Style: &datadog.HostMapWidgetDefinitionStyle{ | ||
Palette: datadog.PtrString("green_to_orange"), | ||
PaletteFlip: datadog.PtrBool(false), | ||
}, | ||
}}, | ||
}, | ||
}, | ||
TemplateVariables: []datadog.DashboardTemplateVariable{}, | ||
LayoutType: datadog.DASHBOARDLAYOUTTYPE_FREE, | ||
IsReadOnly: datadog.PtrBool(false), | ||
NotifyList: []string{}, | ||
} | ||
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// Create a new dashboard with toplist 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{ | ||
Title: "Example-Create_a_new_dashboard_with_toplist_widget", | ||
Description: *datadog.NewNullableString(datadog.PtrString("")), | ||
Widgets: []datadog.Widget{ | ||
{ | ||
Layout: &datadog.WidgetLayout{ | ||
X: 0, | ||
Y: 0, | ||
Width: 47, | ||
Height: 15, | ||
}, | ||
Definition: datadog.WidgetDefinition{ | ||
ToplistWidgetDefinition: &datadog.ToplistWidgetDefinition{ | ||
Title: datadog.PtrString(""), | ||
TitleSize: datadog.PtrString("16"), | ||
TitleAlign: datadog.WIDGETTEXTALIGN_LEFT.Ptr(), | ||
Time: &datadog.WidgetTime{}, | ||
Type: datadog.TOPLISTWIDGETDEFINITIONTYPE_TOPLIST, | ||
Requests: []datadog.ToplistWidgetRequest{ | ||
{ | ||
Queries: &[]datadog.FormulaAndFunctionQueryDefinition{ | ||
datadog.FormulaAndFunctionQueryDefinition{ | ||
FormulaAndFunctionMetricQueryDefinition: &datadog.FormulaAndFunctionMetricQueryDefinition{ | ||
DataSource: datadog.FORMULAANDFUNCTIONMETRICDATASOURCE_METRICS, | ||
Name: "query1", | ||
Query: "avg:system.cpu.user{*} by {service}", | ||
Aggregator: datadog.FORMULAANDFUNCTIONMETRICAGGREGATION_AVG.Ptr(), | ||
}}, | ||
}, | ||
Formulas: &[]datadog.WidgetFormula{ | ||
{ | ||
Formula: "query1", | ||
Limit: &datadog.WidgetFormulaLimit{ | ||
Count: datadog.PtrInt64(10), | ||
Order: datadog.QUERYSORTORDER_DESC.Ptr(), | ||
}, | ||
}, | ||
}, | ||
ResponseFormat: datadog.FORMULAANDFUNCTIONRESPONSEFORMAT_SCALAR.Ptr(), | ||
}, | ||
}, | ||
}}, | ||
}, | ||
}, | ||
TemplateVariables: []datadog.DashboardTemplateVariable{}, | ||
LayoutType: datadog.DASHBOARDLAYOUTTYPE_FREE, | ||
IsReadOnly: datadog.PtrBool(false), | ||
NotifyList: []string{}, | ||
} | ||
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Create a new dashboard with slo widget | ||
|
||
package main | ||
|
||
import ( | ||
"context" | ||
"encoding/json" | ||
"fmt" | ||
"os" | ||
|
||
datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog" | ||
) | ||
|
||
func main() { | ||
// there is a valid "slo" in the system | ||
SloData0ID := os.Getenv("SLO_DATA_0_ID") | ||
|
||
body := datadog.Dashboard{ | ||
Title: "Example-Create_a_new_dashboard_with_slo_widget", | ||
Description: *datadog.NewNullableString(datadog.PtrString("")), | ||
Widgets: []datadog.Widget{ | ||
{ | ||
Layout: &datadog.WidgetLayout{ | ||
X: 0, | ||
Y: 0, | ||
Width: 60, | ||
Height: 21, | ||
}, | ||
Definition: datadog.WidgetDefinition{ | ||
SLOWidgetDefinition: &datadog.SLOWidgetDefinition{ | ||
TitleSize: datadog.PtrString("16"), | ||
TitleAlign: datadog.WIDGETTEXTALIGN_LEFT.Ptr(), | ||
Type: datadog.SLOWIDGETDEFINITIONTYPE_SLO, | ||
ViewType: "detail", | ||
TimeWindows: &[]datadog.WidgetTimeWindows{ | ||
datadog.WIDGETTIMEWINDOWS_SEVEN_DAYS, | ||
}, | ||
SloId: datadog.PtrString(SloData0ID), | ||
ShowErrorBudget: datadog.PtrBool(true), | ||
ViewMode: datadog.WIDGETVIEWMODE_OVERALL.Ptr(), | ||
GlobalTimeTarget: datadog.PtrString("0"), | ||
}}, | ||
}, | ||
}, | ||
TemplateVariables: []datadog.DashboardTemplateVariable{}, | ||
LayoutType: datadog.DASHBOARDLAYOUTTYPE_FREE, | ||
IsReadOnly: datadog.PtrBool(false), | ||
NotifyList: []string{}, | ||
} | ||
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Create a new dashboard with free_text 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{ | ||
Title: "Example-Create_a_new_dashboard_with_free_text_widget", | ||
Description: *datadog.NewNullableString(nil), | ||
Widgets: []datadog.Widget{ | ||
{ | ||
Layout: &datadog.WidgetLayout{ | ||
X: 0, | ||
Y: 0, | ||
Width: 24, | ||
Height: 6, | ||
}, | ||
Definition: datadog.WidgetDefinition{ | ||
FreeTextWidgetDefinition: &datadog.FreeTextWidgetDefinition{ | ||
Type: datadog.FREETEXTWIDGETDEFINITIONTYPE_FREE_TEXT, | ||
Text: "Example free text", | ||
Color: datadog.PtrString("#4d4d4d"), | ||
FontSize: datadog.PtrString("auto"), | ||
TextAlign: datadog.WIDGETTEXTALIGN_LEFT.Ptr(), | ||
}}, | ||
}, | ||
}, | ||
TemplateVariables: []datadog.DashboardTemplateVariable{}, | ||
LayoutType: datadog.DASHBOARDLAYOUTTYPE_FREE, | ||
IsReadOnly: datadog.PtrBool(false), | ||
NotifyList: []string{}, | ||
} | ||
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) | ||
} |
Oops, something went wrong.