DistributionWidgetRequest

Struct DistributionWidgetRequest 

Source
#[non_exhaustive]
pub struct DistributionWidgetRequest {
Show 14 fields pub apm_query: Option<LogQueryDefinition>, pub apm_stats_query: Option<ApmStatsQueryDefinition>, pub event_query: Option<LogQueryDefinition>, pub log_query: Option<LogQueryDefinition>, pub network_query: Option<LogQueryDefinition>, pub process_query: Option<ProcessQueryDefinition>, pub profile_metrics_query: Option<LogQueryDefinition>, pub q: Option<String>, pub query: Option<DistributionWidgetHistogramRequestQuery>, pub request_type: Option<DistributionWidgetHistogramRequestType>, pub rum_query: Option<LogQueryDefinition>, pub security_query: Option<LogQueryDefinition>, pub style: Option<WidgetStyle>, pub additional_properties: BTreeMap<String, Value>, /* private fields */
}
Expand description

Updated distribution widget.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§apm_query: Option<LogQueryDefinition>

The log query.

§apm_stats_query: Option<ApmStatsQueryDefinition>

The APM stats query for table and distributions widgets.

§event_query: Option<LogQueryDefinition>

The log query.

§log_query: Option<LogQueryDefinition>

The log query.

§network_query: Option<LogQueryDefinition>

The log query.

§process_query: Option<ProcessQueryDefinition>

The process query to use in the widget.

§profile_metrics_query: Option<LogQueryDefinition>

The log query.

§q: Option<String>

Widget query.

§query: Option<DistributionWidgetHistogramRequestQuery>

Query definition for Distribution Widget Histogram Request

§request_type: Option<DistributionWidgetHistogramRequestType>

Request type for the histogram request.

§rum_query: Option<LogQueryDefinition>

The log query.

§security_query: Option<LogQueryDefinition>

The log query.

§style: Option<WidgetStyle>

Widget style definition.

§additional_properties: BTreeMap<String, Value>

Implementations§

Source§

impl DistributionWidgetRequest

Source

pub fn new() -> DistributionWidgetRequest

