icinga2_api/types/action.rs
1//! Helper types related to API Actions
2
3use serde::{Deserialize, Serialize};
4
5/// result of Action API calls
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct StatusResponse {
8 /// the HTTP status code, as a float because Icinga is strange
9 pub code: f64,
10 /// a textual status response
11 pub status: String,
12}
13
14/// result of the generate-ticket action API call
15#[derive(Debug, Clone, Serialize, Deserialize)]
16pub struct GenerateTicketResponse {
17 /// the HTTP status code, as a float because Icinga is strange
18 pub code: f64,
19 /// a textual status response
20 pub status: String,
21 /// in case of success the ticket generated
22 pub ticket: Option<String>,
23}
24
25/// result of the execute-command action API call
26#[derive(Debug, Clone, Serialize, Deserialize)]
27pub struct ExecuteCommandResponse {
28 /// the HTTP status code, as a float because Icinga is strange
29 pub code: f64,
30 /// a textual status response
31 pub status: String,
32 /// the checkable (host or service) on which the command is run
33 pub checkable: Option<String>,
34 /// the execution UUID
35 pub execution: Option<String>,
36}