• Stars
    star
    237
  • Rank 169,885 (Top 4 %)
  • Language
    Shell
  • License
    Other
  • Created about 4 years ago
  • Updated 2 months ago

Reviews

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

Repository Details

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.

Copyright 2022 Cisco Systems, Inc

Cisco YANG Suite

YANG Suite core Django application.

Capable of dynamic discovery of installed application plugins. Provides common library APIs for logging, filesystem access, GUI appearance and behavior, and client-server communication.

  • Authors: Members of the Cisco YANG Suite development team.
  • Supports: Python 3.6, Python 3.7, and Python 3.8

YANG Suite can be installed as a Docker container or through Python package management. Docker-compose is the recommended install.

YANG Suite requires about 3.5GB of memory to load large Cisco native models.

YANG Suite Resources

DevNet YANG Suite landing page: developer.cisco.com/yangsuite

Documentation: developer.cisco.com/docs/yangsuite

YANG Suite TDM PDF

This PDF document has technical details of all capabilites of the YANG Suite tool, including installation, setup, and use of all plugins and features. It is a very detailed document that can be refered to for using the tool and examples for each plugin.

YANG Suite Installation: Docker or PIP? You decide

Feature Docker PIP (Python version 3.8)
Prerequisites Install docker & docker compose Install Python & PIP
Security HTTPS HTTP
YS GUI Ports 80 forwarded to 8443 8480 directly (no exposed ports)
Telemetry Ports 57344 - 57345 Any unused & unprivileged TCP port

Prerequisites for Docker

To use the resources in this repository, you must install Docker on the system where you want to run YANG Suite. In addition, since this YANG Suite repository uses Docker Compose, your system needs Docker Compose. Docker Desktop for Mac and Docker Desktop for Windows installations include Compose and you can install those using instructions at https://docs.docker.com/install. For Linux, follow these specific instructions to install Docker Compose on Linux systems.

Quick Start with Docker:

  1. Clone this repository

  2. Run start_yang_suite.sh or,

  3. Run docker compose up if you have already ran the start_yang_suite.sh

  4. Access the tool at http://localhost or https://localhost:8443

git clone https://github.com/CiscoDevNet/yangsuite
cd yangsuite/docker/ ; bash ./start_yang_suite.sh
    or
cd yangsuite/docker/ ; docker compose up
    or
cd yangsuite/docker/ ; docker-compose up

The output should look similar to the image below:

The start_yang_suite.sh will ask to set the username, password, e-mail address, and for the certificate details. The output will look similar to the below, be sure to enter certificate details in the red hilight area:

Once YANG Suite is ready for use the following will be seen:

Now you can access the YANG Suite at http://localhost

Docker-based YANG Suite Installation

The yangsuite/docker/start_yang_suite.sh script performs the following:

  • Prompts for username, password, and email which will be the superuser to yangsuite.
  • Gives the choice of creating test SSL/TLS certificate and key.
  • Creates an environment file needed for the yangsuite docker container install.
  • Runs docker-compose up.

Self-signed Certificate for testing

The SSL/TLS certificates installed with the nginx container should be obtained or generated using a trusted certificate authority. As a convenience, the yangsuite/docker/start_yang_suite.sh script will generate a self-signed certificate/key to get you going quickly.

WARNING: Official SSL/TLS certificate/key should be obtained and copied to yangsuite/docker/nginx directory rather than using the test SSL/TLS certificate/key generated by the start_yang_suite.sh script.

Customization

The yangsuite/docker/yangsuite/production.py file contains Django settings. The possible settings are extensive and information can found at https://www.djangoproject.com/.

Adding/Updating plugins can be done through the Admin-->Manage plugins page or by copying the plugin wheels into the yangsuite/docker/yangsuite/ directory, uncomment the appropriate lines in the yangsuite/docker/yangsuite/dockerfile, and run:

docker-compose up --build