Examples found in repository?
examples/v1_dashboards_CreateDashboard_803346562.rs (line 24)
17async fn main() {
18    let body = Dashboard::new(
19        DashboardLayoutType::ORDERED,
20        "Example-Dashboard".to_string(),
21        vec![
22            Widget::new(WidgetDefinition::DistributionWidgetDefinition(Box::new(
23                DistributionWidgetDefinition::new(
24                    vec![DistributionWidgetRequest::new().apm_stats_query(
25                        ApmStatsQueryDefinition::new(
26                            "prod".to_string(),
27                            "cassandra.query".to_string(),
28                            "datacenter:dc1".to_string(),
29                            ApmStatsQueryRowType::SERVICE,
30                            "cassandra".to_string(),
31                        ),
32                    )],
33                    DistributionWidgetDefinitionType::DISTRIBUTION,
34                )
35                .title("".to_string())
36                .title_align(WidgetTextAlign::LEFT)
37                .title_size("16".to_string()),
38            )))
39            .layout(WidgetLayout::new(4, 4, 0, 0)),
40        ],
41    );
42    let configuration = datadog::Configuration::new();
43    let api = DashboardsAPI::with_config(configuration);
44    let resp = api.create_dashboard(body).await;
45    if let Ok(value) = resp {
46        println!("{:#?}", value);
47    } else {
48        println!("{:#?}", resp.unwrap_err());
49    }
50}
More examples
Hide additional examples
examples/v1_dashboards_CreateDashboard_252716965.rs (line 35)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionMetricQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionMetricQueryDefinition::new(
41                                                        FormulaAndFunctionMetricDataSource::METRICS,
42                                                        "query1".to_string(),
43                                                        "histogram:trace.Load{*}".to_string(),
44                                                    ),
45                                                ),
46                                            ),
47                                        )
48                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
49                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
50                                ],
51                                DistributionWidgetDefinitionType::DISTRIBUTION,
52                            )
53                                .custom_links(
54                                    vec![
55                                        WidgetCustomLink::new()
56                                            .label("Example".to_string())
57                                            .link("https://example.org/".to_string())
58                                    ],
59                                )
60                                .show_legend(false)
61                                .title("Metrics HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 0, 0))
81            ],
82        );
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
examples/v1_dashboards_CreateDashboard_3882428227.rs (line 36)
25async fn main() {
26    let body =
27        Dashboard::new(
28            DashboardLayoutType::ORDERED,
29            "Example-Dashboard".to_string(),
30            vec![
31                Widget::new(
32                    WidgetDefinition::DistributionWidgetDefinition(
33                        Box::new(
34                            DistributionWidgetDefinition::new(
35                                vec![
36                                    DistributionWidgetRequest::new()
37                                        .query(
38                                            DistributionWidgetHistogramRequestQuery
39                                            ::FormulaAndFunctionEventQueryDefinition(
40                                                Box::new(
41                                                    FormulaAndFunctionEventQueryDefinition::new(
42                                                        FormulaAndFunctionEventQueryDefinitionCompute::new(
43                                                            FormulaAndFunctionEventAggregation::MIN,
44                                                        ).metric("@duration".to_string()),
45                                                        FormulaAndFunctionEventsDataSource::EVENTS,
46                                                        "query1".to_string(),
47                                                    )
48                                                        .group_by(vec![])
49                                                        .indexes(vec!["*".to_string()])
50                                                        .search(
51                                                            FormulaAndFunctionEventQueryDefinitionSearch::new(
52                                                                "".to_string(),
53                                                            ),
54                                                        ),
55                                                ),
56                                            ),
57                                        )
58                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
59                                ],
60                                DistributionWidgetDefinitionType::DISTRIBUTION,
61                            )
62                                .show_legend(false)
63                                .title("Events Platform - Request latency HOP".to_string())
64                                .title_align(WidgetTextAlign::LEFT)
65                                .title_size("16".to_string())
66                                .xaxis(
67                                    DistributionWidgetXAxis::new()
68                                        .include_zero(true)
69                                        .max("auto".to_string())
70                                        .min("auto".to_string())
71                                        .scale("linear".to_string()),
72                                )
73                                .yaxis(
74                                    DistributionWidgetYAxis::new()
75                                        .include_zero(true)
76                                        .max("auto".to_string())
77                                        .min("auto".to_string())
78                                        .scale("linear".to_string()),
79                                ),
80                        ),
81                    ),
82                ).layout(WidgetLayout::new(2, 4, 0, 0))
83            ],
84        ).description(Some("Example-Dashboard".to_string()));
85    let configuration = datadog::Configuration::new();
86    let api = DashboardsAPI::with_config(configuration);
87    let resp = api.create_dashboard(body).await;
88    if let Ok(value) = resp {
89        println!("{:#?}", value);
90    } else {
91        println!("{:#?}", resp.unwrap_err());
92    }
93}
examples/v1_dashboards_CreateDashboard_1442588603.rs (line 35)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionApmResourceStatsQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionApmResourceStatsQueryDefinition::new(
41                                                        FormulaAndFunctionApmResourceStatsDataSource
42                                                        ::APM_RESOURCE_STATS,
43                                                        "staging".to_string(),
44                                                        "query1".to_string(),
45                                                        "azure-bill-import".to_string(),
46                                                        FormulaAndFunctionApmResourceStatName::LATENCY_DISTRIBUTION,
47                                                    )
48                                                        .group_by(vec!["resource_name".to_string()])
49                                                        .operation_name("universal.http.client".to_string())
50                                                        .primary_tag_name("datacenter".to_string())
51                                                        .primary_tag_value("*".to_string()),
52                                                ),
53                                            ),
54                                        )
55                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
56                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
57                                ],
58                                DistributionWidgetDefinitionType::DISTRIBUTION,
59                            )
60                                .show_legend(false)
61                                .title("APM Stats - Request latency HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 8, 0))
81            ],
82        ).description(Some("".to_string()));
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
Source

pub fn apm_query(self, value: LogQueryDefinition) -> Self

Source

pub fn apm_stats_query(self, value: ApmStatsQueryDefinition) -> Self

