pub struct ServiceChecksAPI { /* private fields */ }
Expand description
The service check endpoint allows you to post check statuses for use with monitors. Service check messages are limited to 500 characters. If a check is posted with a message containing more than 500 characters, only the first 500 characters are displayed. Messages are limited for checks with a Critical or Warning status, they are dropped for checks with an OK status.
Implementations§
Source§impl ServiceChecksAPI
impl ServiceChecksAPI
pub fn new() -> Self
Sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
examples/v1_service-checks_SubmitServiceCheck.rs (line 16)
8async fn main() {
9 let body = vec![ServiceCheck::new(
10 "app.ok".to_string(),
11 "host".to_string(),
12 ServiceCheckStatus::OK,
13 vec!["test:ExampleServiceCheck".to_string()],
14 )];
15 let configuration = datadog::Configuration::new();
16 let api = ServiceChecksAPI::with_config(configuration);
17 let resp = api.submit_service_check(body).await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn submit_service_check(
&self,
body: Vec<ServiceCheck>,
) -> Result<IntakePayloadAccepted, Error<SubmitServiceCheckError>>
pub async fn submit_service_check( &self, body: Vec<ServiceCheck>, ) -> Result<IntakePayloadAccepted, Error<SubmitServiceCheckError>>
Submit a list of Service Checks.
Notes:
- A valid API key is required.
- Service checks can be submitted up to 10 minutes in the past.
Examples found in repository?
examples/v1_service-checks_SubmitServiceCheck.rs (line 17)
8async fn main() {
9 let body = vec![ServiceCheck::new(
10 "app.ok".to_string(),
11 "host".to_string(),
12 ServiceCheckStatus::OK,
13 vec!["test:ExampleServiceCheck".to_string()],
14 )];
15 let configuration = datadog::Configuration::new();
16 let api = ServiceChecksAPI::with_config(configuration);
17 let resp = api.submit_service_check(body).await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
Sourcepub async fn submit_service_check_with_http_info(
&self,
body: Vec<ServiceCheck>,
) -> Result<ResponseContent<IntakePayloadAccepted>, Error<SubmitServiceCheckError>>
pub async fn submit_service_check_with_http_info( &self, body: Vec<ServiceCheck>, ) -> Result<ResponseContent<IntakePayloadAccepted>, Error<SubmitServiceCheckError>>
Submit a list of Service Checks.
Notes:
- A valid API key is required.
- Service checks can be submitted up to 10 minutes in the past.
Trait Implementations§
Source§impl Clone for ServiceChecksAPI
impl Clone for ServiceChecksAPI
Source§fn clone(&self) -> ServiceChecksAPI
fn clone(&self) -> ServiceChecksAPI
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ServiceChecksAPI
impl Debug for ServiceChecksAPI
Auto Trait Implementations§
impl Freeze for ServiceChecksAPI
impl !RefUnwindSafe for ServiceChecksAPI
impl Send for ServiceChecksAPI
impl Sync for ServiceChecksAPI
impl Unpin for ServiceChecksAPI
impl !UnwindSafe for ServiceChecksAPI
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