• Stars
    star
    439
  • Rank 99,247 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An open-source Yang Browser and RPC Builder Application

Copyright 2015, Cisco Systems, Inc

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

END OF SUPPORT

As of 18th August 2020 this application is no longer maintained. Developers are free to use the code as-is, including forking, but no more updates will be forthcoming from the project maintainers and any new or outstanding issues will neither be tracked nor responded to.

For a potential alternative, see YANG Suite.

1. Description

An open-source Yang Browser and RPC Builder Application to experiment with Yang Data Models

Features

  • Upload / Compile yang models from User Interface Or Command Line
  • Build NetConf RPC
  • Generate Python example code [new]
  • Search yang xpaths [new]
  • Execute RPC against real netconf server
  • Save created RPCs to collections for later use
  • Build dependency graph for models
  • Browse data model tree and inspect yang properties

Restconf support is experimental

This application is under Beta mode, contributions / suggestions are welcome !!

Screenshots:

alt tag alt tag alt tag alt tag

2. Installation

2.1 First time installation

Prerequisite:

   If already installed, make sure that pip / setuptools are upto date (commands may vary)
   
   pip install --upgrade pip
   
   Ubuntu: sudo pip install --upgrade setuptools
  • virtualenv (recommended)
   Ubuntu: sudo apt-get install python-virtualenv
   Fedora: sudo dnf install python-virtualenv
   MAC: sudo pip install virtualenv
   Ubuntu: sudo apt-get install graphviz
   Fedora: sudo dnf install graphviz
   MAC: brew install graphviz
  • Browser with latest flash plugin (tested with google chrome)

Download and install:

   git clone https://github.com/CiscoDevNet/yang-explorer.git
   cd yang-explorer
   bash setup.sh

   Note: sudo may be required if you do not use virtualenv.

See section 7 Troubleshooting for more:

   If you get installation error for missing python.h or xmlversion.h try installing
   dependency packages:
   
   Ubuntu: sudo apt-get install libxml2-dev libxslt1-dev python-dev zlib1g-dev
   Fedora: sudo dnf install libxml2-devel libxslt-devel python-devel zlib-devel

2.2 Update exising installation

  cd <install-root>/yang-explorer
  git stash (if you have local changes)
  git pull origin
  git stash apply (if you have local changes)
  bash setup.sh

2.3 Backing up data

YangExplorer data can be backed up from data directory and it is portable to new servers -

   cp -r <install-root>/yang-explorer/server/data <backup-location>/data

Restore from backup location -

   cd <install-root>/yang-explorer/server

   # move current data to tmp location
   mv data data_old
   
   # replace data from backup location
   cp -r <backup-location>/data data

3. Running YangExplorer

3.1 Running with localhost

Start Server:

   cd <install-root>/yang-explorer
   [sudo] ./start.sh &

   Note: sudo may be required if you did not use virtualenv during installation.

Start Explorer:

   http://localhost:8088/static/YangExplorer.html

3.2 Running with ip-address (Shared server)

Start Server:

   # Determine <ip-address> using if-config
   
   # Add ip-address/port in YangExplorer.html after following line:
   cd <install-root>/yang-explorer/server/static
      vi YangExplorer.html
      var flashvars = {}; 
+     flashvars.host = '<ip-address>';
+     flashvars.port = '8088';

   # save & quit

   # Update ip-address in startup script
      cd <install-root>/yang-explorer
      vi start.sh
      (update HOST variable with <ip-address>)
   # save & quit
      
   ./start.sh

   Note: sudo may be required if you did not use virtualenv during installation.

Start Explorer:

   http://<ip-address>:8088/static/YangExplorer.html

4. Caveats

  • Yang Model upload fails, Workaround: Use Google Chrome.
  • See section 6 Troubleshooting for more:

5. User Guide (TBD)

5.1 Work Flow

5.2.1 Login:

YangExplorer uses user accounts to manage workspaces. You can create a user account using admin page (See 5.3.1 Creating User Account) or use the predefined login (guest/guest). You must login (click on the Login button on top right corner)

You can use guest login (guest/guest) or newly created account. alt tag

5.2.2 Adding/Deleing Yang Models:

Upload using yang-explorer user interface (TBD: screen shot is out-of-date)