Examples found in repository?
examples/v1_dashboards_CreateDashboard_803346562.rs (lines 24-32)
17async fn main() {
18    let body = Dashboard::new(
19        DashboardLayoutType::ORDERED,
20        "Example-Dashboard".to_string(),
21        vec![
22            Widget::new(WidgetDefinition::DistributionWidgetDefinition(Box::new(
23                DistributionWidgetDefinition::new(
24                    vec![DistributionWidgetRequest::new().apm_stats_query(
25                        ApmStatsQueryDefinition::new(
26                            "prod".to_string(),
27                            "cassandra.query".to_string(),
28                            "datacenter:dc1".to_string(),
29                            ApmStatsQueryRowType::SERVICE,
30                            "cassandra".to_string(),
31                        ),
32                    )],
33                    DistributionWidgetDefinitionType::DISTRIBUTION,
34                )
35                .title("".to_string())
36                .title_align(WidgetTextAlign::LEFT)
37                .title_size("16".to_string()),
38            )))
39            .layout(WidgetLayout::new(4, 4, 0, 0)),
40        ],
41    );
42    let configuration = datadog::Configuration::new();
43    let api = DashboardsAPI::with_config(configuration);
44    let resp = api.create_dashboard(body).await;
45    if let Ok(value) = resp {
46        println!("{:#?}", value);
47    } else {
48        println!("{:#?}", resp.unwrap_err());
49    }
50}
Source

pub fn event_query(self, value: LogQueryDefinition) -> Self

Source

pub fn log_query(self, value: LogQueryDefinition) -> Self

Source

pub fn network_query(self, value: LogQueryDefinition) -> Self

Source

pub fn process_query(self, value: ProcessQueryDefinition) -> Self

Source

pub fn profile_metrics_query(self, value: LogQueryDefinition) -> Self

Source

pub fn q(self, value: String) -> Self

Source

pub fn query(self, value: DistributionWidgetHistogramRequestQuery) -> Self

Examples found in repository?
examples/v1_dashboards_CreateDashboard_252716965.rs (lines 36-47)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionMetricQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionMetricQueryDefinition::new(
41                                                        FormulaAndFunctionMetricDataSource::METRICS,
42                                                        "query1".to_string(),
43                                                        "histogram:trace.Load{*}".to_string(),
44                                                    ),
45                                                ),
46                                            ),
47                                        )
48                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
49                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
50                                ],
51                                DistributionWidgetDefinitionType::DISTRIBUTION,
52                            )
53                                .custom_links(
54                                    vec![
55                                        WidgetCustomLink::new()
56                                            .label("Example".to_string())
57                                            .link("https://example.org/".to_string())
58                                    ],
59                                )
60                                .show_legend(false)
61                                .title("Metrics HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 0, 0))
81            ],
82        );
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
More examples
Hide additional examples
examples/v1_dashboards_CreateDashboard_3882428227.rs (lines 37-57)
25async fn main() {
26    let body =
27        Dashboard::new(
28            DashboardLayoutType::ORDERED,
29            "Example-Dashboard".to_string(),
30            vec![
31                Widget::new(
32                    WidgetDefinition::DistributionWidgetDefinition(
33                        Box::new(
34                            DistributionWidgetDefinition::new(
35                                vec![
36                                    DistributionWidgetRequest::new()
37                                        .query(
38                                            DistributionWidgetHistogramRequestQuery
39                                            ::FormulaAndFunctionEventQueryDefinition(
40                                                Box::new(
41                                                    FormulaAndFunctionEventQueryDefinition::new(
42                                                        FormulaAndFunctionEventQueryDefinitionCompute::new(
43                                                            FormulaAndFunctionEventAggregation::MIN,
44                                                        ).metric("@duration".to_string()),
45                                                        FormulaAndFunctionEventsDataSource::EVENTS,
46                                                        "query1".to_string(),
47                                                    )
48                                                        .group_by(vec![])
49                                                        .indexes(vec!["*".to_string()])
50                                                        .search(
51                                                            FormulaAndFunctionEventQueryDefinitionSearch::new(
52                                                                "".to_string(),
53                                                            ),
54                                                        ),
55                                                ),
56                                            ),
57                                        )
58                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
59                                ],
60                                DistributionWidgetDefinitionType::DISTRIBUTION,
61                            )
62                                .show_legend(false)
63                                .title("Events Platform - Request latency HOP".to_string())
64                                .title_align(WidgetTextAlign::LEFT)
65                                .title_size("16".to_string())
66                                .xaxis(
67                                    DistributionWidgetXAxis::new()
68                                        .include_zero(true)
69                                        .max("auto".to_string())
70                                        .min("auto".to_string())
71                                        .scale("linear".to_string()),
72                                )
73                                .yaxis(
74                                    DistributionWidgetYAxis::new()
75                                        .include_zero(true)
76                                        .max("auto".to_string())
77                                        .min("auto".to_string())
78                                        .scale("linear".to_string()),
79                                ),
80                        ),
81                    ),
82                ).layout(WidgetLayout::new(2, 4, 0, 0))
83            ],
84        ).description(Some("Example-Dashboard".to_string()));
85    let configuration = datadog::Configuration::new();
86    let api = DashboardsAPI::with_config(configuration);
87    let resp = api.create_dashboard(body).await;
88    if let Ok(value) = resp {
89        println!("{:#?}", value);
90    } else {
91        println!("{:#?}", resp.unwrap_err());
92    }
93}
examples/v1_dashboards_CreateDashboard_1442588603.rs (lines 36-54)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionApmResourceStatsQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionApmResourceStatsQueryDefinition::new(
41                                                        FormulaAndFunctionApmResourceStatsDataSource
42                                                        ::APM_RESOURCE_STATS,
43                                                        "staging".to_string(),
44                                                        "query1".to_string(),
45                                                        "azure-bill-import".to_string(),
46                                                        FormulaAndFunctionApmResourceStatName::LATENCY_DISTRIBUTION,
47                                                    )
48                                                        .group_by(vec!["resource_name".to_string()])
49                                                        .operation_name("universal.http.client".to_string())
50                                                        .primary_tag_name("datacenter".to_string())
51                                                        .primary_tag_value("*".to_string()),
52                                                ),
53                                            ),
54                                        )
55                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
56                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
57                                ],
58                                DistributionWidgetDefinitionType::DISTRIBUTION,
59                            )
60                                .show_legend(false)
61                                .title("APM Stats - Request latency HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 8, 0))
81            ],
82        ).description(Some("".to_string()));
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
Source

