#[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?
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
async fn main() {
let configuration = datadog::Configuration::new();
let api = SnapshotsAPI::with_config(configuration);
let resp = api
.get_graph_snapshot(
1636542671,
1636629071,
GetGraphSnapshotOptionalParams::default()
.metric_query("avg:system.load.1{*}".to_string())
.title("System load".to_string())
.height(400)
.width(600),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}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?
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
async fn main() {
let configuration = datadog::Configuration::new();
let api = SnapshotsAPI::with_config(configuration);
let resp = api
.get_graph_snapshot(
1636542671,
1636629071,
GetGraphSnapshotOptionalParams::default()
.metric_query("avg:system.load.1{*}".to_string())
.title("System load".to_string())
.height(400)
.width(600),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}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?
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
async fn main() {
let configuration = datadog::Configuration::new();
let api = SnapshotsAPI::with_config(configuration);
let resp = api
.get_graph_snapshot(
1636542671,
1636629071,
GetGraphSnapshotOptionalParams::default()
.metric_query("avg:system.load.1{*}".to_string())
.title("System load".to_string())
.height(400)
.width(600),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}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?
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
async fn main() {
let configuration = datadog::Configuration::new();
let api = SnapshotsAPI::with_config(configuration);
let resp = api
.get_graph_snapshot(
1636542671,
1636629071,
GetGraphSnapshotOptionalParams::default()
.metric_query("avg:system.load.1{*}".to_string())
.title("System load".to_string())
.height(400)
.width(600),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}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 moresource§impl Default for GetGraphSnapshotOptionalParams
impl Default for GetGraphSnapshotOptionalParams
source§fn default() -> GetGraphSnapshotOptionalParams
fn default() -> GetGraphSnapshotOptionalParams
Auto Trait Implementations§
impl Freeze for GetGraphSnapshotOptionalParams
impl RefUnwindSafe for GetGraphSnapshotOptionalParams
impl Send for GetGraphSnapshotOptionalParams
impl Sync for GetGraphSnapshotOptionalParams
impl Unpin for GetGraphSnapshotOptionalParams
impl UnwindSafe for GetGraphSnapshotOptionalParams
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)