alt tag

  • Click Manage Models tab
  • Click Workspace tab
  • Click Add button
    • Click Browse and select models to upload
    • Click Upload
    • Clear button can be used clear models in upload window
  • Click Subscribe & Un-subscribe buttons to make selected models visible/invisible in explorer area
  • Click Delete button to delete selected models from user account

Sync from Device

  • Click Manage Models tab
  • Click Device tab
    • Select a device from profile list
      • YangExplorer will list yang models on device
    • Select models to Sync to YangExplorer Workspace
    • Sync button to Sync Models to YangExplorer
    • You may encounter these error during sync:
      • Missing models: Select missing models from the list and try sync again
      • Duplicate models: In workspace tab, select duplicate models and delete
  • Click Workspace tab
  • Click Subscribe & Un-subscribe buttons to make selected models visible/invisible in explorer area
  • Click Delete button to delete selected models from user account

Upload models using server console

   cd <install-root>/yang-explorer
   source v/bin/activate
   cd server
   python manage.py --user <username> --git <git-url> --dir <path/to/yang/models>
   
   example: local upload (assumes models are already available at dir path)
   python manage.py bulkupload --user guest --dir /users/prgohite/git/yang/vendor/cisco/xr/531
   
   example: git upload
   python manage.py bulkupload --user guest --git https://github.com/YangModels/yang.git --dir vendor/cisco/xr/531

All models must be compiled successfully, in case of any error none of the models will be uploaded to yang-explorer.

5.2.3 Generating the model dependency graph:

  • Click Manage Models tab
  • Click Workspace tab
    • Select one or more model name to get dependency graph
    • If no models are selected, all subscribed model will be used to generate graph
  • Click Graph buttons to generate graph

5.2.4 Creating RPCs:

You can explore yang models in explorer area (left pane) using tree navigation: alt tag

  • Value and Operation columns in explorer area are editable.

  • Explore model in explorer area by navigating model tree

  • Click value cell next to data node (leaf, container etc)

  • Edit values

    • Select <get> and <get-config> for get, get-config netconf operations
    • Select <rpc> for RPCs
    • Enter data values for edit-config operation
    • Use Reset button on top-right bar to reset data in the model tree
  • Update netconf operations for edit-config (optional advance option)

