#[non_exhaustive]pub struct ServiceCheck {
pub check: String,
pub host_name: String,
pub message: Option<String>,
pub status: ServiceCheckStatus,
pub tags: Vec<String>,
pub timestamp: Option<i64>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
An object containing service check and status.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.check: String
The check.
host_name: String
The host name correlated with the check.
message: Option<String>
Message containing check status.
status: ServiceCheckStatus
The status of a service check. Set to 0
for OK, 1
for warning, 2
for critical, and 3
for unknown.
Tags related to a check.
timestamp: Option<i64>
Time of check.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl ServiceCheck
impl ServiceCheck
Sourcepub fn new(
check: String,
host_name: String,
status: ServiceCheckStatus,
tags: Vec<String>,
) -> ServiceCheck
pub fn new( check: String, host_name: String, status: ServiceCheckStatus, tags: Vec<String>, ) -> ServiceCheck
Examples found in repository?
examples/v1_service-checks_SubmitServiceCheck.rs (lines 9-14)
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 message(self, value: String) -> Self
pub fn timestamp(self, value: i64) -> Self
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for ServiceCheck
impl Clone for ServiceCheck
Source§fn clone(&self) -> ServiceCheck
fn clone(&self) -> ServiceCheck
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 ServiceCheck
impl Debug for ServiceCheck
Source§impl<'de> Deserialize<'de> for ServiceCheck
impl<'de> Deserialize<'de> for ServiceCheck
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ServiceCheck
impl PartialEq for ServiceCheck
Source§impl Serialize for ServiceCheck
impl Serialize for ServiceCheck
impl StructuralPartialEq for ServiceCheck
Auto Trait Implementations§
impl Freeze for ServiceCheck
impl RefUnwindSafe for ServiceCheck
impl Send for ServiceCheck
impl Sync for ServiceCheck
impl Unpin for ServiceCheck
impl UnwindSafe for ServiceCheck
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