cp_api 0.4.0

Check Point API library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use cp_api::Client;

#[test]
fn show_hosts() {
    let mut client = Client::new("172.25.199.80", 443);
    client.accept_invalid_certs(true);
    client.login("cp_api", "vpn123").unwrap();

    println!("Querying all hosts...");

    let hosts = client.query("show-hosts", "standard").unwrap();

    for host in &hosts.objects {
        println!("{} - {}", host["name"], host["ipv4-address"]);
    }

    hosts.save_objects("hosts.log").unwrap();
}