#[non_exhaustive]pub struct GetGraphSnapshotOptionalParams {
pub metric_query: Option<String>,
pub event_query: Option<String>,
pub graph_def: Option<String>,
pub title: Option<String>,
pub height: Option<i64>,
pub width: Option<i64>,
}
Expand description
GetGraphSnapshotOptionalParams is a struct for passing parameters to the method SnapshotsAPI::get_graph_snapshot
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.metric_query: Option<String>
The metric query.
event_query: Option<String>
A query that adds event bands to the graph.
graph_def: Option<String>
A JSON document defining the graph. graph_def
can be used instead of metric_query
.
The JSON document uses the grammar defined here
and should be formatted to a single line then URL encoded.
title: Option<String>
A title for the graph. If no title is specified, the graph does not have a title.
height: Option<i64>
The height of the graph. If no height is specified, the graph’s original height is used.
width: Option<i64>
The width of the graph. If no width is specified, the graph’s original width is used.
Implementations§
Source§impl GetGraphSnapshotOptionalParams
impl GetGraphSnapshotOptionalParams
Sourcepub fn metric_query(self, value: String) -> Self
pub fn metric_query(self, value: String) -> Self
The metric query.
Examples found in repository?
7async fn main() {
8 let configuration = datadog::Configuration::new();
9 let api = SnapshotsAPI::with_config(configuration);
10 let resp = api
11 .get_graph_snapshot(
12 1636542671,
13 1636629071,
14 GetGraphSnapshotOptionalParams::default()
15 .metric_query("avg:system.load.1{*}".to_string())
16 .title("System load".to_string())
17 .height(400)
18 .width(600),
19 )
20 .await;
21 if let Ok(value) = resp {
22 println!("{:#?}", value);
23 } else {
24 println!("{:#?}", resp.unwrap_err());
25 }
26}
Sourcepub fn event_query(self, value: String) -> Self
pub fn event_query(self, value: String) -> Self
A query that adds event bands to the graph.
Sourcepub fn graph_def(self, value: String) -> Self
pub fn graph_def(self, value: String) -> Self
A JSON document defining the graph. graph_def
can be used instead of metric_query
.
The JSON document uses the grammar defined here
and should be formatted to a single line then URL encoded.
Sourcepub fn title(self, value: String) -> Self
pub fn title(self, value: String) -> Self
A title for the graph. If no title is specified, the graph does not have a title.
Examples found in repository?
7async fn main() {
8 let configuration = datadog::Configuration::new();
9 let api = SnapshotsAPI::with_config(configuration);
10 let resp = api
11 .get_graph_snapshot(
12 1636542671,
13 1636629071,
14 GetGraphSnapshotOptionalParams::default()
15 .metric_query("avg:system.load.1{*}".to_string())
16 .title("System load".to_string())
17 .height(400)
18 .width(600),
19 )
20 .await;
21 if let Ok(value) = resp {
22 println!("{:#?}", value);
23 } else {
24 println!("{:#?}", resp.unwrap_err());
25 }
26}
Sourcepub fn height(self, value: i64) -> Self
pub fn height(self, value: i64) -> Self
The height of the graph. If no height is specified, the graph’s original height is used.
Examples found in repository?
7async fn main() {
8 let configuration = datadog::Configuration::new();
9 let api = SnapshotsAPI::with_config(configuration);
10 let resp = api
11 .get_graph_snapshot(
12 1636542671,
13 1636629071,
14 GetGraphSnapshotOptionalParams::default()
15 .metric_query("avg:system.load.1{*}".to_string())
16 .title("System load".to_string())
17 .height(400)
18 .width(600),
19 )
20 .await;
21 if let Ok(value) = resp {
22 println!("{:#?}", value);
23 } else {
24 println!("{:#?}", resp.unwrap_err());
25 }
26}
Sourcepub fn width(self, value: i64) -> Self
pub fn width(self, value: i64) -> Self
The width of the graph. If no width is specified, the graph’s original width is used.
Examples found in repository?
7async fn main() {
8 let configuration = datadog::Configuration::new();
9 let api = SnapshotsAPI::with_config(configuration);
10 let resp = api
11 .get_graph_snapshot(
12 1636542671,
13 1636629071,
14 GetGraphSnapshotOptionalParams::default()
15 .metric_query("avg:system.load.1{*}".to_string())
16 .title("System load".to_string())
17 .height(400)
18 .width(600),
19 )
20 .await;
21 if let Ok(value) = resp {
22 println!("{:#?}", value);
23 } else {
24 println!("{:#?}", resp.unwrap_err());
25 }
26}
Trait Implementations§
Source§impl Clone for GetGraphSnapshotOptionalParams
impl Clone for GetGraphSnapshotOptionalParams
Source§fn clone(&self) -> GetGraphSnapshotOptionalParams
fn clone(&self) -> GetGraphSnapshotOptionalParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more