Expand description
the runtime object for an Icinga2 instance (blocking variant)
Fields
url: Url
the base URL for the Icinga API
username: String
username
Implementations
sourceimpl Icinga2
impl Icinga2
sourcepub fn from_instance_config(config: &Icinga2Instance) -> Result<Self, Error>
pub fn from_instance_config(config: &Icinga2Instance) -> Result<Self, Error>
create a new Icinga2 instance from a config that was either manually created or previously loaded via Icinga2Instance::from_config_file
Errors
this fails if the CA certificate file mentioned in the configuration can not be found or parsed
sourcepub fn from_config_file(path: &Path) -> Result<Self, Error>
pub fn from_config_file(path: &Path) -> Result<Self, Error>
create a new Icinga2 instance from a TOML config file
Errors
this fails if the configuration file can not be found or parsed or the CA certificate file mentioned in the configuration file can not be found or parsed
sourcepub fn rest<ApiEndpoint, Res>(
&self,
api_endpoint: ApiEndpoint
) -> Result<Res, Error>where
ApiEndpoint: RestApiEndpoint,
<ApiEndpoint as RestApiEndpoint>::RequestBody: Clone + Serialize + Debug,
Res: DeserializeOwned + Debug + RestApiResponse<ApiEndpoint>,
pub fn rest<ApiEndpoint, Res>(
&self,
api_endpoint: ApiEndpoint
) -> Result<Res, Error>where
ApiEndpoint: RestApiEndpoint,
<ApiEndpoint as RestApiEndpoint>::RequestBody: Clone + Serialize + Debug,
Res: DeserializeOwned + Debug + RestApiResponse<ApiEndpoint>,
common code for the REST API calls
Errors
this returns an error if encoding, the actual request, or decoding of the response fail
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Icinga2
impl Send for Icinga2
impl Sync for Icinga2
impl Unpin for Icinga2
impl !UnwindSafe for Icinga2
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more