- Table of contents
- About The Project
- Features
- Getting Started
- Running integration tests
- API documentation
Rust NETCONF RFC6241 client with SSH secure connection support.
- SSH connection
- Supported NETCONF messages:
- <hello>
- <get-config>
- <edit-config>
- <copy-config>
- <delete-config>
- <lock>
- <unlock>
- <get>
- <close-session>
- <kill-session>
- <discard-changes>
- <commit>
- Supported datastores:
- <running>
- <candidate>
- <startup>
- Rust
- Cargo
- Rust
- Cargo
- Docker
Add netconf-client git package to Cargo.toml dependencies section. This library is not available in crates.io.
Basing on latest commit from main branch:
[dependencies]
netconf-client = { git = "https://github.com/rsitko92/netconf-client.git" }
Basing on concrete commit:
[dependencies]
netconf-client = { git = "https://github.com/rsitko92/netconf-client.git", rev = "3f63491" }
All netconf-client API methods returns std::Result type. If client get successful response, std::Result with Ok(T) variant is returned, where T is a apriopriate NETCONF response type defined in replies module.
let mut client = NetconfClient::new(
"127.0.0.1",
830,
"root",
"root",
);
client.connect().unwrap();
client.send_hello().unwrap();
let rsp = client.get(None).unwrap();
println!("get response: {:?}", rsp.data);
More useful examples can be found in tests folder.
When error is encountered (for example: io error, SSH error, NETCONF response error) API methods return std::Result with Err(NetconfClientError) variant. NetconfClientError is an enum defined in errors module. User should check if methods return Err and react accordingly.
cargo test --test '*'