Struct mackerel_client::client::Client
[−]
[src]
pub struct Client { /* fields omitted */ }
Represents an API client for Mackerel.
Methods
impl Client
[src]
fn new(api_key: &str) -> Client
Creates a new API client from API key.
fn new_with_api_base(api_key: &str, api_base: &str) -> Client
Creates a new API client from API key and API base.
fn request<P, B, R, F, S>(&self,
method: Method,
path: P,
queries: Vec<(&str, Vec<&str>)>,
body_opt: Option<B>,
converter: F)
-> Result<S> where P: AsRef<str>, B: Serialize, R: Deserialize, F: FnOnce(R) -> S
method: Method,
path: P,
queries: Vec<(&str, Vec<&str>)>,
body_opt: Option<B>,
converter: F)
-> Result<S> where P: AsRef<str>, B: Serialize, R: Deserialize, F: FnOnce(R) -> S
Sends a request to the API.
The entire response body is deserialized as R
, converted by converter
and returns S
.
impl Client
[src]
fn list_alerts(&self) -> Result<Vec<Alert>>
Fetches all the open alerts.
fn close_alert(&self, alert_id: String, reason: &str) -> Result<Alert>
Closes the specified alert.
impl Client
[src]
fn list_monitors(&self) -> Result<Vec<Monitor>>
Fetches all the open monitors.
fn create_monitor(&self, monitor: Monitor) -> Result<Monitor>
Registers a new monitor.
fn update_monitor(&self, monitor: Monitor) -> Result<Monitor>
Updates a monitor.
fn delete_monitor(&self, monitor_id: String) -> Result<Monitor>
Deletes a monitor.
impl Client
[src]
fn get_organization(&self) -> Result<Organization>
Retrieve the information on the organization.
impl Client
[src]
fn list_roles(&self, service_name: &str) -> Result<Vec<Role>>
Fetches the roles in the specified service.
impl Client
[src]
fn list_services(&self) -> Result<Vec<Service>>
Fetches all the services.
fn list_service_metric_names(&self, service_name: &str) -> Result<Vec<String>>
Fetches the names of the service metrics.
See https://mackerel.io/api-docs/entry/services#metric-names.
impl Client
[src]
fn list_users(&self) -> Result<Vec<User>>
Fetches all the services.
fn delete_user(&self, user_name: &str) -> Result<User>
Delete the user from the organization.