pub fn request_type(self, value: DistributionWidgetHistogramRequestType) -> Self

Examples found in repository?
examples/v1_dashboards_CreateDashboard_252716965.rs (line 48)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionMetricQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionMetricQueryDefinition::new(
41                                                        FormulaAndFunctionMetricDataSource::METRICS,
42                                                        "query1".to_string(),
43                                                        "histogram:trace.Load{*}".to_string(),
44                                                    ),
45                                                ),
46                                            ),
47                                        )
48                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
49                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
50                                ],
51                                DistributionWidgetDefinitionType::DISTRIBUTION,
52                            )
53                                .custom_links(
54                                    vec![
55                                        WidgetCustomLink::new()
56                                            .label("Example".to_string())
57                                            .link("https://example.org/".to_string())
58                                    ],
59                                )
60                                .show_legend(false)
61                                .title("Metrics HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 0, 0))
81            ],
82        );
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
More examples
Hide additional examples
examples/v1_dashboards_CreateDashboard_3882428227.rs (line 58)
25async fn main() {
26    let body =
27        Dashboard::new(
28            DashboardLayoutType::ORDERED,
29            "Example-Dashboard".to_string(),
30            vec![
31                Widget::new(
32                    WidgetDefinition::DistributionWidgetDefinition(
33                        Box::new(
34                            DistributionWidgetDefinition::new(
35                                vec![
36                                    DistributionWidgetRequest::new()
37                                        .query(
38                                            DistributionWidgetHistogramRequestQuery
39                                            ::FormulaAndFunctionEventQueryDefinition(
40                                                Box::new(
41                                                    FormulaAndFunctionEventQueryDefinition::new(
42                                                        FormulaAndFunctionEventQueryDefinitionCompute::new(
43                                                            FormulaAndFunctionEventAggregation::MIN,
44                                                        ).metric("@duration".to_string()),
45                                                        FormulaAndFunctionEventsDataSource::EVENTS,
46                                                        "query1".to_string(),
47                                                    )
48                                                        .group_by(vec![])
49                                                        .indexes(vec!["*".to_string()])
50                                                        .search(
51                                                            FormulaAndFunctionEventQueryDefinitionSearch::new(
52                                                                "".to_string(),
53                                                            ),
54                                                        ),
55                                                ),
56                                            ),
57                                        )
58                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
59                                ],
60                                DistributionWidgetDefinitionType::DISTRIBUTION,
61                            )
62                                .show_legend(false)
63                                .title("Events Platform - Request latency HOP".to_string())
64                                .title_align(WidgetTextAlign::LEFT)
65                                .title_size("16".to_string())
66                                .xaxis(
67                                    DistributionWidgetXAxis::new()
68                                        .include_zero(true)
69                                        .max("auto".to_string())
70                                        .min("auto".to_string())
71                                        .scale("linear".to_string()),
72                                )
73                                .yaxis(
74                                    DistributionWidgetYAxis::new()
75                                        .include_zero(true)
76                                        .max("auto".to_string())
77                                        .min("auto".to_string())
78                                        .scale("linear".to_string()),
79                                ),
80                        ),
81                    ),
82                ).layout(WidgetLayout::new(2, 4, 0, 0))
83            ],
84        ).description(Some("Example-Dashboard".to_string()));
85    let configuration = datadog::Configuration::new();
86    let api = DashboardsAPI::with_config(configuration);
87    let resp = api.create_dashboard(body).await;
88    if let Ok(value) = resp {
89        println!("{:#?}", value);
90    } else {
91        println!("{:#?}", resp.unwrap_err());
92    }
93}
examples/v1_dashboards_CreateDashboard_1442588603.rs (line 55)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionApmResourceStatsQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionApmResourceStatsQueryDefinition::new(
41                                                        FormulaAndFunctionApmResourceStatsDataSource
42                                                        ::APM_RESOURCE_STATS,
43                                                        "staging".to_string(),
44                                                        "query1".to_string(),
45                                                        "azure-bill-import".to_string(),
46                                                        FormulaAndFunctionApmResourceStatName::LATENCY_DISTRIBUTION,
47                                                    )
48                                                        .group_by(vec!["resource_name".to_string()])
49                                                        .operation_name("universal.http.client".to_string())
50                                                        .primary_tag_name("datacenter".to_string())
51                                                        .primary_tag_value("*".to_string()),
52                                                ),
53                                            ),
54                                        )
55                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
56                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
57                                ],
58                                DistributionWidgetDefinitionType::DISTRIBUTION,
59                            )
60                                .show_legend(false)
61                                .title("APM Stats - Request latency HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 8, 0))
81            ],
82        ).description(Some("".to_string()));
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
Source

