GithubHelp home page GithubHelp logo

go-ez's Introduction

Introduction

go client library for JUNOS Automation

FEATURES

Junos GoEZ is designed to provide the same capabilities as a user would have on the Junos CLI, but in an environment built for automation tasks. These capabilities include, but are not limited to:

. Remote connectivity and management of Junos devices via NETCONF and REST API's

. Retrieve "operational" or "run-state" information

. Retrieve configuration information

. Make configuration changes in unstructured and structured ways (Supports 'json'/'xml'/'set'/'text' format)

INSTALLATION

Installing from Git is also supported (OS must have git installed). . go get github.com/Juniper/go-ez/eznc (Or) . git clone https://github.com/Juniper/go-ez.git (Use Git or checkout with SVN using the web URL)

HELLO WORLD

The following is a quick "hello, world" example to ensure that the software was installed correctly. This code will simply connect to a device and display the netconf capabilities of the device.

package main

import (

"fmt"

"github.com/Juniper/go-ez/eznc"

)

func main() {

username := "jnpr"
password := "jnpr123"
hostname := "my_host_or_ipaddr"

s, err := eznc.Device(hostname, username, password) 
if err != nil {
    panic(err)
}

defer s.Close()

fmt.Printf("Server Capabilities: '%+v'\n", s.ServerCapabilities)
fmt.Printf("Session Id: %d\n\n", s.SessionID)

}

Example output for an VMX device:

$ go run capabilities.go Server Capabilities: '[urn:ietf:params:netconf:base:1.0 urn:ietf:params:netconf:capability:candidate:1.0 urn:ietf:params:netconf:capability:confirmed-commit:1.0 urn:ietf:params:netconf:capability:validate:1.0 urn:ietf:params:netconf:capability:url:1.0?scheme=http,ftp,file urn:ietf:params:xml:ns:netconf:base:1.0 urn:ietf:params:xml:ns:netconf:capability:candidate:1.0 urn:ietf:params:xml:ns:netconf:capability:confirmed-commit:1.0 urn:ietf:params:xml:ns:netconf:capability:validate:1.0 urn:ietf:params:xml:ns:netconf:capability:url:1.0?protocol=http,ftp,file http://xml.juniper.net/netconf/junos/1.0 http://xml.juniper.net/dmi/system/1.0]'

Session Id: 11969

LICENSE

BSD 2-Clause License

go-ez's People

Contributors

ashwinak avatar

Watchers

 avatar

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.