Giter Site home page Giter Site logo

netconf-client's Introduction

Rust

netconf-client

Table of contents

About The Project

Rust NETCONF RFC6241 client with SSH secure connection support.

Features

  • 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>

Getting Started

Prerequisites

Use library in project

  • Rust
  • Cargo

Run integration tests from netconf-client library

  • Rust
  • Cargo
  • Docker

Setup

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" }

Examples

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.

Error handling

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.

Running integration tests

cargo test --test '*'

API documentation

https://rsitko92.github.io/netconf-client/netconf_client/

netconf-client's People

Contributors

r-sitko avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

snmpboy

netconf-client's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.