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)
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}
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. Snapshots are PNG images generated by rendering a specified widget in a web page and capturing it once the data is available. The image is then uploaded to cloud storage.
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)
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 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. Snapshots are PNG images generated by rendering a specified widget in a web page and capturing it once the data is available. The image is then uploaded to cloud storage.
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 duplicate 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