Struct datadog_api_client::datadogV1::api::api_snapshots::SnapshotsAPI
source · pub struct SnapshotsAPI { /* private fields */ }Expand description
Take graph snapshots using the API.
Implementations§
source§impl SnapshotsAPI
impl SnapshotsAPI
pub fn new() -> Self
sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
examples/v1_snapshots_GetGraphSnapshot.rs (line 9)
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());
}
}pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
sourcepub async fn get_graph_snapshot(
&self,
start: i64,
end: i64,
params: GetGraphSnapshotOptionalParams,
) -> Result<GraphSnapshot, Error<GetGraphSnapshotError>>
pub async fn get_graph_snapshot( &self, start: i64, end: i64, params: GetGraphSnapshotOptionalParams, ) -> Result<GraphSnapshot, Error<GetGraphSnapshotError>>
Take graph snapshots. Note: When a snapshot is created, there is some delay before it is available.
Examples found in repository?
examples/v1_snapshots_GetGraphSnapshot.rs (lines 11-19)
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 async fn get_graph_snapshot_with_http_info(
&self,
start: i64,
end: i64,
params: GetGraphSnapshotOptionalParams,
) -> Result<ResponseContent<GraphSnapshot>, Error<GetGraphSnapshotError>>
pub async fn get_graph_snapshot_with_http_info( &self, start: i64, end: i64, params: GetGraphSnapshotOptionalParams, ) -> Result<ResponseContent<GraphSnapshot>, Error<GetGraphSnapshotError>>
Take graph snapshots. Note: When a snapshot is created, there is some delay before it is available.
Trait Implementations§
source§impl Clone for SnapshotsAPI
impl Clone for SnapshotsAPI
source§fn clone(&self) -> SnapshotsAPI
fn clone(&self) -> SnapshotsAPI
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for SnapshotsAPI
impl Debug for SnapshotsAPI
Auto Trait Implementations§
impl Freeze for SnapshotsAPI
impl !RefUnwindSafe for SnapshotsAPI
impl Send for SnapshotsAPI
impl Sync for SnapshotsAPI
impl Unpin for SnapshotsAPI
impl !UnwindSafe for SnapshotsAPI
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit)