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_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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more