Access YANG Suite Docker Install with web browser

  • The nginx container redirects port 80 to port 8443 which is used to interface with the yangsuite core. Connect to http://localhost or https://localhost:8443. NOTE: A complaint about the certificate will appear if it was generated using "start_yang_suite.sh".
  • The yangsuite-restconf plugin uses port 443 to communicate to your Cisco device so enable RESTCONF in the YANG Suite Device profile page for devices that support that protocol.
  • If port 8443 is not available for use on the server, change the port number in the docker-compose.yml file and the nginx.conf file.
  • If port 443 is not available for use on the server, change the port number in the docker-compose.yml file, configure the new RESTCONF port on the Cisco device, and configure the correct RESTCONF port in the YANG Suite Device profile.
  • Login using username set during install.

Quick Start with PIP Install on MacOS

We recommend installing Homebrew to manage the Python installation on your mac.

Refer to the HomeBrew website for details on how to install HomeBrew on your Mac, or, follow the command below to install HomeBrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Use brew to install pyenv

brew install pyenv

Once pyenv is installed, install Python version 3.8

pyenv install 3.8

Now that the correct and YANG Suite-supported version of Python 3.8 is installed, create and activate the virtual environment

~/.pyenv/versions/3.8.12/bin/python -m venv yangsuitevenv
source yangsuiteenv/bin/activate

Next, install the YANG Suite tool within the virutal evnrionment using pip:

pip install pip wheel setuptools --upgrade
pip install yangsuite

Now that YANG Suite is installed, it can be started up. The credentials and settings will be configured on the first run:

yangsuite

Once started the tool can be access on the default port http://localhost:8480

See a full example of installing pre-requisites and configuring YANG Suite below:

PIP install using Linux in Windows

NOTE For Linux to run YANG Suite, a virtual environment is required

Here is an example installation flow on a Windows machine using Ubuntu 20.04 on Windows Subsystem Linux (WSL)

Install Ubuntu 20.04

wsl --install Ubuntu-20.04

Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: user
New password:
Retype new password:
passwd: password updated successfully
Installation successful!
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.15.79.1-microsoft-standard-WSL2 x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Tue Jan 10 15:53:15 PST 2023

  System load:  0.22                Processes:             9
  Usage of /:   0.1% of 1006.85GB   Users logged in:       0
  Memory usage: 14%                 IPv4 address for eth0: 172.28.133.196
  Swap usage:   0%

1 update can be applied immediately.
To see these additional updates run: apt list --upgradable


The list of available updates is more than a week old.
To check for new updates run: sudo apt update


This message is shown once a day. To disable it please create the
/home/user/.hushlogin file.

Ensure DNS is set up properly

wsl -s Ubuntu-20.04
wsl
cat /etc/resolv.conf

Validate python3 already part of Ubuntu-20.04 image

sudo apt update
sudo apt upgrade
which python3

Install python3 packages

sudo apt install python3-pip python3-lxml python3-venv		

Install yangsuite prerequisites for Ubuntu

sudo apt install git openssh-client iputils-ping sqlite3 snmp

Create a new directory and virtual environment

mkdir testing
cd testing
mkdir yangsuite
cd yangsuite

Set Up YANG Suite with setup_yangsuite.sh. Note: Skip docker install and move forward with pip installation method instead

sudo ./setup_yangsuite.sh
SKIP													
python3 -m venv .venv											
source .venv/bin/activate
pip install -U pip setuptools wheel
pip install yangsuite

Install yangsuite plugins

pip install yangsuite-restconf yangsuite-coverage yangsuite-gnmi yangsuite-grpc-telemetry		
pip freeze > requirements.txt

Run yangsuite. When doing this for the first time, setup script stored to yangsuite.ini for future runs, see detailed output below

yangsuite											

**********************************************************************
Entering interactive configuration mode
**********************************************************************
YANG Suite stores user specific data (YANG modules, device profiles, etc.)
Set new path or use: [] /home/user/testing/yangsuite
What port number should YANG Suite listen on? [8480]
**********************************************************************
YANG Suite can be accessed remotely over the network.
**********************************************************************
Allow remote access? [n] y
**********************************************************************
Define hosts/IPs that YANG Suite will accept connections as.
Examples:
        CSCO-W-PF392JHY.cisco.com
        127.0.0.1
        CSCO-W-PF392JHY
        127.0.1.1
