pub async fn rules(
    host: &str,
    rule_type: Option<RuleType>
) -> Result<Vec<RuleGroup>, Error>
Expand description

Retrieve a list of rule groups of recording and alerting rules.

This is just a convenience function for one-off requests, see Client::rules.

use prometheus_http_query::{rules, Error, RuleType};

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Error> {
    let response = rules("http://localhost:9090", Some(RuleType::Alert)).await;

    assert!(response.is_ok());

    Ok(())
}