![alt tag](https://github.com/CiscoDevNet/yang-explorer/blob/master/docs/images/netconf-operations.png)
  - Select **Operations** tab
  - Select error-option
  - Check / Uncheck lock option
  • Click RPC button under Build tab

5.2.5 Executing RPCs:

  • Create RPC using 5.2.4
  • Populate Device info in Device Settings Tab
  • Click Run button under Build tab

Yang Explorer uses ncclient library to execute RPCs, connection timeout can be configured via environment varible default timout value is 45 seconds.

   #update value in start.sh & restart server
   export NCCLIENT_TIMEOUT=120

5.2.6 Generating Python example:

  • Create a netconf / xml RPC - Create RPC using 5.2.4 - (OR) Provide custom netconf XML (Click custom RPC Checkbox)

  • Click Script button under Build tab

  • Click Copy button to copy generated code into system clipboard

  • Save content as a python script (say example.py)

  • Run python script from command line using given instruction in script header comments.

5.2.7 Saving RPCs to Collection:

  • Create RPC using 5.2.4
  • Click Save button under Build tab

5.2.8 Loading saved RPC:

  • Click Collections Tab
  • Double click on the RPCs title you want to load.

5.3 Admin Tasks

5.3.1 Creating User Account (optional):

Creating user account is optional as you can use default guest/guest login, however creating user account can be userful if you have a shared yang-explorer installation.

  • Click Admin button in YangExplorer
  • Login as admin (user: admin, password: admin)
  • On admin page, click Users link
  • On User Profiles page, click Add user link (top-right)
  • Add user account info and click Save (Warning: passwords are transmitted in plaintext)

5.3.2 Creating Device Profiles:

Device profiles can be created to quickly populate device info from drop-down list in yang-explorer.

Note: You can use default user login (guest/guest)

  • Click "Create device profile" link on Build -> Device Settings
  • (OR) Click "Create device profile" link on Manage Models -> Device
  • (OR) Click Admin button in YangExplorer
    • Login login as guest or your own login
    • On admin page, click Device profiles link
  • On User Profiles page, click Add device profiles link (top-right)
  • Add device credentials (device login info is not secured)
    • Add netconf credentials (Required for connecting to netconf server)
    • Add restconf credentials (Not used currently)
  • click Save

5.3.3 Creating Collection:

Collections can be used to save user generated RPCs on the server so that saved RPCs can be re-used.

Note: You can use default user login (guest/guest)

  • Click Admin button in YangExplorer
  • Login login as guest or your own login
  • On admin page, click Collections link
  • On User Profiles page, click Add collection link (top-right)
    • Provide collection name
    • Select User from drop-down box
    • Provide description for this collection
  • click Save

6 Misc Features

6.1 UI Model Tree annotations

Targeted content in YangExplorer UI tree can be annotated in different color, usually to represent additional information about of the Yang model node.

Installation:

  cd <install-root>/yang-explorer
  bash setup.sh -a <path to annotation json file>

Please refresh browser to reflect changes. You should see UI model tree node name in different color as per annotation file.

Uninstall:

  cd <install-root>/yang-explorer
  bash setup.sh -r

7 Troubleshooting

7.1 Installation

7.1.1 error for missing python.h or xmlversion.h

  • Ubuntu: sudo apt-get install libxml2-dev libxslt1-dev python-dev
  • Mac : xcode-select --install

7.1.2 django.db.utils.OperationalError: near "񐁂򐁇N": syntax error

7.1.3 After install if you are not able to login using guest/guest try one of the following

  • mv server/data/db.sqlite3 server/data/db.sqlite3_backup
  • bash setup.sh In end of setup.sh script log you should see something like this -
      ...
      Creating default users ..
      Copying default models ..
      Setup completed.. 
      
      Use start.sh to start yang-explorer server

7.1.4 Installation failed due to python 3 not supported

Python 3 is not supported by ncclient. Please install python 2.7 before proceeding futher. If python 2.7 is already installed on your system along with python 3, virtualenv may try to create python 3 environment. You can do following -

cd YangExplorer
rm -rf v

# find path to python 2.7 on your system~  which python2.7   
/usr/bin/python2.7

# create a virtualenv with python 2.7, path may differ based on your installation
virtualenv -p /usr/bin/python2.7 v

# rerun setup
setup.sh

7.2 Yang Model Upload

7.2.1 Failure during upload of yang model

  • Chrome browser is required currently to upload models using User Interface
  • Please see failure message, if dependent models are missing you will see specific error in message window.

More Repositories

1

netprog_basics

Code, Examples, and Resources for the Network Programmability Basics Video Course
Python
738
star
2

python_code_samples_network

A collection of Python Code Samples for Network Management. Includes samples to run on-box and off-box.
Python
609
star
3

awesome-webex

A curated list of Cisco Webex resources for developers
239
star
4

yangsuite

Cisco YANG Suite provides a set of tools and plugins to learn, test, and adopt YANG programmable interfaces such as NETCONF, RESTCONF, gNMI and more.
Shell
237
star
5

coding-skills-sample-code

Sample code for the Cisco DevNet Coding Skills Learning Labs
Python
220
star
6

cml-community

Community Contributed Content and Resources for Cisco Modeling Labs
Shell
188
star
7

ydk-py

This project has been archived and the repository will no longer be updated. Python SDK generated from YANG data models.
Python
184
star
8

roomdevices-macros-samples

Macros samples for Cisco CE Video Endpoints
JavaScript
166
star
9

bigmuddy-network-telemetry-pipeline

bigmuddy-network-telemetry-pipeline
162
star
10

dne-dna-code

Provides code examples for DevNet Test Drive Catalyst (DNA) series
Python
161
star
11

virlutils

A collection of utilities for interacting with Cisco VIRL / Cisco Modeling Labs (CML)
Python
151
star
12

ansible-aci

Cisco ACI Ansible Collection
Python
138
star
13

ydk-gen

Generate model-driven APIs from YANG models
C++
134
star
14

CiscoUIKit

The Cisco Brand-approved user interface kit. A modern, lightweight, responsive and programmable presentation layer that can be used to style HTML primitive elements and UI-framework independent.
CSS
125
star
15

api-design-guide

Guidelines for designing REST APIs at Cisco
109
star
16

ydk-py-samples

Sample apps for YDK-Py
Python
101
star
17

python-viptela

Cisco Viptela vManage Python CLI/SDK
Python
96
star
18

pathman-sr

Pathman SR is an open-source app to compute paths and deploy routes in Segment Routing-enabled network.
Python
96
star
19

terraform-provider-aci

Terraform Cisco ACI provider
Go
88
star
20

finesse-sample-code

Sample Gadgets and code for use with Finesse
83
star
21

pyats-sample-scripts

Various pyATS-based Test Automation Scripts
Python
82
star
22

sdwan-devops

SD-WAN DevOps Tools
Jinja
79
star
23

Getting-started-with-Cisco-SD-WAN-REST-APIs

Getting started with Cisco SD-WAN REST APIs
Python
72
star
24

cvd-config-templates

Contains Cisco Validated Design (CVD) Configuration Management Templates
Python
69
star
25

OpenDaylight-Openflow-App

JavaScript
68
star
26

ncc

ncclient scripts and helpers
Jupyter Notebook
67
star
27

sastre

Cisco-SDWAN Automation Toolset
Python
67
star
28

awesome-xapi

A curated list of developer resources to integrate with Webex Devices
63
star
29

meraki-code

Code for All Meraki Labs
Python
63
star
30

netconf-examples

NETCONF examples for learning labs
Python
61
star
31

axl-python-zeep-samples

Python
61
star
32

opendaylight-sample-apps

Sample applications for use with OpenDaylight (https://www.opendaylight.org/)
HTML
59
star
33

cloud-security

Python
57
star
34

postman-xapi

Postman collections for Webex Devices
57
star
35

ansible-meraki

Cisco Meraki Ansible Collection
Python
57
star
36

virl2-client

Client library for the Cisco VIRL 2 Network Simulation Platform
Python
57
star
37

terraform-provider-iosxe

Terraform Cisco IOS-XE Provider
Go
56
star
38

apic-em-samples-aradford

This is a collection of sample scripts and tools for APIC-EM
Python
53
star
39

appdynamics-docker-images

Build repository for AppDynamics certified Docker Store images
Dockerfile
53
star
40

devasc-code-examples

Provides the example Python and Ansible code and dependencies configuration for the Cisco DevNet Associate Fundamentals course.
Python
50
star
41

bigmuddy-network-telemetry-stacks

A batteries-included docker-based collection of demo stacks adapting network streaming telemetry to common consumer formats.
49
star
42

devnet-express-code-samples

Archived: This repository holds code samples for DevNet Express DNA Track
JavaScript
47
star
43

ansible-pyats

Python
46
star
44

botkit-template

Botkit template for Webex Teams
JavaScript
46
star
45

pyats-coding-101

pyATS Coding 101 - Python & automation tutorial
Python
46
star
46

restconf-examples

RESTconf examples for learning labs and sample code
Python
45
star
47

uniq

A Python API client library for Cisco's Application Policy Infrastructure Controller Enterprise Module (APIC-EM) Northbound APIs.
Python
45
star
48

xapi-samples

Examples of UI Extensions, Macros and Node.js scripts for Webex devices and Cisco Collaboration Endpoints
HTML
45
star
49

botkit-webex-samples

Chatbot samples for Webex Teams built with Botkit
JavaScript
45
star
50

bigmuddy-network-telemetry-collector

44
star
51

NeXt

Mirror of the OpenDaylight NeXt UI Toolkit gerrit project
JavaScript
44
star
52

merakibeat

Elastic Beat input plugin for Meraki health and location metrics collection
Python
41
star
53

catalyst9k-network-automation

Sample python scripts for automation workflows for feature sets present in Catalyst Switching using openly available YANG data models
Python
40
star
54

aci-learning-labs-code-samples

JavaScript
39
star
55

netdevops-live-0213

Sample Scripts from NETDEVOPS LIVE! S02E13 - Container Networking
Shell
39
star
56

BRKDEV-1368

Code used for the Cisco Live Session BRKDEV-1368
HTML
38
star
57

FTDAnsible

FTD Ansible module
Python
37
star
58

NX-SDK

NX-OS SDK
C++
37
star
59

g2p_seq2seq_pytorch

Grapheme to phoneme model for PyTorch
Python
37
star
60

ansible-dcnm

Python
37
star
61

Opendaylight-BGP-Pathman-apps

BGP and PCEP apps for Opendaylight, with the backend written in Python and the UI in JavaScript for NeXt
Python
37
star
62

DNAC-AURA

Python
36
star
63

code-exchange-repo-template

Template for creating a repo for software related to Cisco technologies to be shared with the DevNet community via Code Exchange
35
star
64

grpc-getting-started

Guide to get started with gRPC in Cisco IOS XR
Protocol Buffer
35
star
65

wcae

WCAE Troubleshooting tool
34
star
66

ppe-detection

Python
33
star
67

catalystwan

Cisco Catalyst WAN SDK
Python
32
star
68

dne-security-code

Python
32
star
69

sd-wan-ansible-pipeline-code

SD-WAN Ansible CI/CD pipeline Code
Python
31
star
70

fmc-rest-api

Learning labs for firepower management center REST APIs
HTML
30
star
71

ciscodevnet.github.io

Source for https://ciscodevnet.github.io
JavaScript
30
star
72

thousandeyes-kubernetes-operator

A Kubernetes operator to manage ThousandEyes tests
Go
30
star
73

secure-firewall

This is a place for various teamplates and automation resources for Cisco Secure Firewall
HCL
30
star
74

openconfig-getting-started

Getting started guides for OpenConfig in Cisco IOS XR
30
star
75

awesome-merakiapis

Collection point for all the awesome Meraki APIs.
29
star
76

DNAC-onboarding-tools

Cisco DNA Center PnP-BulkConfig app allows uploading of "predefined" rules to onboard network devices.
Python
28
star
77

iOAM

Java
28
star
78

Postman-for-Cisco-SD-WAN

Postman environment and collection for Cisco SD-WAN powered by Viptela
28
star
79

ContainerLabs

JavaScript
28
star
80

Hyperflex-Hypercheck

Perform pro-active self checks on your Hyperflex cluster to ensure stability and resiliency
Python
26
star
81

DNAC-Top5

Simple scripts to get started with Cisco DNA Center API.
Python
26
star
82

pyats-ios-sample

pyATS Example script for Cisco IOS Testbed
Python
25
star
83

ansible-mso

Cisco MSO Ansible Collection
Python
25
star
84

webex-contact-center-widget-starter

WebEx Contact Center widget starter
JavaScript
25
star
85

uccx-sample-code

Sample code for use with Unified Contact Center Express
Java
24
star
86

node-sparkbot

Build Webex ChatBots in JavaScript
JavaScript
24
star
87

devnet-express-cloud-collab-code-samples

Public repo that contains code samples for the DevNet Express Cloud Collaboration tracks
JavaScript
24
star
88

socialminer-sample-code

Sample code using Cisco SocialMiner APIs
JavaScript
23
star
89

webex-integration-sample

Node.js example of OAuth Integration for Webex Teams
JavaScript
23
star
90

webex-meetings-python-samples

This project contains sample scripts demonstrating usage of the Webex Meetings API, using Python
Python
23
star
91

ydk-go

This project has been archived and the repository will no longer be updated. Go SDK generated from YANG data models.
Go
23
star
92

bigmuddy-network-telemetry-proto

22
star
93

ansible-viptela

An Ansible Role for automating a Viptela Overlay Network
Python
22
star
94

iPSK-Manager

Identity PSK (IPSK) Manager for Cisco ISE provides an example of how to manage the full Life Cycle of Wi-Fi Pre Shared Keys for supported Hardware/Software through Cisco ISE.
PHP
22
star
95

logstash-codec-bigmuddy-network-telemetry-gpb

Logstash codec used to receive protobuf encoded network telemetry over UDP and produce logstash events.
22
star
96

dnac-apis-with-python-sample-codes

Python code to go with DNAC learning labs
Python
21
star
97

appdynamics-charts

Helm charts for AppDynamics
Mustache
21
star
98

node-sparkbot-samples

Chatbot samples leveraging the node-sparkbot library for Webex Teams
JavaScript
21
star
99

DNAC-TemplateProgrammer

Python
20
star
100

terraform-sdwan

HCL
20
star