If the IP is not routable and you are behind NAT, use the public NAT address.
**********************************************************************
Enter a hostname, FQDN, or address [127.0.0.1]
Entries so far: ['0.0.0.0']
Add another entry? [n]
**********************************************************************
Interactive configuration complete
**********************************************************************
Save this configuration to
/home/user/.config/yangsuite/yangsuite.ini
so YANG Suite can automatically use it next time you start YANG Suite? [y]
**********************************************************************
Updating YANG Suite preferences file (/home/user/.config/yangsuite/yangsuite.ini)
**********************************************************************
2023-01-10 16:32:42,140 - yangsuite.ysgnmi.gnmi: WARNING: Install yangsuite-testmanager for opfield verification
2023-01-10 16:32:42,211 - yangsuite.paths: INFO: Creating new 'filename' directory path /home/user/testing/yangsuite/logs/
Removing database for upgrade.
No changes detected in app 'yscoverage'
No changes detected in app 'yangsuite'
No changes detected in app 'ysdevices'
No changes detected in app 'ysgnmi'
No changes detected in app 'ysrestconf'
Migrations for 'ysyangtree':
  .venv/lib/python3.8/site-packages/ysyangtree/migrations/0001_initial.py
    - Create model YangSetJSON
    - Create model YangSetTree
No changes detected in app 'ysnetconf'
No changes detected in app 'ysfilemanager'
No changes detected in app 'ysgrpctelemetry'
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, django_registration, sessions, ysyangtree
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying admin.0003_logentry_add_action_flag_choices... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying auth.0009_alter_user_last_name_max_length... OK
  Applying auth.0010_alter_group_name_max_length... OK
  Applying auth.0011_update_proxy_permissions... OK
  Applying django_registration.0001_initial... OK
  Applying sessions.0001_initial... OK
  Applying ysyangtree.0001_initial... OK
**********************************************************************
Creating static storage directory /home/user/.local/share/yangsuite/static
**********************************************************************

884 static files copied to '/home/user/.local/share/yangsuite/static'.
**********************************************************************
Your input is required to define an admin user
**********************************************************************
Username (leave blank to use 'user'): admin							
Email address: [email protected]
Password:
Password (again):
The password is too similar to the username.
This password is too short. It must contain at least 8 characters.
This password is too common.
Bypass password validation and create user anyway? [y/N]: y
Superuser created successfully.
**********************************************************************
YANG Suite data is stored at /home/user/testing/yangsuite. Be sure to back up this directory!
**********************************************************************
Performing system checks...

System check identified no issues (0 silenced).
January 11, 2023 - 00:34:02
Django version 2.2.28, using settings 'yangsuite.settings.production'
Starting development server at http://0.0.0.0:8480/
Quit the server with CONTROL-C.

Re-configuring yangsuite Server

  • Activate the virtual environment
  • Type yangsuite -h

Create an automated test environment using PyATS

See the PyATS Docs: https://developer.cisco.com/docs/pyats-getting-started/

Pre Release Versions

Manually specify pre-release version when using pip like in the example below to access the pre release and bug fix versions of yang suite and plugins:

docker container exec -it <yangsuite container ID> bash
pip install --upgrade --pre yangsuite-devices
exit

pip
source <your yangsuite venv>/bin/activate
pip install --upgrade --pre yangsuite-devices

Update all Plugins to Latest Release

pip3 install --upgrade yangsuite yangsuite-devices yangsuite-filemanager yangsuite-yangtree yangsuite-coverage yangsuite-gnmi yangsuite-grpc-telemetry yangsuite-netconf yangsuite-restconf

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

yang-explorer

An open-source Yang Browser and RPC Builder Application
Python
439
star
4

awesome-webex

A curated list of Cisco Webex resources for developers
239
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