pub fn rum_query(self, value: LogQueryDefinition) -> Self

Source

pub fn security_query(self, value: LogQueryDefinition) -> Self

Source

pub fn style(self, value: WidgetStyle) -> Self

Examples found in repository?
examples/v1_dashboards_CreateDashboard_252716965.rs (line 49)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionMetricQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionMetricQueryDefinition::new(
41                                                        FormulaAndFunctionMetricDataSource::METRICS,
42                                                        "query1".to_string(),
43                                                        "histogram:trace.Load{*}".to_string(),
44                                                    ),
45                                                ),
46                                            ),
47                                        )
48                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
49                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
50                                ],
51                                DistributionWidgetDefinitionType::DISTRIBUTION,
52                            )
53                                .custom_links(
54                                    vec![
55                                        WidgetCustomLink::new()
56                                            .label("Example".to_string())
57                                            .link("https://example.org/".to_string())
58                                    ],
59                                )
60                                .show_legend(false)
61                                .title("Metrics HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 0, 0))
81            ],
82        );
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
More examples
Hide additional examples
examples/v1_dashboards_CreateDashboard_1442588603.rs (line 56)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionApmResourceStatsQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionApmResourceStatsQueryDefinition::new(
41                                                        FormulaAndFunctionApmResourceStatsDataSource
42                                                        ::APM_RESOURCE_STATS,
43                                                        "staging".to_string(),
44                                                        "query1".to_string(),
45                                                        "azure-bill-import".to_string(),
46                                                        FormulaAndFunctionApmResourceStatName::LATENCY_DISTRIBUTION,
47                                                    )
48                                                        .group_by(vec!["resource_name".to_string()])
49                                                        .operation_name("universal.http.client".to_string())
50                                                        .primary_tag_name("datacenter".to_string())
51                                                        .primary_tag_value("*".to_string()),
52                                                ),
53                                            ),
54                                        )
55                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
56                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
57                                ],
58                                DistributionWidgetDefinitionType::DISTRIBUTION,
59                            )
60                                .show_legend(false)
61                                .title("APM Stats - Request latency HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 8, 0))
81            ],
82        ).description(Some("".to_string()));
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
Source

pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self

Trait Implementations§

Source§

impl Clone for DistributionWidgetRequest

Source§

fn clone(&self) -> DistributionWidgetRequest

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DistributionWidgetRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DistributionWidgetRequest

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for DistributionWidgetRequest

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for DistributionWidgetRequest

Source§

fn eq(&self, other: &DistributionWidgetRequest) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for DistributionWidgetRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for DistributionWidgetRequest

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,