-
Notifications
You must be signed in to change notification settings - Fork 55
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 d1a4fc3 of spec repo (#1263)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b058a11
commit 6ecb136
Showing
45 changed files
with
1,976 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,69 @@ | ||
// Create a new dashboard with apm resource stats 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_apm_resource_stats_widget", | ||
Widgets: []datadog.Widget{ | ||
datadog.Widget{ | ||
Definition: datadog.WidgetDefinition{ | ||
TableWidgetDefinition: &datadog.TableWidgetDefinition{ | ||
Title: datadog.PtrString(""), | ||
TitleSize: datadog.PtrString("16"), | ||
TitleAlign: datadog.WIDGETTEXTALIGN_LEFT.Ptr(), | ||
Type: datadog.TABLEWIDGETDEFINITIONTYPE_QUERY_TABLE, | ||
Requests: []datadog.TableWidgetRequest{ | ||
datadog.TableWidgetRequest{ | ||
ResponseFormat: datadog.FORMULAANDFUNCTIONRESPONSEFORMAT_SCALAR.Ptr(), | ||
Queries: &[]datadog.FormulaAndFunctionQueryDefinition{ | ||
datadog.FormulaAndFunctionQueryDefinition{ | ||
FormulaAndFunctionApmResourceStatsQueryDefinition: &datadog.FormulaAndFunctionApmResourceStatsQueryDefinition{ | ||
PrimaryTagValue: datadog.PtrString("edge-eu1.prod.dog"), | ||
Stat: datadog.FORMULAANDFUNCTIONAPMRESOURCESTATNAME_HITS, | ||
Name: "query1", | ||
Service: "cassandra", | ||
DataSource: datadog.FORMULAANDFUNCTIONAPMRESOURCESTATSDATASOURCE_APM_RESOURCE_STATS, | ||
Env: "ci", | ||
PrimaryTagName: datadog.PtrString("datacenter"), | ||
OperationName: datadog.PtrString("cassandra.query"), | ||
GroupBy: &[]string{ | ||
"resource_name", | ||
}, | ||
}}, | ||
}, | ||
}, | ||
}, | ||
}}, | ||
Layout: &datadog.WidgetLayout{ | ||
X: 0, | ||
Y: 0, | ||
Width: 4, | ||
Height: 4, | ||
}, | ||
}, | ||
}, | ||
LayoutType: datadog.DASHBOARDLAYOUTTYPE_ORDERED, | ||
} | ||
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,82 @@ | ||
// Create a new dashboard with formulas and functions scatterplot 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_formulas_and_functions_scatterplot_widget", | ||
Widgets: []datadog.Widget{ | ||
datadog.Widget{ | ||
Id: datadog.PtrInt64(5346764334358972), | ||
Definition: datadog.WidgetDefinition{ | ||
ScatterPlotWidgetDefinition: &datadog.ScatterPlotWidgetDefinition{ | ||
Title: datadog.PtrString(""), | ||
TitleSize: datadog.PtrString("16"), | ||
TitleAlign: datadog.WIDGETTEXTALIGN_LEFT.Ptr(), | ||
Type: datadog.SCATTERPLOTWIDGETDEFINITIONTYPE_SCATTERPLOT, | ||
Requests: datadog.ScatterPlotWidgetDefinitionRequests{ | ||
Table: &datadog.ScatterplotTableRequest{ | ||
Formulas: &[]datadog.ScatterplotWidgetFormula{ | ||
datadog.ScatterplotWidgetFormula{ | ||
Formula: "query1", | ||
Dimension: datadog.SCATTERPLOTDIMENSION_X, | ||
Alias: datadog.PtrString("my-query1"), | ||
}, | ||
datadog.ScatterplotWidgetFormula{ | ||
Formula: "query2", | ||
Dimension: datadog.SCATTERPLOTDIMENSION_Y, | ||
Alias: datadog.PtrString("my-query2"), | ||
}, | ||
}, | ||
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(), | ||
}}, | ||
datadog.FormulaAndFunctionQueryDefinition{ | ||
FormulaAndFunctionMetricQueryDefinition: &datadog.FormulaAndFunctionMetricQueryDefinition{ | ||
DataSource: datadog.FORMULAANDFUNCTIONMETRICDATASOURCE_METRICS, | ||
Name: "query2", | ||
Query: "avg:system.mem.used{*} by {service}", | ||
Aggregator: datadog.FORMULAANDFUNCTIONMETRICAGGREGATION_AVG.Ptr(), | ||
}}, | ||
}, | ||
ResponseFormat: datadog.FORMULAANDFUNCTIONRESPONSEFORMAT_SCALAR.Ptr(), | ||
}, | ||
}, | ||
}}, | ||
Layout: &datadog.WidgetLayout{ | ||
X: 0, | ||
Y: 0, | ||
Width: 4, | ||
Height: 2, | ||
}, | ||
}, | ||
}, | ||
LayoutType: datadog.DASHBOARDLAYOUTTYPE_ORDERED, | ||
} | ||
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,54 @@ | ||
// Create a new dashboard with 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_list_stream_widget with list_stream widget", | ||
Widgets: []datadog.Widget{ | ||
datadog.Widget{ | ||
Definition: datadog.WidgetDefinition{ | ||
ListStreamWidgetDefinition: &datadog.ListStreamWidgetDefinition{ | ||
Type: datadog.LISTSTREAMWIDGETDEFINITIONTYPE_LIST_STREAM, | ||
Requests: []datadog.ListStreamWidgetRequest{ | ||
datadog.ListStreamWidgetRequest{ | ||
Columns: []datadog.ListStreamColumn{ | ||
datadog.ListStreamColumn{ | ||
Width: datadog.LISTSTREAMCOLUMNWIDTH_AUTO, | ||
Field: "timestamp", | ||
}, | ||
}, | ||
Query: datadog.ListStreamQuery{ | ||
DataSource: datadog.LISTSTREAMSOURCE_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) | ||
} |
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,67 @@ | ||
// Create a new dashboard with an audit logs query | ||
|
||
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_an_audit_logs_query with Audit Logs Query", | ||
Widgets: []datadog.Widget{ | ||
datadog.Widget{ | ||
Definition: datadog.WidgetDefinition{ | ||
TimeseriesWidgetDefinition: &datadog.TimeseriesWidgetDefinition{ | ||
Type: datadog.TIMESERIESWIDGETDEFINITIONTYPE_TIMESERIES, | ||
Requests: []datadog.TimeseriesWidgetRequest{ | ||
datadog.TimeseriesWidgetRequest{ | ||
ResponseFormat: datadog.FORMULAANDFUNCTIONRESPONSEFORMAT_TIMESERIES.Ptr(), | ||
Queries: &[]datadog.FormulaAndFunctionQueryDefinition{ | ||
datadog.FormulaAndFunctionQueryDefinition{ | ||
FormulaAndFunctionEventQueryDefinition: &datadog.FormulaAndFunctionEventQueryDefinition{ | ||
Search: &datadog.FormulaAndFunctionEventQueryDefinitionSearch{ | ||
Query: "", | ||
}, | ||
DataSource: datadog.FORMULAANDFUNCTIONEVENTSDATASOURCE_AUDIT, | ||
Compute: datadog.FormulaAndFunctionEventQueryDefinitionCompute{ | ||
Aggregation: datadog.FORMULAANDFUNCTIONEVENTAGGREGATION_COUNT, | ||
}, | ||
Name: "query1", | ||
Indexes: &[]string{ | ||
"*", | ||
}, | ||
GroupBy: &[]datadog.FormulaAndFunctionEventQueryGroupBy{}, | ||
}}, | ||
}, | ||
}, | ||
}, | ||
}}, | ||
Layout: &datadog.WidgetLayout{ | ||
X: 2, | ||
Y: 0, | ||
Width: 4, | ||
Height: 2, | ||
}, | ||
}, | ||
}, | ||
} | ||
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,70 @@ | ||
// Create a new dashboard with a query value widget using the percentile aggregator | ||
|
||
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_a_query_value_widget_using_the_percentile_aggregator with QVW Percentile Aggregator", | ||
Widgets: []datadog.Widget{ | ||
datadog.Widget{ | ||
Definition: datadog.WidgetDefinition{ | ||
QueryValueWidgetDefinition: &datadog.QueryValueWidgetDefinition{ | ||
TitleSize: datadog.PtrString("16"), | ||
Title: datadog.PtrString(""), | ||
TitleAlign: datadog.WIDGETTEXTALIGN_LEFT.Ptr(), | ||
Precision: datadog.PtrInt64(2), | ||
Time: &datadog.WidgetTime{}, | ||
Autoscale: datadog.PtrBool(true), | ||
Requests: []datadog.QueryValueWidgetRequest{ | ||
datadog.QueryValueWidgetRequest{ | ||
Formulas: &[]datadog.WidgetFormula{ | ||
datadog.WidgetFormula{ | ||
Formula: "query1", | ||
}, | ||
}, | ||
ResponseFormat: datadog.FORMULAANDFUNCTIONRESPONSEFORMAT_SCALAR.Ptr(), | ||
Queries: &[]datadog.FormulaAndFunctionQueryDefinition{ | ||
datadog.FormulaAndFunctionQueryDefinition{ | ||
FormulaAndFunctionMetricQueryDefinition: &datadog.FormulaAndFunctionMetricQueryDefinition{ | ||
Query: "p90:dist.dd.dogweb.latency{*}", | ||
DataSource: datadog.FORMULAANDFUNCTIONMETRICDATASOURCE_METRICS, | ||
Name: "query1", | ||
Aggregator: datadog.FORMULAANDFUNCTIONMETRICAGGREGATION_PERCENTILE.Ptr(), | ||
}}, | ||
}, | ||
}, | ||
}, | ||
Type: datadog.QUERYVALUEWIDGETDEFINITIONTYPE_QUERY_VALUE, | ||
}}, | ||
Layout: &datadog.WidgetLayout{ | ||
Y: 0, | ||
X: 0, | ||
Height: 2, | ||
Width: 2, | ||
}, | ||
}, | ||
}, | ||
} | ||
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.