Skip to content

Commit

Permalink
Regenerate client from commit 116ef08 of spec repo (#1271)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Jan 4, 2022
1 parent 9e2043c commit 1b07a9d
Show file tree
Hide file tree
Showing 86 changed files with 3,295 additions and 4 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.5.1.dev2",
"regenerated": "2022-01-04 09:52:32.436445",
"spec_repo_commit": "184be3f"
"regenerated": "2022-01-04 14:44:52.038371",
"spec_repo_commit": "116ef08"
},
"v2": {
"apigentools_version": "1.5.1.dev2",
"regenerated": "2022-01-04 09:52:32.454722",
"spec_repo_commit": "184be3f"
"regenerated": "2022-01-04 14:44:52.058365",
"spec_repo_commit": "116ef08"
}
}
}
61 changes: 61 additions & 0 deletions examples/v1/dashboards/CreateDashboard_1177423752.go
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)
}
64 changes: 64 additions & 0 deletions examples/v1/dashboards/CreateDashboard_1200099236.go
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)
}
76 changes: 76 additions & 0 deletions examples/v1/dashboards/CreateDashboard_1213075383.go
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)
}
62 changes: 62 additions & 0 deletions examples/v1/dashboards/CreateDashboard_173805046.go
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)
}
53 changes: 53 additions & 0 deletions examples/v1/dashboards/CreateDashboard_1738608750.go
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)
}
Loading

0 comments on commit 1b07a9d

Please sign in to comment.