Back to Learn

Network Programmability Basics (Cisco DevNet)

The official code and labs for Cisco DevNet's Network Programmability Basics course โ€” from Python and REST fundamentals to NETCONF/RESTCONF/YANG, controllers and Ansible NetDevOps.

Python
REST / RESTCONF
NETCONF / YANG
Ansible
IOS XE / NX-OS
DevNet Sandbox
Python, REST, JSON/XML/YAML for network engineers
NETCONF, RESTCONF & YANG model-driven APIs
Controllers (DNA/ACI/Meraki) & Ansible NetDevOps

Setup, modules & run commands

Step 0 โ€” workstation setup
Setup

Install git, Python 3 and Postman, then clone the repo. The labs use Python 3 only (ignore the Python 2 in older videos).

Step 0 โ€” workstation setup
bash
# Clone the course code
git clone https://github.com/CiscoDevNet/netprog_basics.git
cd netprog_basics

# Create an isolated environment (recommended per-lesson)
python3 -m venv venv
source venv/bin/activate
programming_fundamentals/
Fundamentals

Start here: JSON/XML/YAML data formats, what APIs are, REST API calls (curl + Postman), and Python parts 1โ€“3 including libraries every network engineer needs.

programming_fundamentals/
bash
cd programming_fundamentals/python_part_3
pip install -r requirements.txt

# Run a lesson example, e.g. parsing structured data
python3 example.py
network_device_apis/
NETCONF / RESTCONF / YANG

Model-driven device management: YANG data models, NETCONF (the SNMP replacement), RESTCONF CRUD with GET/POST/DELETE, and NX-API on Nexus.

network_device_apis/
bash
cd network_device_apis/netconf
pip install -r requirements.txt

# Many labs run against the Always-On IOS XE DevNet Sandbox
python3 netconf_example.py
network_controllers/
Controllers & SDN

Programming controllers and cloud platforms: APIC-EM / DNA Center, ACI object model, and Cisco Meraki cloud APIs.

network_controllers/
bash
cd network_controllers/meraki
pip install -r requirements.txt

# Set your sandbox/API key, then run
python3 meraki_example.py
netdevops/ansible_part_1..3
NetDevOps + Ansible

Configuration management and 'your network as code': Ansible Part 1 (get started), Part 2 (network config), Part 3 (network as code).

netdevops/ansible_part_1..3
bash
cd netdevops/ansible_part_3

# Run the network-as-code playbook
ansible-playbook -i inventory site.yml

Most lessons ship a per-folder README and requirements.txt, and many run against the free Cisco DevNet Always-On / reservable Sandboxes โ€” no physical lab required. Use Python 3 for all labs.