1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! An API client library for Mackerel
//!
//! [Mackerel](https://mackerel.io) is a performance monitoring and management tool of servers.
//! This monitoring SaaS provides you the intuitive user interfaces and useful APIs for automated infrastructure foundation.
//!
//! API documents: [Mackerel API Documents (v0)](https://mackerel.io/api-docs/)
//!
//! The official Go client library: [mackerel-client-go](https://github.com/mackerelio/mackerel-client-go)
//!
//! # Example
//!
//! ```rust,no_run,ignore
//! let client = Client::new("<Mackerel-API-KEY>");
//!
//! println!("{:?}", client.get_organization());
//! println!("{:?}", client.list_users());
//!
//! println!("{:?}", client.list_services());
//! println!("{:?}", client.list_service_metric_names("<Service-Name>"));
//!
//! println!("{:?}", client.list_monitors());
//! println!("{:?}", client.delete_monitor("<Monitor-ID>"));
//! ```
//!
extern crate serde;
#[macro_use]
extern crate serde_derive;
#[cfg_attr(test, macro_use)]
extern crate serde_json;

extern crate reqwest;
extern crate url;

#[macro_use]
extern crate error_chain;
pub mod errors {
    use reqwest;
    error_chain! {
        errors {
            ApiError(status: reqwest::StatusCode, message: String)
        }
    }
}

#[macro_use]
mod macros;

pub mod client;

pub mod alert;
pub mod authority;
pub mod channel;
pub mod dashboard;
pub mod graph_annotation;
pub mod host;
pub mod invitation;
pub mod metadata;
pub mod monitor;
pub mod organization;
pub mod role;
pub mod service;
pub mod user;
pub use client::Client;