diff --git a/.gitignore b/.gitignore index 8cb4042..1d00809 100644 --- a/.gitignore +++ b/.gitignore @@ -103,3 +103,7 @@ venv*/ # Other Dev Stuff .vagrant/ +.package.metadata +package.tar +*.retry +ioxclient diff --git a/README.md b/README.md index a9e1445..c47a8be 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,43 @@ -# Network Programmability Basics +# Network Programmability Basics Code, Examples, and Resources for the Network Programmability Basics Video Course -## Table of Contents +## Table of Contents +* [General Workstation Setup](readme_resources/workstation_setup.md) + * [Operating System Considerations](readme_resources/workstation_setup.md#operating-system-considerations) + * [Setting up git](readme_resources/workstation_setup.md#setting-up-git) + * [Setting Up Python](readme_resources/workstation_setup.md#setting-up-python) + * [Postman](readme_resources/workstation_setup.md#postman) + * [DevNet Sandbox VPN Access](readme_resources/workstation_setup.md#devnet-sandbox-vpn-access) * [Programming Fundamentals](programming_fundamentals/README.md) - * Data Formats: Understanding and using JSON, XML and YAML - * APIs are Everywhere... but what are they? - * Python Part 1: Python Language and Script Basics - * Python Part 2: Useful Python Libraries for Network Engineers - * REST APIs Part 1: HTTP is for more than Web Browsing - * REST APIs Part 2: Making REST API Calls with Postman -* [Network Device APIs](network_device_apis/README.md) - * Getting the “YANG” of it with Standard Data Models - * Good by SNMP NETCONF! - * Learn to CRUD with GET, POST and DELETE using RESTCONF - * NX-API Part 1: Get Started with APIs and Nexus - * NX-API Part 2: Dive into the Nexus Object Model + * [Data Formats: Understanding and using JSON, XML and YAML](programming_fundamentals/data_formats/README.md) + * [APIs are Everywhere... but what are they?](programming_fundamentals/apis/README.md) + * [REST APIs Part 1: HTTP is for more than Web Browsing](programming_fundamentals/rest_part_1/README.md) + * [REST APIs Part 2: Making REST API Calls with Postman](programming_fundamentals/rest_part_2/README.md) + * [Python Part 1: Python Language and Script Basics](programming_fundamentals/python_part_1/README.md) + * [Python Part 2: Working with Libraries and Virtual Environments](programming_fundamentals/python_part_2/README.md) + * [Python Part 3: Useful Python Libraries for Network Engineers](programming_fundamentals/python_part_3/README.md) +* [Network Device APIs](network_device_apis/README.md) + * [Getting the “YANG” of it with Standard Data Models](network_device_apis/yang/README.md) + * [Goodbye SNMP NETCONF!](network_device_apis/netconf/README.md) + * [Learn to CRUD with GET, POST and DELETE using RESTCONF](network_device_apis/restconf/README.md) + * [NX-API Part 1: Get Started with APIs and Nexus](network_device_apis/nxapi/README.md) + * [NX-API Part 2: Dive into the Nexus Object Model](network_device_apis/nxapi/README.md) * [Network Controllers](network_controllers/README.md) - * Program your own DNA with APIC-EM APIs - * Got SDN? Understanding the ACI Programmability Options - * Network Control in the Cloud - Developing with Cisco Meraki - * DNA APIs Part 1: Exploring APIC-EM Apps via API - * DNA APIs Part 2: Troubleshooting with APIC-EM Programmability - * ACI Programmability Part 1: The ACI Object Model - * ACI Programmability Part 2: Using the ACI Toolkit + * [Program your own DNA with APIC-EM APIs](network_controllers/apicem/README.md) + * [Got SDN? Understanding the ACI Programmability Options](network_controllers/aci/README.md) + * [Network Control in the Cloud - Developing with Cisco Meraki](network_controllers/meraki/README.md) + * [DNA APIs Part 1: Exploring APIC-EM Apps via API](network_controllers/apicem/README.md) + * [DNA APIs Part 2: Troubleshooting with APIC-EM Programmability](network_controllers/apicem/README.md) + * [ACI Programmability Part 1: The ACI Object Model](network_controllers/aci/README.md) + * [ACI Programmability Part 2: Using the ACI Toolkit](network_controllers/aci/README.md) * [Application Hosting and the Network](application_hosting/README.md) - * Cloud to Fog… Why Host Apps in the Network - * Linux at the Edge: Introduction to Guest Shell - * Python at the Edge: Super Charged Network Event Management - * Package, Deploy and Run Applications in the Network with IOx + * [Cloud to Fog… Why Host Apps in the Network](application_hosting/intro/README.md) + * [Linux at the Edge: Introduction to Guest Shell](application_hosting/guestshell/README.md) + * [Python at the Edge: Super Charged Network Event Management](application_hosting/python_onbox/README.md) + * [Package, Deploy and Run Applications in the Network with IOx](application_hosting/iox/README.md) * [NetDevOps](netdevops/README.md) - * Configuration Management and the Network - * Ansible Part 1: What you need to Get Started - * Ansible Part 2: Using Ansible for Network Configuration - * Ansible Part 3: Your Network As Code - + * [Configuration Management and the Network](netdevops/intro/README.md) + * [Ansible Part 1: What you need to Get Started](netdevops/ansible_part_1/README.md) + * [Ansible Part 2: Using Ansible for Network Configuration](netdevops/ansible_part_2/README.md) + * [Ansible Part 3: Your Network As Code](netdevops/ansible_part_3/README.md) diff --git a/application_hosting/README.md b/application_hosting/README.md new file mode 100644 index 0000000..72d3a29 --- /dev/null +++ b/application_hosting/README.md @@ -0,0 +1,9 @@ +# Application Hosting and the Network +In this module you will explore different options available for running code and hosting applications at the edge of the network, directly on switches, routers and other devices. + +## Lessons + +* [Cloud to Fog… Why Host Apps in the Network](intro/README.md) +* [Linux at the Edge: Introduction to Guest Shell](guestshell/README.md) +* [Python at the Edge: Super Charged Network Event Management](python_onbox/README.md) +* [Package, Deploy and Run Applications in the Network with IOx](iox/README.md) diff --git a/application_hosting/guestshell/README.md b/application_hosting/guestshell/README.md new file mode 100644 index 0000000..7e482fa --- /dev/null +++ b/application_hosting/guestshell/README.md @@ -0,0 +1,48 @@ +# Linux at the Edge: Introduction to Guest Shell + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/application_hosting/guestshell` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/application_hosting/guestshell +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 3.6. A recent version of Python 2.7 or Python 3.5 should also work. + +It is highly recommended to leverage Python Virtual Environments for completing exercises in this course. + +*There is no need to create independent venv for each lesson, but you can if you choose. At a minimum you should create 2 venvs, one for Python 2 and one for Python 3.* + +Follow these steps to create and activate a venv. + +***Note: If you are leveraging a shared venv across all lessons simply activate it.*** + +```bash +# OS X or Linux +virtualenv venv --python=python3 +source venv/bin/activate +``` + +```bash +# Windows (assumes Python 3 is default) +virtualenv venv +venv/Scripts/activate +``` + +#### Install Python Requirements for Lesson +With the Virtual Environment activated, use pip to install the necessary requirements. + +```bash +# From the code directory for this lesson +pip install -r requirements.txt +``` + +## DevNet Sandbox +This lesson leverages the [IOS XE Programmability](https://devnetsandbox.cisco.com/RM/Diagram/Index/7fd27b24-7034-477d-9ad2-e2c8096dd1a5?diagramType=Topology) Sandbox. + +You will need to reserve an instance of the sandbox, and establish a VPN connection to your individual Sandbox to complete this lab. diff --git a/application_hosting/guestshell/iosxe_guestshell_setup.txt b/application_hosting/guestshell/iosxe_guestshell_setup.txt new file mode 100644 index 0000000..eeb9732 --- /dev/null +++ b/application_hosting/guestshell/iosxe_guestshell_setup.txt @@ -0,0 +1,47 @@ +! To be entered onto IOS XE Device + +! ***** Step 1 ********* +! Enable IOX +conf t +iox +exit + +! Verify IOX +sh iox-service + +! ***** Step 2 ********* +! Create and Configure Virtual Port Group +conf t + +interface VirtualPortGroup 0 + ip add 192.168.35.1 255.255.255.0 + no shut + exit + +! ***** Step 3 ********* +! Configure NAT +conf t + +interface VirtualPortGroup0 + ip nat inside + exit + +! Interface connected to local network +interface GigabitEthernet1 + ip nat outside + exit + +ip access-list standard NAT_ACL + permit 192.168.0.0 0.0.255.255 + exit + +ip nat inside source list NAT_ACL \* interface GigabitEthernet1 overload + +! ***** Step 4 ********* +! Enable Guest Shell +! Entered from Enable Mode (not config) +! All entered on single line +guestshell enable VirtualPortGroup 0 guest-ip 192.168.35.2name-server 208.67.222.222 + +! Verify Guest Shell Running +show app-hosting list diff --git a/application_hosting/guestshell/requirements.txt b/application_hosting/guestshell/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/application_hosting/intro/README.md b/application_hosting/intro/README.md new file mode 100644 index 0000000..0793da0 --- /dev/null +++ b/application_hosting/intro/README.md @@ -0,0 +1,2 @@ +# Application Hosting and the Network +This lesson has no setup requirements. \ No newline at end of file diff --git a/application_hosting/iox/README.md b/application_hosting/iox/README.md new file mode 100644 index 0000000..e76195f --- /dev/null +++ b/application_hosting/iox/README.md @@ -0,0 +1,64 @@ +# Package, Deploy and Run Applications in the Network with IOx + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/application_hosting/iox` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/application_hosting/iox +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 3.6. A recent version of Python 2.7 or Python 3.5 should also work. + +It is highly recommended to leverage Python Virtual Environments for completing exercises in this course. + +*There is no need to create independent venv for each lesson, but you can if you choose. At a minimum you should create 2 venvs, one for Python 2 and one for Python 3.* + +Follow these steps to create and activate a venv. + +***Note: If you are leveraging a shared venv across all lessons simply activate it.*** + +```bash +# OS X or Linux +virtualenv venv --python=python3 +source venv/bin/activate +``` + +```bash +# Windows (assumes Python 3 is default) +virtualenv venv +venv/Scripts/activate +``` + +#### Install Python Requirements for Lesson +With the Virtual Environment activated, use pip to install the necessary requirements. + +```bash +# From the code directory for this lesson +pip install -r requirements.txt +``` + +### Docker Client Installation +In this lab, you will package and deploy a containerized application to IOx using Docker Tooling. To do so, you'll need Docker version 1.11 or higher installed for your workstation. Docker is supported across Linux, OS X, and Windows operating systems. + +Visit [www.docker.com/get-docker](https://www.docker.com/get-docker), download and install the client for your platform. + +### IOx Client Installation +IOx Client is an application you'll run use to package, deploy and install applications to IOx devices. + +Download and install version 1.4 or higher from [Cisco Downloads](https://software.cisco.com/download/release.html?mdfid=286306005&softwareid=286306762&release=1.4.0&relind=AVAILABLE&rellifecycle=&reltype=latest). + +Save ioxclient into one of the following locations: + +* The `netprog_basics/application_hosting/iox` directory on your workstation +* A directory that exists within your `PATH` environment variable. + * *Example: `/usr/local/bin` on OS X or Linux* + +## DevNet Sandbox +This lesson leverages the [IOx]() Sandbox. + +You will need to reserve an instance of the sandbox, and establish a VPN connection to your individual Sandbox to complete this lab. diff --git a/application_hosting/iox/requirements.txt b/application_hosting/iox/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/application_hosting/python_onbox/README.md b/application_hosting/python_onbox/README.md new file mode 100644 index 0000000..def6cf5 --- /dev/null +++ b/application_hosting/python_onbox/README.md @@ -0,0 +1,67 @@ +# Python at the Edge: Super Charged Network Event Management + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/application_hosting/python_onbox` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/application_hosting/python_onbox +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 3.6. A recent version of Python 2.7 or Python 3.5 should also work. + +It is highly recommended to leverage Python Virtual Environments for completing exercises in this course. + +*There is no need to create independent venv for each lesson, but you can if you choose. At a minimum you should create 2 venvs, one for Python 2 and one for Python 3.* + +Follow these steps to create and activate a venv. + +***Note: If you are leveraging a shared venv across all lessons simply activate it.*** + +```bash +# OS X or Linux +virtualenv venv --python=python3 +source venv/bin/activate +``` + +```bash +# Windows (assumes Python 3 is default) +virtualenv venv +venv/Scripts/activate +``` + +#### Install Python Requirements for Lesson +With the Virtual Environment activated, use pip to install the necessary requirements. + +```bash +# From the code directory for this lesson +pip install -r requirements.txt +``` + +## DevNet Sandbox +This lesson leverages the [IOS XE Programmability](https://devnetsandbox.cisco.com/RM/Diagram/Index/7fd27b24-7034-477d-9ad2-e2c8096dd1a5?diagramType=Topology) Sandbox. + +You will need to reserve an instance of the sandbox, and establish a VPN connection to your individual Sandbox to complete this lab. + +### Post Reservation Setup +This lesson assumes the following about the Sandbox: + +* Guest Shell has already been enabled on the IOS XE Sandbox instance +* `git` has been installed within the running Guest Shell container + +If you have already completed the exercises within the **Linux at the Edge: Introduction to Guest Shell** lesson using your Sandbox instance then you are all set and ready to go. If not, you will need to complete the following additional steps. + +1. Enable Guest Shell: Use the commands and information from [iosxe\_guestshell\_setup.txt](iosxe_guestshell_setup.txt). + +**Clone Code Repo to Guest Shell** + +With Guest Shell setup, now clone the code for the labs into Guest Shell in your Sandbox Instance. + +``` +! From Enable mode on your Sandbox Device +guestshell run git clone https://github.com/CiscoDevNet/netprog_basics /flash/netprog_basics +``` \ No newline at end of file diff --git a/application_hosting/python_onbox/iosxe_guestshell_setup.txt b/application_hosting/python_onbox/iosxe_guestshell_setup.txt new file mode 100644 index 0000000..549dded --- /dev/null +++ b/application_hosting/python_onbox/iosxe_guestshell_setup.txt @@ -0,0 +1,52 @@ +! To be entered onto IOS XE Device + +! ***** Step 1 ********* +! Enable IOX +conf t +iox +exit + +! Verify IOX +sh iox-service + +! ***** Step 2 ********* +! Create and Configure Virtual Port Group +conf t + +interface VirtualPortGroup 0 + ip add 192.168.35.1 255.255.255.0 + no shut + exit + +! ***** Step 3 ********* +! Configure NAT +conf t + +interface VirtualPortGroup0 + ip nat inside + exit + +! Interface connected to local network +interface GigabitEthernet1 + ip nat outside + exit + +ip access-list standard NAT_ACL + permit 192.168.0.0 0.0.255.255 + exit + +ip nat inside source list NAT_ACL \* interface GigabitEthernet1 overload + +! ***** Step 4 ********* +! Enable Guest Shell +! Entered from Enable Mode (not config) +! All entered on single line +guestshell enable VirtualPortGroup 0 guest-ip 192.168.35.2name-server 208.67.222.222 + +! Verify Guest Shell Running +show app-hosting list + +! ***** Step 5 ********* +! Install git within Guest Shell and Clone Code +guestshell run sudo yum install git +guestshell run git clone https://github.com/CiscoDevNet/netprog_basics /flash/netprog_basics diff --git a/application_hosting/python_onbox/requirements.txt b/application_hosting/python_onbox/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/netdevops/README.md b/netdevops/README.md new file mode 100644 index 0000000..e565a26 --- /dev/null +++ b/netdevops/README.md @@ -0,0 +1,9 @@ +# Application Hosting and the Network +In this module you will explore different options available for running code and hosting applications at the edge of the network, directly on switches, routers and other devices. + +## Lessons + +* [Configuration Management and the Network](intro/README.md) +* [Ansible Part 1: What you need to Get Started](ansible_part_1/README.md) +* [Ansible Part 2: Using Ansible for Network Configuration](ansible_part_2/README.md) +* [Ansible Part 3: Your Network As Code](ansible_part_3/README.md) diff --git a/netdevops/ansible_part_1/README.md b/netdevops/ansible_part_1/README.md new file mode 100644 index 0000000..8574a19 --- /dev/null +++ b/netdevops/ansible_part_1/README.md @@ -0,0 +1,48 @@ +# Ansible Part 1: What you need to Get Started + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/netdevops/ansible_part_1` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/netdevops/ansible_part_1 +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 2.7. + +It is highly recommended to leverage Python Virtual Environments for completing exercises in this course. + +*There is no need to create independent venv for each lesson, but you can if you choose. At a minimum you should create 2 venvs, one for Python 2 and one for Python 3.* + +Follow these steps to create and activate a venv. + +***Note: If you are leveraging a shared venv across all lessons simply activate it.*** + +```bash +# OS X or Linux +virtualenv venv --python=python2.7 +source venv/bin/activate +``` + +```bash +# Windows (Explicitly Provide Path to Python2.7 installation) +virtualenv venv --python=c:\Python27\python.exe +venv/Scripts/activate +``` + +#### Install Python Requirements for Lesson +With the Virtual Environment activated, use pip to install the necessary requirements. + +```bash +# From the code directory for this lesson +pip install -r requirements.txt +``` + +## DevNet Sandbox +This lesson leverages the [NX-OS with VIRL]() Sandbox. + +You will need to reserve an instance of the sandbox, and establish a VPN connection to your individual Sandbox to complete this lab. diff --git a/netdevops/ansible_part_1/requirements.txt b/netdevops/ansible_part_1/requirements.txt new file mode 100644 index 0000000..d4c1858 --- /dev/null +++ b/netdevops/ansible_part_1/requirements.txt @@ -0,0 +1,4 @@ +ansible==2.4.0.0 +ncclient==0.5.3 +paramiko==2.2.1 +requests==2.18.4 diff --git a/netdevops/ansible_part_2/README.md b/netdevops/ansible_part_2/README.md new file mode 100644 index 0000000..e88e839 --- /dev/null +++ b/netdevops/ansible_part_2/README.md @@ -0,0 +1,48 @@ +# Ansible Part 2: Using Ansible for Network Configuration + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/netdevops/ansible_part_2` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/netdevops/ansible_part_2 +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 2.7. + +It is highly recommended to leverage Python Virtual Environments for completing exercises in this course. + +*There is no need to create independent venv for each lesson, but you can if you choose. At a minimum you should create 2 venvs, one for Python 2 and one for Python 3.* + +Follow these steps to create and activate a venv. + +***Note: If you are leveraging a shared venv across all lessons simply activate it.*** + +```bash +# OS X or Linux +virtualenv venv --python=python2.7 +source venv/bin/activate +``` + +```bash +# Windows (Explicitly Provide Path to Python2.7 installation) +virtualenv venv --python=c:\Python27\python.exe +venv/Scripts/activate +``` + +#### Install Python Requirements for Lesson +With the Virtual Environment activated, use pip to install the necessary requirements. + +```bash +# From the code directory for this lesson +pip install -r requirements.txt +``` + +## DevNet Sandbox +This lesson leverages the [NX-OS with VIRL]() Sandbox. + +You will need to reserve an instance of the sandbox, and establish a VPN connection to your individual Sandbox to complete this lab. diff --git a/netdevops/ansible_part_2/requirements.txt b/netdevops/ansible_part_2/requirements.txt new file mode 100644 index 0000000..d4c1858 --- /dev/null +++ b/netdevops/ansible_part_2/requirements.txt @@ -0,0 +1,4 @@ +ansible==2.4.0.0 +ncclient==0.5.3 +paramiko==2.2.1 +requests==2.18.4 diff --git a/netdevops/ansible_part_3/README.md b/netdevops/ansible_part_3/README.md new file mode 100644 index 0000000..02c5b8c --- /dev/null +++ b/netdevops/ansible_part_3/README.md @@ -0,0 +1,58 @@ +# Ansible Part 3: Your Network As Code + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/netdevops/ansible_part_3` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/netdevops/ansible_part_3 +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 2.7. + +It is highly recommended to leverage Python Virtual Environments for completing exercises in this course. + +*There is no need to create independent venv for each lesson, but you can if you choose. At a minimum you should create 2 venvs, one for Python 2 and one for Python 3.* + +Follow these steps to create and activate a venv. + +***Note: If you are leveraging a shared venv across all lessons simply activate it.*** + +```bash +# OS X or Linux +virtualenv venv --python=python2.7 +source venv/bin/activate +``` + +```bash +# Windows (Explicitly Provide Path to Python2.7 installation) +virtualenv venv --python=c:\Python27\python.exe +venv/Scripts/activate +``` + +#### Install Python Requirements for Lesson +With the Virtual Environment activated, use pip to install the necessary requirements. + +```bash +# From the code directory for this lesson +pip install -r requirements.txt +``` + +## DevNet Sandbox +This lesson leverages the [NX-OS with VIRL]() Sandbox. + +You will need to reserve an instance of the sandbox, and establish a VPN connection to your individual Sandbox to complete this lab. + +### Post Reservation Setup +This lesson leverages a different [VIRL topology](virl_sbx_mgmt/ansible_part_3.virl) than **Ansible Part 1** and **Part 2** use. Before beginning this lesson run the following command to reconfigure the Sandbox with the proper topology. + +**From the `netprog_basics/netdevops/ansible_part_3` directory** + +```bash +cd virl_sbx_mgmt/ +python virl_simulation_setup.py +``` \ No newline at end of file diff --git a/netdevops/ansible_part_3/requirements.txt b/netdevops/ansible_part_3/requirements.txt new file mode 100644 index 0000000..d4c1858 --- /dev/null +++ b/netdevops/ansible_part_3/requirements.txt @@ -0,0 +1,4 @@ +ansible==2.4.0.0 +ncclient==0.5.3 +paramiko==2.2.1 +requests==2.18.4 diff --git a/netdevops/intro/README.md b/netdevops/intro/README.md new file mode 100644 index 0000000..246e1c7 --- /dev/null +++ b/netdevops/intro/README.md @@ -0,0 +1,2 @@ +# Configuration Management and the Network +This lesson has no setup requirements. \ No newline at end of file diff --git a/network_controllers/README.md b/network_controllers/README.md new file mode 100644 index 0000000..3a354e1 --- /dev/null +++ b/network_controllers/README.md @@ -0,0 +1,12 @@ +# Network Controllers +In this module you will explore different APIs for interacting with different network controllers. + +## Lessons + +* [Program your own DNA with APIC-EM APIs](apicem/README.md) +* [Got SDN? Understanding the ACI Programmability Options](aci/README.md) +* [Network Control in the Cloud - Developing with Cisco Meraki](meraki/README.md) +* [DNA APIs Part 1: Exploring APIC-EM Apps via API](apicem/README.md) +* [DNA APIs Part 2: Troubleshooting with APIC-EM Programmability](apicem/README.md) +* [ACI Programmability Part 1: The ACI Object Model](aci/README.md) +* [ACI Programmability Part 2: Using the ACI Toolkit](aci/README.md) diff --git a/network_controllers/aci/README.md b/network_controllers/aci/README.md new file mode 100644 index 0000000..a9bb65b --- /dev/null +++ b/network_controllers/aci/README.md @@ -0,0 +1,113 @@ +# Programming ACI Lessons + +* **Got SDN? Understanding the ACI Programmability Options** +* **ACI Programmability Part 1: The ACI Object Model** +* **ACI Programmability Part 2: Using the ACI Toolkit** + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/network_controllers/aci` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/network_controllers/aci +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Postman Setup +During this lesson the Postman client for making REST API calls is used. For convenience we have included a `postmane_collection.json` file that contains all the REST API calls leveraged in the different lessons, and `postman_environment.json` files for each of the DevNet Sandboxes leveraged across the lessons. These files are all located in the [postman_config](https://github.com/CiscoDevNet/netprog_basics/postman_config) directory in the code repository. + +To leverage them, simply `Import` them into your Postman client. + +1. Collections: Use the **Import** button in the upper left corner of the client. +2. Environments: Use the **Import** button from the `Manage Environments` interface of the client. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 3.6. A recent version of Python 2.7 or Python 3.5 should also work. + +It is highly recommended to leverage Python Virtual Environments for completing exercises in this course. + +*There is no need to create independent venv for each lesson, but you can if you choose. At a minimum you should create 2 venvs, one for Python 2 and one for Python 3.* + +Follow these steps to create and activate a venv. + +***Note: If you are leveraging a shared venv across all lessons simply activate it.*** + +```bash +# OS X or Linux +virtualenv venv --python=python3 +source venv/bin/activate +``` + +```bash +# Windows (assumes Python 3 is default) +virtualenv venv +venv/Scripts/activate +``` + +#### Install Python Requirements **NOT** Available on PyPi +This lesson leverages some Python libraries that are **not** currently available on PyPi and able to be installed through `pip install`. Follow these steps to download and install them. + +##### ACI Toolkit +**Be sure to have the Python Virtual Environment Activated** + +```bash +git clone https://github.com/datacenter/acitoolkit +cd acitoolkit/ +python setup.py install +``` + +##### ACI Python SDK: Cobra +The Python SDK for ACI is typically downloaded from the APIC Controller itself at `https:///cobra/_downloads/`, however the SDK files are **not** included with the APIC Simulator used for this lesson. Instead you can download them from DevNet directly using the following steps. + +1. Visit [developer.cisco.com](https://developer.cisco.com) and log into the site. +2. Download [ACI Cobra](https://developer.cisco.com/fileMedia/download/36cca44f-aa74-42c1-a0ea-c915abf37d38) *Version 2.1-1h* +3. Download [ACI Model](https://developer.cisco.com/fileMedia/download/b0fb085c-215b-4ba1-a493-2a67c08efba4) *Version 2.1-1h* + +***Note: If you click the links before logging into DevNet you will be prompted to login, but the file download will NOT start automatically*** + +Once downloaded install the Cobra SDK with the following commands. +**Be sure to have the Python Virtual Environment Activated** + +```bash +easy_install -Z acicobra-2.1_1h-py2.7.egg +easy_install -Z acimodel-2.1_1h-py2.7.egg +``` + +#### Install Python Requirements for Lesson +With the Virtual Environment activated, use pip to install the necessary requirements. + +```bash +# From the code directory for this lesson +pip install -r requirements.txt +``` + +#### graphviz & pygraphviz +In **ACI Programmability Part 2: Using the ACI Toolkit**, one exercise involves running the `aci-diagram` application included with the ACI Toolkit. This application uses the open source diagramming application `graphviz` and the related Python library `pygraphviz`. Installing these on a Linux or OS X system is straightforward and can be completed with the following steps. + +Install graphviz + +```bash +# On OS X using homebrew +brew install graphviz + +# With yum on Enterprise Linux +yum install graphviz + +# With apt-get on Debian +apt-get install graphviz +``` + +The pygraphviz library is included in the `requirements.txt` file included with the lesson code, however on OS X the installation with pip may miss some needed files. Use this command to install it fully. + +```bash +pip install pygraphviz \ + --install-option="--include-path=/usr/local/include/graphviz/" \ + --install-option="--library-path=/usr/local/lib/graphviz" +``` + +***Installation of graphviz on a Windows workstation is more challenging and currently beyond the scope of this lesson and setup.*** + +## DevNet Sandbox +This lesson leverages the [Always On: ACI APIC](https://devnetsandbox.cisco.com/RM/Diagram/Index/5a229a7c-95d5-4cfd-a651-5ee9bc1b30e2?diagramType=Topology) Sandbox. This sandbox requires no reservation **or** VPN connection. \ No newline at end of file diff --git a/network_controllers/aci/requirements.txt b/network_controllers/aci/requirements.txt new file mode 100644 index 0000000..c2982ce --- /dev/null +++ b/network_controllers/aci/requirements.txt @@ -0,0 +1,4 @@ +acicobra +acitoolkit +graphviz==0.8 +requests==2.18.2 diff --git a/network_controllers/apicem/README.md b/network_controllers/apicem/README.md new file mode 100644 index 0000000..8c0f4de --- /dev/null +++ b/network_controllers/apicem/README.md @@ -0,0 +1,58 @@ +# Programming APIC-EM Lessons + +* **Program your own DNA with APIC-EM APIs** +* **DNA APIs Part 1: Exploring APIC-EM Apps via API** +* **DNA APIs Part 2: Troubleshooting with APIC-EM Programmability** + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/network_controllers/apicem` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/network_controllers/apicem +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Postman Setup +During this lesson the Postman client for making REST API calls is used. For convenience we have included a `postmane_collection.json` file that contains all the REST API calls leveraged in the different lessons, and `postman_environment.json` files for each of the DevNet Sandboxes leveraged across the lessons. These files are all located in the [postman_config](https://github.com/CiscoDevNet/netprog_basics/postman_config) directory in the code repository. + +To leverage them, simply `Import` them into your Postman client. + +1. Collections: Use the **Import** button in the upper left corner of the client. +2. Environments: Use the **Import** button from the `Manage Environments` interface of the client. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 3.6. A recent version of Python 2.7 or Python 3.5 should also work. + +It is highly recommended to leverage Python Virtual Environments for completing exercises in this course. + +*There is no need to create independent venv for each lesson, but you can if you choose. At a minimum you should create 2 venvs, one for Python 2 and one for Python 3.* + +Follow these steps to create and activate a venv. + +***Note: If you are leveraging a shared venv across all lessons simply activate it.*** + +```bash +# OS X or Linux +virtualenv venv --python=python3 +source venv/bin/activate +``` + +```bash +# Windows (assumes Python 3 is default) +virtualenv venv +venv/Scripts/activate +``` + +#### Install Python Requirements for Lesson +With the Virtual Environment activated, use pip to install the necessary requirements. + +```bash +# From the code directory for this lesson +pip install -r requirements.txt +``` + +## DevNet Sandbox +This lesson leverages the [Always On: APIC-EM](https://devnetsandbox.cisco.com/RM/Diagram/Index/2e0f9525-5f46-4f46-973e-0f0c1bf934fa?diagramType=Topology) Sandbox. This sandbox requires no reservation **or** VPN connection. \ No newline at end of file diff --git a/network_controllers/apicem/requirements.txt b/network_controllers/apicem/requirements.txt new file mode 100644 index 0000000..29abca2 --- /dev/null +++ b/network_controllers/apicem/requirements.txt @@ -0,0 +1 @@ +requests==2.18.2 diff --git a/network_controllers/meraki/README.md b/network_controllers/meraki/README.md new file mode 100644 index 0000000..1630937 --- /dev/null +++ b/network_controllers/meraki/README.md @@ -0,0 +1,54 @@ +# Network Control in the Cloud - Developing with Cisco Meraki + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/network_controllers/meraki` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/network_controllers/meraki +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Postman Setup +During this lesson the Postman client for making REST API calls is used. For convenience we have included a `postmane_collection.json` file that contains all the REST API calls leveraged in the different lessons, and `postman_environment.json` files for each of the DevNet Sandboxes leveraged across the lessons. These files are all located in the [postman_config](https://github.com/CiscoDevNet/netprog_basics/postman_config) directory in the code repository. + +To leverage them, simply `Import` them into your Postman client. + +1. Collections: Use the **Import** button in the upper left corner of the client. +2. Environments: Use the **Import** button from the `Manage Environments` interface of the client. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 3.6. A recent version of Python 2.7 or Python 3.5 should also work. + +It is highly recommended to leverage Python Virtual Environments for completing exercises in this course. + +*There is no need to create independent venv for each lesson, but you can if you choose. At a minimum you should create 2 venvs, one for Python 2 and one for Python 3.* + +Follow these steps to create and activate a venv. + +***Note: If you are leveraging a shared venv across all lessons simply activate it.*** + +```bash +# OS X or Linux +virtualenv venv --python=python3 +source venv/bin/activate +``` + +```bash +# Windows (assumes Python 3 is default) +virtualenv venv +venv/Scripts/activate +``` + +#### Install Python Requirements for Lesson +With the Virtual Environment activated, use pip to install the necessary requirements. + +```bash +# From the code directory for this lesson +pip install -r requirements.txt +``` + +## DevNet Sandbox +This lesson leverages the [Always On: Meraki]() Sandbox. This sandbox requires no reservation **or** VPN connection. \ No newline at end of file diff --git a/network_controllers/meraki/requirements.txt b/network_controllers/meraki/requirements.txt new file mode 100644 index 0000000..29abca2 --- /dev/null +++ b/network_controllers/meraki/requirements.txt @@ -0,0 +1 @@ +requests==2.18.2 diff --git a/network_device_apis/README.md b/network_device_apis/README.md new file mode 100644 index 0000000..4a33426 --- /dev/null +++ b/network_device_apis/README.md @@ -0,0 +1,10 @@ +# Network Device APIs +In this module you will explore different APIs for interacting with individual Network Devices. + +## Lessons + +* [Getting the “YANG” of it with Standard Data Models](yang/README.md) +* [Goodbye SNMP NETCONF!](netconf/README.md) +* [Learn to CRUD with GET, POST and DELETE using RESTCONF](restconf/README.md) +* [NX-API Part 1: Get Started with APIs and Nexus](nxapi/README.md) +* [NX-API Part 2: Dive into the Nexus Object Model](nxapi/README.md) \ No newline at end of file diff --git a/network_device_apis/netconf/README.md b/network_device_apis/netconf/README.md new file mode 100644 index 0000000..d6e0f83 --- /dev/null +++ b/network_device_apis/netconf/README.md @@ -0,0 +1,46 @@ +# Goodbye SNMP NETCONF! + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/network_device_apis/netconf` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/network_device_apis/netconf +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 3.6. A recent version of Python 2.7 or Python 3.5 should also work. + +It is highly recommended to leverage Python Virtual Environments for completing exercises in this course. + +*There is no need to create independent venv for each lesson, but you can if you choose. At a minimum you should create 2 venvs, one for Python 2 and one for Python 3.* + +Follow these steps to create and activate a venv. + +***Note: If you are leveraging a shared venv across all lessons simply activate it.*** + +```bash +# OS X or Linux +virtualenv venv --python=python3 +source venv/bin/activate +``` + +```bash +# Windows (assumes Python 3 is default) +virtualenv venv +venv/Scripts/activate +``` + +#### Install Python Requirements for Lesson +With the Virtual Environment activated, use pip to install the necessary requirements. + +```bash +# From the code directory for this lesson +pip install -r requirements.txt +``` + +## DevNet Sandbox +This lesson leverages the [Always On: NETCONF/YANG & RESTCONF on IOS XE](https://devnetsandbox.cisco.com/RM/Diagram/Index/27d9747a-db48-4565-8d44-df318fce37ad?diagramType=Topology) Sandbox. This sandbox requires no reservation **or** VPN connection. \ No newline at end of file diff --git a/network_device_apis/netconf/requirements.txt b/network_device_apis/netconf/requirements.txt new file mode 100644 index 0000000..66f77cc --- /dev/null +++ b/network_device_apis/netconf/requirements.txt @@ -0,0 +1,3 @@ +ncclient==0.5.3 +pyang==1.7.3 +xmltodict==0.11.0 diff --git a/network_device_apis/nxapi/README.md b/network_device_apis/nxapi/README.md new file mode 100644 index 0000000..4e5636e --- /dev/null +++ b/network_device_apis/nxapi/README.md @@ -0,0 +1,58 @@ +# Programming with NX-API Lessons +* **NX-API Part 1: Get Started with APIs and Nexus** +* **NX-API Part 2: Dive into the Nexus Object Model** + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/network_device_apis/nxapi` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/network_device_apis/nxapi +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Postman Setup +During this lesson the Postman client for making REST API calls is used. For convenience we have included a `postmane_collection.json` file that contains all the REST API calls leveraged in the different lessons, and `postman_environment.json` files for each of the DevNet Sandboxes leveraged across the lessons. These files are all located in the [postman_config](https://github.com/CiscoDevNet/netprog_basics/postman_config) directory in the code repository. + +To leverage them, simply `Import` them into your Postman client. + +1. Collections: Use the **Import** button in the upper left corner of the client. +2. Environments: Use the **Import** button from the `Manage Environments` interface of the client. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 3.6. A recent version of Python 2.7 or Python 3.5 should also work. + +It is highly recommended to leverage Python Virtual Environments for completing exercises in this course. + +*There is no need to create independent venv for each lesson, but you can if you choose. At a minimum you should create 2 venvs, one for Python 2 and one for Python 3.* + +Follow these steps to create and activate a venv. + +***Note: If you are leveraging a shared venv across all lessons simply activate it.*** + +```bash +# OS X or Linux +virtualenv venv --python=python3 +source venv/bin/activate +``` + +```bash +# Windows (assumes Python 3 is default) +virtualenv venv +venv/Scripts/activate +``` + +#### Install Python Requirements for Lesson +With the Virtual Environment activated, use pip to install the necessary requirements. + +```bash +# From the code directory for this lesson +pip install -r requirements.txt +``` + +## DevNet Sandbox +This lesson leverages the [NX-OS Standalone]() Sandbox. + +You will need to reserve an instance of the sandbox, and establish a VPN connection to your individual Sandbox to complete this lab. diff --git a/network_device_apis/nxapi/requirements.txt b/network_device_apis/nxapi/requirements.txt new file mode 100644 index 0000000..29abca2 --- /dev/null +++ b/network_device_apis/nxapi/requirements.txt @@ -0,0 +1 @@ +requests==2.18.2 diff --git a/network_device_apis/restconf/README.md b/network_device_apis/restconf/README.md new file mode 100644 index 0000000..7b5fb71 --- /dev/null +++ b/network_device_apis/restconf/README.md @@ -0,0 +1,54 @@ +# Learn to CRUD with GET, POST and DELETE using RESTCONF + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/network_device_apis/restconf` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/network_device_apis/restconf +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Postman Setup +During this lesson the Postman client for making REST API calls is used. For convenience we have included a `postmane_collection.json` file that contains all the REST API calls leveraged in the different lessons, and `postman_environment.json` files for each of the DevNet Sandboxes leveraged across the lessons. These files are all located in the [postman_config](https://github.com/CiscoDevNet/netprog_basics/postman_config) directory in the code repository. + +To leverage them, simply `Import` them into your Postman client. + +1. Collections: Use the **Import** button in the upper left corner of the client. +2. Environments: Use the **Import** button from the `Manage Environments` interface of the client. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 3.6. A recent version of Python 2.7 or Python 3.5 should also work. + +It is highly recommended to leverage Python Virtual Environments for completing exercises in this course. + +*There is no need to create independent venv for each lesson, but you can if you choose. At a minimum you should create 2 venvs, one for Python 2 and one for Python 3.* + +Follow these steps to create and activate a venv. + +***Note: If you are leveraging a shared venv across all lessons simply activate it.*** + +```bash +# OS X or Linux +virtualenv venv --python=python3 +source venv/bin/activate +``` + +```bash +# Windows (assumes Python 3 is default) +virtualenv venv +venv/Scripts/activate +``` + +#### Install Python Requirements for Lesson +With the Virtual Environment activated, use pip to install the necessary requirements. + +```bash +# From the code directory for this lesson +pip install -r requirements.txt +``` + +## DevNet Sandbox +This lesson leverages the [Always On: NETCONF/YANG & RESTCONF on IOS XE](https://devnetsandbox.cisco.com/RM/Diagram/Index/27d9747a-db48-4565-8d44-df318fce37ad?diagramType=Topology) Sandbox. This sandbox requires no reservation **or** VPN connection. \ No newline at end of file diff --git a/network_device_apis/restconf/requirements.txt b/network_device_apis/restconf/requirements.txt new file mode 100644 index 0000000..4dceb7b --- /dev/null +++ b/network_device_apis/restconf/requirements.txt @@ -0,0 +1,2 @@ +pyang==1.7.3 +requests==2.18.2 diff --git a/network_device_apis/yang/README.md b/network_device_apis/yang/README.md new file mode 100644 index 0000000..8ed2457 --- /dev/null +++ b/network_device_apis/yang/README.md @@ -0,0 +1,46 @@ +# Getting the “YANG” of it with Standard Data Models + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/network_device_apis/yang` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/network_device_apis/yang +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 3.6. A recent version of Python 2.7 or Python 3.5 should also work. + +It is highly recommended to leverage Python Virtual Environments for completing exercises in this course. + +*There is no need to create independent venv for each lesson, but you can if you choose. At a minimum you should create 2 venvs, one for Python 2 and one for Python 3.* + +Follow these steps to create and activate a venv. + +***Note: If you are leveraging a shared venv across all lessons simply activate it.*** + +```bash +# OS X or Linux +virtualenv venv --python=python3 +source venv/bin/activate +``` + +```bash +# Windows (assumes Python 3 is default) +virtualenv venv +venv/Scripts/activate +``` + +#### Install Python Requirements for Lesson +With the Virtual Environment activated, use pip to install the necessary requirements. + +```bash +# From the code directory for this lesson +pip install -r requirements.txt +``` + +## DevNet Sandbox +This lesson leverages the [Always On: NETCONF/YANG & RESTCONF on IOS XE](https://devnetsandbox.cisco.com/RM/Diagram/Index/27d9747a-db48-4565-8d44-df318fce37ad?diagramType=Topology) Sandbox. This sandbox requires no reservation **or** VPN connection. \ No newline at end of file diff --git a/network_device_apis/yang/requirements.txt b/network_device_apis/yang/requirements.txt new file mode 100644 index 0000000..66f77cc --- /dev/null +++ b/network_device_apis/yang/requirements.txt @@ -0,0 +1,3 @@ +ncclient==0.5.3 +pyang==1.7.3 +xmltodict==0.11.0 diff --git a/postman_config/Network Programmability Basics.postman_collection.json b/postman_config/Network Programmability Basics.postman_collection.json new file mode 100644 index 0000000..a0a1d73 --- /dev/null +++ b/postman_config/Network Programmability Basics.postman_collection.json @@ -0,0 +1,2431 @@ +{ + "info": { + "name": "Network Programmability Basics", + "_postman_id": "f951e5b3-ce16-78cf-f92c-763d3d53ce05", + "description": "A collection of REST API calls used as part of the [Network Programmability Video Course](https://github.com/CiscoDevNet/netprog_basics). ", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "ACI", + "description": "", + "item": [ + { + "name": "APIC Login", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"aaaUser\": {\n \"attributes\": {\n \"name\": \"{{username}}\",\n \"pwd\": \"{{password}}\"\n }\n }\n}" + }, + "url": { + "raw": "https://{{apic}}/api/aaaLogin.json", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "aaaLogin.json" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIC Tenant Class Query", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/node/class/fvTenant.json", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "node", + "class", + "fvTenant.json" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIC Specific Tenant Class Query ", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/node/class/fvTenant.json?query-target-filter=and(eq(fvTenant.name,\"Heroes\"))", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "node", + "class", + "fvTenant.json" + ], + "query": [ + { + "key": "query-target-filter", + "value": "and(eq(fvTenant.name,\"Heroes\"))", + "equals": true + } + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIC Non-Default Tenant Class Query", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "https://198.18.133.200/api/node/class/fvTenant.json?query-target-filter=and(ne(fvTenant.name,\"common\"),ne(fvTenant.name,\"infra\"),ne(fvTenant.name,\"mgmt\"))", + "protocol": "https", + "host": [ + "198", + "18", + "133", + "200" + ], + "path": [ + "api", + "node", + "class", + "fvTenant.json" + ], + "query": [ + { + "key": "query-target-filter", + "value": "and(ne(fvTenant.name,\"common\"),ne(fvTenant.name,\"infra\"),ne(fvTenant.name,\"mgmt\"))" + } + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIC Tenant Query Full Tree", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "https://198.18.133.200/api/class/fvTenant.json?query-target-filter=eq(fvTenant.name,\"Heroes\")&rsp-subtree=full&rsp-prop-include=config-only", + "protocol": "https", + "host": [ + "198", + "18", + "133", + "200" + ], + "path": [ + "api", + "class", + "fvTenant.json" + ], + "query": [ + { + "key": "query-target-filter", + "value": "eq(fvTenant.name,\"Heroes\")" + }, + { + "key": "rsp-subtree", + "value": "full" + }, + { + "key": "rsp-prop-include", + "value": "config-only" + } + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIC Create Tenant", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"fvTenant\": {\n \"attributes\": {\n \"dn\": \"uni/tn-API_Test\", \n \"name\": \"API_Test\", \n \"rn\": \"tn-API_Test\", \n \"status\": \"created\"\n }, \n \"children\": []\n }\n}\n" + }, + "url": { + "raw": "https://{{apic}}/api/node/mo/uni.json", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "node", + "mo", + "uni.json" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIC Contract Create", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": " {\n \"fvTenant\": {\n \"attributes\": {\n \"name\": \"Villains\"\n }, \n \"children\": [\n\n{\n \"vzFilter\": {\n \"attributes\": {\n \"name\": \"DNS_ZoneTransfer\", \n \"status\": \"created,modified\"\n }, \n \"children\": [\n {\n \"vzEntry\": {\n \"attributes\": {\n \"dFromPort\": \"53\", \n \"dToPort\": \"53\", \n \"etherT\": \"ip\", \n \"name\": \"tcp-53\", \n \"prot\": \"tcp\", \n \"status\": \"created,modified\"\n }, \n \"children\": []\n }\n }\n ]\n }\n},\n{\n \"vzBrCP\": {\n \"attributes\": {\n \"name\": \"DNS\", \n \"status\": \"modified\"\n }, \n \"children\": [\n {\n \"vzSubj\": {\n \"attributes\": {\n \"name\": \"DNS_ZoneTransfer\", \n \"status\": \"created\"\n }, \n \"children\": [\n {\n \"vzRsSubjFiltAtt\": {\n \"attributes\": {\n \"status\": \"created,modified\", \n \"tnVzFilterName\": \"DNS_ZoneTransfer\"\n }, \n \"children\": []\n }\n }\n ]\n }\n }\n ]\n }\n}\n\n\n \n ]\n }\n}" + }, + "url": { + "raw": "https://198.18.133.200/api/node/mo/uni/tn-Villains.json", + "protocol": "https", + "host": [ + "198", + "18", + "133", + "200" + ], + "path": [ + "api", + "node", + "mo", + "uni", + "tn-Villains.json" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIC WebSocket Subscribe Heroes", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "https://198.18.133.200/api/mo/uni/tn-Heroes.json?subscription=yes", + "protocol": "https", + "host": [ + "198", + "18", + "133", + "200" + ], + "path": [ + "api", + "mo", + "uni", + "tn-Heroes.json" + ], + "query": [ + { + "key": "subscription", + "value": "yes" + } + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIC WebSocket Subscribe Refresh", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "https://198.18.133.200/api/subscriptionRefresh.json?id=72057662774444034", + "protocol": "https", + "host": [ + "198", + "18", + "133", + "200" + ], + "path": [ + "api", + "subscriptionRefresh.json" + ], + "query": [ + { + "key": "id", + "value": "72057662774444034" + } + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIC End Point Class Query", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/node/class/fvCEp.json", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "node", + "class", + "fvCEp.json" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIC Fabric Node Class Query", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/node/class/fabricNode.json", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "node", + "class", + "fabricNode.json" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIC Tenant Common Query", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/mo/uni/tn-common.json", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "mo", + "uni", + "tn-common.json" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIC Fabric Node Object Query", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/mo/topology/pod-1/node-1.json", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "mo", + "topology", + "pod-1", + "node-1.json" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "APIC Application Profile Description Update", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"fvAp\": {\n \"attributes\": {\n \"descr\": \"Configured with REST API\", \n \"dn\": \"uni/tn-Heroes/ap-Save_The_Planet\"\n }\n }\n}" + }, + "url": { + "raw": "https://{{apic}}/api/node/mo/uni/tn-Heroes/ap-Save_The_Planet.json", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "node", + "mo", + "uni", + "tn-Heroes", + "ap-Save_The_Planet.json" + ] + }, + "description": "" + }, + "response": [] + } + ] + }, + { + "name": "APIC-EM", + "description": "", + "item": [ + { + "name": "APIC-EM Login", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "postman.setEnvironmentVariable(\"token\", ", + " jsonData.response.serviceTicket);", + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"username\": \"{{username}}\", \n \"password\": \"{{password}}\"\n}" + }, + "url": { + "raw": "https://{{apic}}/api/v1/ticket", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "v1", + "ticket" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Interface List", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "postman.setEnvironmentVariable(\"network_device_id\", jsonData.response[0].id);" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "x-auth-token", + "value": "{{token}}" + } + ], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/v1/interface", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "v1", + "interface" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Network Device List", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "postman.setEnvironmentVariable(\"network_device_id\", jsonData.response[0].id);" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "x-auth-token", + "value": "{{token}}" + } + ], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/v1/network-device", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "v1", + "network-device" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Network Device Details", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "x-auth-token", + "value": "{{token}}" + } + ], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/v1/network-device/{{network_device_id}}", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "v1", + "network-device", + "{{network_device_id}}" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Network Device by IP Address", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "x-auth-token", + "value": "{{token}}" + } + ], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/v1/network-device/ip-address/165.10.1.39", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "v1", + "network-device", + "ip-address", + "165.10.1.39" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Network Device by Serial", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "x-auth-token", + "value": "{{token}}" + } + ], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/v1/network-device/serial-number/FOC1637Y3FJ", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "v1", + "network-device", + "serial-number", + "FOC1637Y3FJ" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Network Devices at a Location", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "x-auth-token", + "value": "{{token}}" + } + ], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/v1/network-device/location/e0c8c8c6-05ae-445f-80d8-f8cc225cbbd2", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "v1", + "network-device", + "location", + "e0c8c8c6-05ae-445f-80d8-f8cc225cbbd2" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Interface List by Device ID", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "postman.setEnvironmentVariable(\"network_device_id\", jsonData.response[0].id);" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "x-auth-token", + "value": "{{token}}" + } + ], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/v1/interface/network-device/8dbd8068-1091-4cde-8cf5-d1b58dc5c9c7", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "v1", + "interface", + "network-device", + "8dbd8068-1091-4cde-8cf5-d1b58dc5c9c7" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Interface List by Device ID and Port Name", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "x-auth-token", + "value": "{{token}}" + } + ], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/v1/interface/network-device/8dbd8068-1091-4cde-8cf5-d1b58dc5c9c7/interface-name?name=FastEthernet0/2", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "v1", + "interface", + "network-device", + "8dbd8068-1091-4cde-8cf5-d1b58dc5c9c7", + "interface-name" + ], + "query": [ + { + "key": "name", + "value": "FastEthernet0/2", + "equals": true + } + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Hosts List", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "postman.setEnvironmentVariable(\"host_id\", jsonData.response[0].id);" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "x-auth-token", + "value": "{{token}}" + } + ], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/v1/host", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "v1", + "host" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Hosts Details", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "x-auth-token", + "value": "{{token}}" + } + ], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/v1/host/{{host_id}}", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "v1", + "host", + "{{host_id}}" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Hosts by IP Address", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "postman.setEnvironmentVariable(\"host_id\", jsonData.response[0].id);" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "x-auth-token", + "value": "{{token}}" + } + ], + "body": {}, + "url": { + "raw": "https://{{apic}}/api/v1/host?hostIP=10.1.15.117", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "v1", + "host" + ], + "query": [ + { + "key": "hostIP", + "value": "10.1.15.117", + "equals": true + } + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Begin New Flow Analysis", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "postman.setEnvironmentVariable(\"flowAnalysisId\", jsonData.response.flowAnalysisId);" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "x-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"destIP\": \"10.1.15.117\", \n\t\"sourceIP\": \"10.2.1.22\"\n}" + }, + "url": { + "raw": "https://{{apic}}/api/v1/flow-analysis", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "v1", + "flow-analysis" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Get Flow Analysis Details", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "x-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"destIP\": \"10.1.15.117\", \n\t\"sourceIP\": \"10.2.1.22\"\n}" + }, + "url": { + "raw": "https://{{apic}}/api/v1/flow-analysis/{{flowAnalysisId}}", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "v1", + "flow-analysis", + "{{flowAnalysisId}}" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Delete Flow Analysis", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "x-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"destIP\": \"10.1.15.117\", \n\t\"sourceIP\": \"10.2.1.22\"\n}" + }, + "url": { + "raw": "https://{{apic}}/api/v1/flow-analysis/{{flowAnalysisId}}", + "protocol": "https", + "host": [ + "{{apic}}" + ], + "path": [ + "api", + "v1", + "flow-analysis", + "{{flowAnalysisId}}" + ] + }, + "description": "" + }, + "response": [] + } + ] + }, + { + "name": "NX-API CLI", + "description": "", + "item": [ + { + "name": "JSON-RPC show vlans bri", + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "username", + "value": "{{username}}", + "type": "string" + }, + { + "key": "password", + "value": "{{password}}", + "type": "string" + }, + { + "key": "saveHelperData", + "value": true, + "type": "boolean" + }, + { + "key": "showPassword", + "value": false, + "type": "boolean" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json-rpc" + }, + { + "key": "Authorization", + "value": "Basic YWRtaW46Y2lzY28xMjM=" + } + ], + "body": { + "mode": "raw", + "raw": "[\n {\n \"jsonrpc\": \"2.0\",\n \"method\": \"cli\",\n \"params\": {\n \"cmd\": \"show vlan bri\",\n \"version\": 1\n },\n \"id\": 1\n }\n]" + }, + "url": { + "raw": "http://{{host}}/ins", + "protocol": "http", + "host": [ + "{{host}}" + ], + "path": [ + "ins" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "INS-API XML show vlans bri", + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "username", + "value": "{{username}}", + "type": "string" + }, + { + "key": "password", + "value": "{{password}}", + "type": "string" + }, + { + "key": "saveHelperData", + "value": true, + "type": "boolean" + }, + { + "key": "showPassword", + "value": false, + "type": "boolean" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/xml" + }, + { + "key": "Authorization", + "value": "Basic YWRtaW46Y2lzY28xMjM=" + } + ], + "body": { + "mode": "raw", + "raw": "\n\n 1.0\n cli_show\n 0\n sid\n show vlan bri\n xml\n" + }, + "url": { + "raw": "http://{{host}}/ins", + "protocol": "http", + "host": [ + "{{host}}" + ], + "path": [ + "ins" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "INS-API JSON show vlans bri", + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "username", + "value": "{{username}}", + "type": "string" + }, + { + "key": "password", + "value": "{{password}}", + "type": "string" + }, + { + "key": "saveHelperData", + "value": true, + "type": "boolean" + }, + { + "key": "showPassword", + "value": false, + "type": "boolean" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Basic YWRtaW46Y2lzY28xMjM=" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"ins_api\": {\n \"version\": \"1.0\",\n \"type\": \"cli_show\",\n \"chunk\": \"0\",\n \"sid\": \"1\",\n \"input\": \"show vlan bri\",\n \"output_format\": \"json\"\n }\n}" + }, + "url": { + "raw": "http://{{host}}/ins", + "protocol": "http", + "host": [ + "{{host}}" + ], + "path": [ + "ins" + ] + }, + "description": "" + }, + "response": [] + } + ] + }, + { + "name": "NX-API REST", + "description": "", + "item": [ + { + "name": "Login Request", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"aaaUser\": {\n \"attributes\": {\n \"name\": \"{{username}}\",\n \"pwd\": \"{{password}}\"\n }\n }\n}" + }, + "url": { + "raw": "https://{{host}}/api/aaaLogin.json", + "protocol": "https", + "host": [ + "{{host}}" + ], + "path": [ + "api", + "aaaLogin.json" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "GET SNMP Instances", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "https://{{host}}:{{port}}/api/node/mo/sys/snmp.xml?query-target=subtree", + "protocol": "https", + "host": [ + "{{host}}" + ], + "port": "{{port}}", + "path": [ + "api", + "node", + "mo", + "sys", + "snmp.xml" + ], + "query": [ + { + "key": "query-target", + "value": "subtree", + "equals": true + } + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Configure SNMP Plus Example", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" + }, + "url": { + "raw": "https://{{host}}:{{port}}/api/node/mo/sys.xml", + "protocol": "https", + "host": [ + "{{host}}" + ], + "port": "{{port}}", + "path": [ + "api", + "node", + "mo", + "sys.xml" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "GET Interface Eth1/1", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "https://{{host}}/api/node/mo/sys/intf/phys-[eth1/1].json", + "protocol": "https", + "host": [ + "{{host}}" + ], + "path": [ + "api", + "node", + "mo", + "sys", + "intf", + "phys-[eth1", + "1].json" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "PUT Interface Eth1/1 - Desc", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"l1PhysIf\": {\n \"attributes\": {\n \"descr\": \"Configured with NX-API REST\"\n }\n }\n}" + }, + "url": { + "raw": "https://{{host}}/api/node/mo/sys/intf/phys-[eth1/1].json", + "protocol": "https", + "host": [ + "{{host}}" + ], + "path": [ + "api", + "node", + "mo", + "sys", + "intf", + "phys-[eth1", + "1].json" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Class Query - VLANS other than 1", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "https://{{host}}/api/node/class/l2BD.json?query-target-filter=and(ne(l2BD.id,\"1\"))", + "protocol": "https", + "host": [ + "{{host}}" + ], + "path": [ + "api", + "node", + "class", + "l2BD.json" + ], + "query": [ + { + "key": "query-target-filter", + "value": "and(ne(l2BD.id,\"1\"))", + "equals": true + } + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "GET VLAN 1", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "https://{{host}}/api/node/mo/sys/bd/bd-[vlan-1].json", + "protocol": "https", + "host": [ + "{{host}}" + ], + "path": [ + "api", + "node", + "mo", + "sys", + "bd", + "bd-[vlan-1].json" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "PUT VLAN 501", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "https://{{host}}/api/node/mo/sys/bd/bd-[vlan-1].json", + "protocol": "https", + "host": [ + "{{host}}" + ], + "path": [ + "api", + "node", + "mo", + "sys", + "bd", + "bd-[vlan-1].json" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "POST VLAN 501", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"l2BD\": {\n \"attributes\": {\n \"fabEncap\": \"vlan-501\",\n \"name\": \"NX-API-REST1\"\n }\n }\n}" + }, + "url": { + "raw": "https://{{host}}/api/node/mo/sys/bd/bd-[vlan-501].json", + "protocol": "https", + "host": [ + "{{host}}" + ], + "path": [ + "api", + "node", + "mo", + "sys", + "bd", + "bd-[vlan-501].json" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "DELETE VLAN 501", + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"l2BD\": {\n \"attributes\": {\n \"fabEncap\": \"vlan-501\",\n \"name\": \"NX-API-REST1\"\n }\n }\n}" + }, + "url": { + "raw": "https://{{host}}/api/node/mo/sys/bd/bd-[vlan-501].json", + "protocol": "https", + "host": [ + "{{host}}" + ], + "path": [ + "api", + "node", + "mo", + "sys", + "bd", + "bd-[vlan-501].json" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Full Object Tree Query", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "https://{{host}}/api/node/mo/sys.json?query-target=subtree", + "protocol": "https", + "host": [ + "{{host}}" + ], + "path": [ + "api", + "node", + "mo", + "sys.json" + ], + "query": [ + { + "key": "query-target", + "value": "subtree", + "equals": true + } + ] + }, + "description": "" + }, + "response": [] + } + ] + }, + { + "name": "RESTCONF", + "description": "", + "item": [ + { + "name": "Read the top level REST resource", + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "username", + "value": "{{username}}", + "type": "string" + }, + { + "key": "password", + "value": "{{password}}", + "type": "string" + }, + { + "key": "saveHelperData", + "value": true, + "type": "boolean" + }, + { + "key": "showPassword", + "value": false, + "type": "boolean" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/yang-data+json" + }, + { + "key": "Accept", + "value": "application/yang-data+json" + }, + { + "key": "Authorization", + "value": "Basic dmFncmFudDp2YWdyYW50" + } + ], + "body": {}, + "url": { + "raw": "https://{{host}}:{{port}}/.well-known/host-meta", + "protocol": "https", + "host": [ + "{{host}}" + ], + "port": "{{port}}", + "path": [ + ".well-known", + "host-meta" + ] + }, + "description": "/api is the top level REST resource.\nReading this resource shows what datastores\nare available and what operations are available.\n\nOperations are executed by sending a GET command\nto the URL identified for the operation." + }, + "response": [] + }, + { + "name": "Read models implemented by the device", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Body matches string\"] = responseBody.has(\"interface\");" + ] + } + } + ], + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "username", + "value": "{{username}}", + "type": "string" + }, + { + "key": "password", + "value": "{{password}}", + "type": "string" + }, + { + "key": "saveHelperData", + "value": true, + "type": "boolean" + }, + { + "key": "showPassword", + "value": false, + "type": "boolean" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/yang-data+json" + }, + { + "key": "Accept", + "value": "application/yang-data+json" + }, + { + "key": "Authorization", + "value": "Basic dmFncmFudDp2YWdyYW50" + } + ], + "body": {}, + "url": { + "raw": "https://{{host}}:{{port}}/restconf/data/netconf-state/capabilities", + "protocol": "https", + "host": [ + "{{host}}" + ], + "port": "{{port}}", + "path": [ + "restconf", + "data", + "netconf-state", + "capabilities" + ] + }, + "description": "This command reads a subset of the information available\nin the ietf-netconf-monitoring model. The information returned\nis the list of all models, revisions, deviations on this device.\n\nUsing this command is the definitive way to determine the exact\nimplementation and versions on the device. This information can\nbe used by an intelligent management client to make decisions\non how to use the RESTCONF interface.\n\nThis example for the ietf-interfaces model identifies the \nrevision data as 5.8.2014 and lists specific feature options\nsupported and also the name of the module applying deviations \nthat change the information exposed by the model.\n\n \"urn:ietf:params:xml:ns:yang:\n ietf-interfaces?module=ietf-interfaces&\n revision=2014-05-08&features=pre-provisioning,if-mib,\n arbitrary-names&deviations=ietf-ip-devs\",\n" + }, + "response": [] + }, + { + "name": "Read ietf-yang-library", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Body matches string\"] = responseBody.has(\"interface\");" + ] + } + } + ], + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "username", + "value": "{{username}}", + "type": "string" + }, + { + "key": "password", + "value": "{{password}}", + "type": "string" + }, + { + "key": "saveHelperData", + "value": true, + "type": "boolean" + }, + { + "key": "showPassword", + "value": false, + "type": "boolean" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/yang-data+json", + "disabled": true + }, + { + "key": "Accept", + "value": "application/yang-data+json", + "disabled": true + }, + { + "key": "Authorization", + "value": "Basic dmFncmFudDp2YWdyYW50" + } + ], + "body": {}, + "url": { + "raw": "https://{{host}}:{{port}}/restconf/data/ietf-yang-library:modules-state", + "protocol": "https", + "host": [ + "{{host}}" + ], + "port": "{{port}}", + "path": [ + "restconf", + "data", + "ietf-yang-library:modules-state" + ] + }, + "description": "This command reads a subset of the information available\nin the ietf-netconf-monitoring model. The information returned\nis the list of all models, revisions, deviations on this device.\n\nUsing this command is the definitive way to determine the exact\nimplementation and versions on the device. This information can\nbe used by an intelligent management client to make decisions\non how to use the RESTCONF interface.\n\nThis example for the ietf-interfaces model identifies the \nrevision data as 5.8.2014 and lists specific feature options\nsupported and also the name of the module applying deviations \nthat change the information exposed by the model.\n\n \"urn:ietf:params:xml:ns:yang:\n ietf-interfaces?module=ietf-interfaces&\n revision=2014-05-08&features=pre-provisioning,if-mib,\n arbitrary-names&deviations=ietf-ip-devs\",\n" + }, + "response": [] + }, + { + "name": "Read ietf-interfaces list of interface names", + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "username", + "value": "{{username}}", + "type": "string" + }, + { + "key": "password", + "value": "{{password}}", + "type": "string" + }, + { + "key": "saveHelperData", + "value": true, + "type": "boolean" + }, + { + "key": "showPassword", + "value": false, + "type": "boolean" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/yang-data+json" + }, + { + "key": "Accept", + "value": "application/yang-data+json" + }, + { + "key": "Authorization", + "value": "Basic dmFncmFudDp2YWdyYW50" + } + ], + "body": {}, + "url": { + "raw": "https://{{host}}:{{port}}/restconf/data/ietf-interfaces:interfaces", + "protocol": "https", + "host": [ + "{{host}}" + ], + "port": "{{port}}", + "path": [ + "restconf", + "data", + "ietf-interfaces:interfaces" + ] + }, + "description": "This message uses the ietf-interface model to read\na list of the names of each interface managed using\nthe model. The model mapping infrastructure converts\nthe native model configuration into the form defined\nby the ietf-interfaces common model\n\n{\n \"ietf-interfaces:interfaces\": {\n \"interface\": [\n {\n \"name\": \"FastEthernet0/0/0\"\n },\n {\n \"name\": \"FastEthernet0/0/1\"\n },\n {\n \"name\": \"FastEthernet0/0/2\"\n }," + }, + "response": [] + }, + { + "name": "Read ietf-interfaces single interface", + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "username", + "value": "{{username}}", + "type": "string" + }, + { + "key": "password", + "value": "{{password}}", + "type": "string" + }, + { + "key": "saveHelperData", + "value": true, + "type": "boolean" + }, + { + "key": "showPassword", + "value": false, + "type": "boolean" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/yang-data+json" + }, + { + "key": "Accept", + "value": "application/yang-data+json" + }, + { + "key": "Authorization", + "value": "Basic dmFncmFudDp2YWdyYW50" + } + ], + "body": {}, + "url": { + "raw": "https://{{host}}:{{port}}/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1", + "protocol": "https", + "host": [ + "{{host}}" + ], + "port": "{{port}}", + "path": [ + "restconf", + "data", + "ietf-interfaces:interfaces", + "interface=GigabitEthernet1" + ] + }, + "description": "This reads a single interface from the IOS XE box which already has been configured as a 802.1Q subinterface" + }, + "response": [] + }, + { + "name": "Configure ietf-interfaces single interface", + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "username", + "value": "{{username}}", + "type": "string" + }, + { + "key": "password", + "value": "{{password}}", + "type": "string" + }, + { + "key": "saveHelperData", + "value": true, + "type": "boolean" + }, + { + "key": "showPassword", + "value": false, + "type": "boolean" + } + ] + }, + "method": "PUT", + "header": [ + { + "key": "Authorization", + "value": "Basic cm9vdDpjaXNjbzEyMw==" + }, + { + "key": "Accept", + "value": "application/yang-data+json" + }, + { + "key": "Content-Type", + "value": "application/yang-data+json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"ietf-interfaces:interface\": {\n \"name\": \"GigabitEthernet2\",\n \"description\": \"Configured by RESTCONF\",\n \"type\": \"iana-if-type:ethernetCsmacd\",\n \"enabled\": true,\n \"ietf-ip:ipv4\": {\n \"address\": [\n {\n \"ip\": \"10.255.255.1\",\n \"netmask\": \"255.255.255.0\"\n }\n ]\n }\n }\n}" + }, + "url": { + "raw": "https://{{host}}:{{port}}/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet2", + "protocol": "https", + "host": [ + "{{host}}" + ], + "port": "{{port}}", + "path": [ + "restconf", + "data", + "ietf-interfaces:interfaces", + "interface=GigabitEthernet2" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Read native device single interface", + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "username", + "value": "{{username}}", + "type": "string" + }, + { + "key": "password", + "value": "{{password}}", + "type": "string" + }, + { + "key": "saveHelperData", + "value": true, + "type": "boolean" + }, + { + "key": "showPassword", + "value": false, + "type": "boolean" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/yang-data+json" + }, + { + "key": "Accept", + "value": "application/yang-data+json" + }, + { + "key": "Authorization", + "value": "Basic dmFncmFudDp2YWdyYW50" + } + ], + "body": {}, + "url": { + "raw": "https://{{host}}:{{port}}/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet=2", + "protocol": "https", + "host": [ + "{{host}}" + ], + "port": "{{port}}", + "path": [ + "restconf", + "data", + "Cisco-IOS-XE-native:native", + "interface", + "GigabitEthernet=2" + ] + }, + "description": "This reads a single interface from the IOS XE box which already has been configured as a 802.1Q subinterface\nIt uses the native device model (e.g. NED, network element driver)" + }, + "response": [] + }, + { + "name": "Operational State interfaces", + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "username", + "value": "{{username}}", + "type": "string" + }, + { + "key": "password", + "value": "{{password}}", + "type": "string" + }, + { + "key": "saveHelperData", + "value": true, + "type": "boolean" + }, + { + "key": "showPassword", + "value": false, + "type": "boolean" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/yang-data+json" + }, + { + "key": "Accept", + "value": "application/yang-data+json" + }, + { + "key": "Authorization", + "value": "Basic dmFncmFudDp2YWdyYW50" + } + ], + "body": {}, + "url": { + "raw": "https://{{host}}:{{port}}/restconf/data/ietf-interfaces:interfaces-state/", + "protocol": "https", + "host": [ + "{{host}}" + ], + "port": "{{port}}", + "path": [ + "restconf", + "data", + "ietf-interfaces:interfaces-state", + "" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "Read native hostname", + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "username", + "value": "{{username}}", + "type": "string" + }, + { + "key": "password", + "value": "{{password}}", + "type": "string" + }, + { + "key": "saveHelperData", + "value": true, + "type": "boolean" + }, + { + "key": "showPassword", + "value": false, + "type": "boolean" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Basic cm9vdDpjaXNjbzEyMw==" + }, + { + "key": "Content-Type", + "value": "application/yang-data+json" + }, + { + "key": "Accept", + "value": "application/yang-data+json" + } + ], + "body": {}, + "url": { + "raw": "https://{{host}}:{{port}}/restconf/data/Cisco-IOS-XE-native:native/hostname", + "protocol": "https", + "host": [ + "{{host}}" + ], + "port": "{{port}}", + "path": [ + "restconf", + "data", + "Cisco-IOS-XE-native:native", + "hostname" + ] + }, + "description": "" + }, + "response": [] + } + ] + }, + { + "name": "Meraki", + "description": "", + "item": [ + { + "name": "GET Organizations", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "// Store the Organization Id as Environment Variable ", + "// Requires the name of the organization to already be ", + "// set as an environment variable", + "var jsonData = JSON.parse(responseBody);", + "var orgName = pm.environment.get(\"Organization Name\");", + "for (var i in jsonData) {", + " if (jsonData[i].name === orgName) {", + " postman.setEnvironmentVariable(\"organizationId\", ", + " jsonData[i].id);", + " }", + "}", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Cisco-Meraki-API-Key", + "value": "{{X-Cisco-Meraki-API-Key}}" + } + ], + "body": {}, + "url": { + "raw": "https://dashboard.meraki.com/api/v0/organizations", + "protocol": "https", + "host": [ + "dashboard", + "meraki", + "com" + ], + "path": [ + "api", + "v0", + "organizations" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "GET Inventory", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "// Store the Serial and Network ID of the first returned ", + "// device as environment variables ", + "var jsonData = JSON.parse(responseBody);", + "postman.setEnvironmentVariable(\"networkId\", jsonData[0].networkId);", + "postman.setEnvironmentVariable(\"serial\", jsonData[0].serial);", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Cisco-Meraki-API-Key", + "value": "{{X-Cisco-Meraki-API-Key}}" + } + ], + "body": {}, + "url": { + "raw": "https://dashboard.meraki.com/api/v0/organizations/{{organizationId}}/inventory", + "protocol": "https", + "host": [ + "dashboard", + "meraki", + "com" + ], + "path": [ + "api", + "v0", + "organizations", + "{{organizationId}}", + "inventory" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "GET Network Details", + "request": { + "method": "GET", + "header": [ + { + "key": "X-Cisco-Meraki-API-Key", + "value": "{{X-Cisco-Meraki-API-Key}}" + } + ], + "body": {}, + "url": { + "raw": "https://dashboard.meraki.com/api/v0/networks/{{networkId}}", + "protocol": "https", + "host": [ + "dashboard", + "meraki", + "com" + ], + "path": [ + "api", + "v0", + "networks", + "{{networkId}}" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "GET SSIDs", + "request": { + "method": "GET", + "header": [ + { + "key": "X-Cisco-Meraki-API-Key", + "value": "{{X-Cisco-Meraki-API-Key}}" + } + ], + "body": {}, + "url": { + "raw": "https://dashboard.meraki.com/api/v0/networks/{{networkId}}/ssids", + "protocol": "https", + "host": [ + "dashboard", + "meraki", + "com" + ], + "path": [ + "api", + "v0", + "networks", + "{{networkId}}", + "ssids" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "GET Device Details", + "request": { + "method": "GET", + "header": [ + { + "key": "X-Cisco-Meraki-API-Key", + "value": "{{X-Cisco-Meraki-API-Key}}" + } + ], + "body": {}, + "url": { + "raw": "https://dashboard.meraki.com/api/v0/networks/{{networkId}}/devices/{{serial}}", + "protocol": "https", + "host": [ + "dashboard", + "meraki", + "com" + ], + "path": [ + "api", + "v0", + "networks", + "{{networkId}}", + "devices", + "{{serial}}" + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "GET Device Clients", + "request": { + "method": "GET", + "header": [ + { + "key": "X-Cisco-Meraki-API-Key", + "value": "{{X-Cisco-Meraki-API-Key}}" + } + ], + "body": {}, + "url": { + "raw": "https://dashboard.meraki.com/api/v0/devices/{{serial}}/clients?timespan=86400", + "protocol": "https", + "host": [ + "dashboard", + "meraki", + "com" + ], + "path": [ + "api", + "v0", + "devices", + "{{serial}}", + "clients" + ], + "query": [ + { + "key": "timespan", + "value": "86400", + "equals": true + } + ] + }, + "description": "" + }, + "response": [] + }, + { + "name": "GET Networks", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "// Store the Network Id as Environment Variable ", + "// Requires the name of the Network to already be ", + "// set as an environment variable", + "var jsonData = JSON.parse(responseBody);", + "var netName = pm.environment.get(\"Network Name\");", + "for (var i in jsonData) {", + " if (jsonData[i].name === netName) {", + " postman.setEnvironmentVariable(\"networkId\", ", + " jsonData[i].id);", + " }", + "}", + "" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "X-Cisco-Meraki-API-Key", + "value": "{{X-Cisco-Meraki-API-Key}}" + } + ], + "body": {}, + "url": { + "raw": "https://dashboard.meraki.com/api/v0/organizations/{{organizationId}}/networks", + "protocol": "https", + "host": [ + "dashboard", + "meraki", + "com" + ], + "path": [ + "api", + "v0", + "organizations", + "{{organizationId}}", + "networks" + ] + }, + "description": "" + }, + "response": [] + } + ] + } + ] +} \ No newline at end of file diff --git a/postman_config/Sandbox ACI APIC Always On.postman_environment.json b/postman_config/Sandbox ACI APIC Always On.postman_environment.json new file mode 100644 index 0000000..301775e --- /dev/null +++ b/postman_config/Sandbox ACI APIC Always On.postman_environment.json @@ -0,0 +1,34 @@ +{ + "id": "49cb0574-0c4f-4cf7-8ce1-8208a785890e", + "name": "DevNet ACI APIC Sandbox Always On", + "values": [ + { + "enabled": true, + "key": "apic", + "value": "sandboxapicdc.cisco.com", + "type": "text" + }, + { + "enabled": true, + "key": "username", + "value": "admin", + "type": "text" + }, + { + "enabled": true, + "key": "password", + "value": "ciscopsdt", + "type": "text" + }, + { + "enabled": true, + "key": "port", + "value": "443", + "type": "text" + } + ], + "timestamp": 1506371182617, + "_postman_variable_scope": "environment", + "_postman_exported_at": "2017-11-20T23:16:54.897Z", + "_postman_exported_using": "Postman/5.3.2" +} \ No newline at end of file diff --git a/postman_config/Sandbox APIC-EM Always On.postman_environment.json b/postman_config/Sandbox APIC-EM Always On.postman_environment.json new file mode 100644 index 0000000..1d84763 --- /dev/null +++ b/postman_config/Sandbox APIC-EM Always On.postman_environment.json @@ -0,0 +1,52 @@ +{ + "id": "6e58ac01-8280-8394-304b-1fb54f20791b", + "name": "DevNet APIC-EM Sandbox Always On", + "values": [ + { + "enabled": true, + "key": "apic", + "value": "sandboxapicem.cisco.com", + "type": "text" + }, + { + "enabled": true, + "key": "username", + "value": "devnetuser", + "type": "text" + }, + { + "enabled": true, + "key": "password", + "value": "Cisco123!", + "type": "text" + }, + { + "enabled": true, + "key": "port", + "value": "443", + "type": "text" + }, + { + "enabled": true, + "key": "token", + "value": "ST-2004-4wKWgIKw7ZsIxXIplSIT-cas", + "type": "text" + }, + { + "enabled": true, + "key": "network_device_id", + "value": "8dbd8068-1091-4cde-8cf5-d1b58dc5c9c7", + "type": "text" + }, + { + "enabled": true, + "key": "host_id", + "value": "48cdeb9b-b412-491e-a80c-7ec5bbe98167", + "type": "text" + } + ], + "timestamp": 1508258445536, + "_postman_variable_scope": "environment", + "_postman_exported_at": "2017-11-20T23:17:11.634Z", + "_postman_exported_using": "Postman/5.3.2" +} \ No newline at end of file diff --git a/postman_config/Sandbox Meraki Always On.postman_environment.json b/postman_config/Sandbox Meraki Always On.postman_environment.json new file mode 100644 index 0000000..b3fe196 --- /dev/null +++ b/postman_config/Sandbox Meraki Always On.postman_environment.json @@ -0,0 +1,28 @@ +{ + "id": "0f2c6521-c8a9-51cc-c0b0-2e8520ca8130", + "name": "Sandbox Meraki", + "values": [ + { + "enabled": true, + "key": "X-Cisco-Meraki-API-Key", + "value": "e2aca9806dff8a983e8e21590e2e95416986ee9b", + "type": "text" + }, + { + "enabled": true, + "key": "Organization Name", + "value": "Meraki Live Sandbox", + "type": "text" + }, + { + "enabled": true, + "key": "Network Name", + "value": "Sandbox 1 - Galway Ireland", + "type": "text" + } + ], + "timestamp": 1511233220528, + "_postman_variable_scope": "environment", + "_postman_exported_at": "2017-11-21T03:00:22.661Z", + "_postman_exported_using": "Postman/5.3.2" +} \ No newline at end of file diff --git a/postman_config/Sandbox NX-OS Standalone.postman_environment.json b/postman_config/Sandbox NX-OS Standalone.postman_environment.json new file mode 100644 index 0000000..6d36569 --- /dev/null +++ b/postman_config/Sandbox NX-OS Standalone.postman_environment.json @@ -0,0 +1,28 @@ +{ + "id": "73cbbfdd-93f6-a8b4-a468-b50ec4c08c38", + "name": "Sandbox NX-OS Standalone", + "values": [ + { + "enabled": true, + "key": "host", + "value": "10.10.20.58", + "type": "text" + }, + { + "enabled": true, + "key": "username", + "value": "admin", + "type": "text" + }, + { + "enabled": true, + "key": "password", + "value": "cisco123", + "type": "text" + } + ], + "timestamp": 1506371182627, + "_postman_variable_scope": "environment", + "_postman_exported_at": "2017-11-20T23:33:47.194Z", + "_postman_exported_using": "Postman/5.3.2" +} \ No newline at end of file diff --git a/postman_config/Sandbox RESTCONF Always On.postman_environment.json b/postman_config/Sandbox RESTCONF Always On.postman_environment.json new file mode 100644 index 0000000..fe05ae7 --- /dev/null +++ b/postman_config/Sandbox RESTCONF Always On.postman_environment.json @@ -0,0 +1,34 @@ +{ + "id": "154579bc-c45e-516a-6a0c-815699215142", + "name": "Sandbox RESTCONF Always On", + "values": [ + { + "enabled": true, + "key": "host", + "value": "ios-xe-mgmt.cisco.com", + "type": "text" + }, + { + "enabled": true, + "key": "port", + "value": "9443", + "type": "text" + }, + { + "enabled": true, + "key": "username", + "value": "root", + "type": "text" + }, + { + "enabled": true, + "key": "password", + "value": "D_Vay!_10&", + "type": "text" + } + ], + "timestamp": 1506371182612, + "_postman_variable_scope": "environment", + "_postman_exported_at": "2017-11-20T23:16:18.056Z", + "_postman_exported_using": "Postman/5.3.2" +} \ No newline at end of file diff --git a/programming_fundamentals/README.md b/programming_fundamentals/README.md new file mode 100644 index 0000000..0ee9c0a --- /dev/null +++ b/programming_fundamentals/README.md @@ -0,0 +1,12 @@ +# Programming Fundamentals +In this module you will explore different options available for running code and hosting applications at the edge of the network, directly on switches, routers and other devices. + +## Lessons + +* [Data Formats: Understanding and using JSON, XML and YAML](data_formats/README.md) +* [APIs are Everywhere... but what are they?](apis/README.md) +* [REST APIs Part 1: HTTP is for more than Web Browsing](rest_part_1/README.md) +* [REST APIs Part 2: Making REST API Calls with Postman](rest_part_2/README.md) +* [Python Part 1: Python Language and Script Basics](python_part_1/README.md) +* [Python Part 2: Working with Libraries and Virtual Environments](python_part_2/README.md) +* [Python Part 3: Useful Python Libraries for Network Engineers](python_part_3/README.md) diff --git a/programming_fundamentals/apis/README.md b/programming_fundamentals/apis/README.md new file mode 100644 index 0000000..3efba28 --- /dev/null +++ b/programming_fundamentals/apis/README.md @@ -0,0 +1,2 @@ +# APIs are Everywhere... but what are they? +This lesson has no setup requirements. \ No newline at end of file diff --git a/programming_fundamentals/apis/requirements.txt b/programming_fundamentals/apis/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/programming_fundamentals/data_formats/GigabitEthernet2.json b/programming_fundamentals/data_formats/GigabitEthernet2.json new file mode 100644 index 0000000..47db544 --- /dev/null +++ b/programming_fundamentals/data_formats/GigabitEthernet2.json @@ -0,0 +1,15 @@ +{ + "ietf-interfaces:interface": { + "name": "GigabitEthernet2", + "description": "Wide Area Network", + "enabled": true, + "ietf-ip:ipv4": { + "address": [ + { + "ip": "172.16.0.2", + "netmask": "255.255.255.0" + } + ] + } + } +} diff --git a/programming_fundamentals/data_formats/GigabitEthernet2.xml b/programming_fundamentals/data_formats/GigabitEthernet2.xml new file mode 100644 index 0000000..6c7b3d3 --- /dev/null +++ b/programming_fundamentals/data_formats/GigabitEthernet2.xml @@ -0,0 +1,12 @@ + + + GigabitEthernet2 + Wide Area Network + true + +
+ 172.16.0.2 + 255.255.255.0 +
+
+
diff --git a/programming_fundamentals/data_formats/GigabitEthernet2.yaml b/programming_fundamentals/data_formats/GigabitEthernet2.yaml new file mode 100644 index 0000000..a007b16 --- /dev/null +++ b/programming_fundamentals/data_formats/GigabitEthernet2.yaml @@ -0,0 +1,9 @@ +--- +ietf-interfaces:interface: + name: GigabitEthernet2 + description: Wide Area Network + enabled: true + ietf-ip:ipv4: + address: + - ip: 172.16.0.2 + netmask: 255.255.255.0 diff --git a/programming_fundamentals/data_formats/README.md b/programming_fundamentals/data_formats/README.md new file mode 100644 index 0000000..a40f8a9 --- /dev/null +++ b/programming_fundamentals/data_formats/README.md @@ -0,0 +1,15 @@ +# Data Formats: Understanding and using JSON, XML and YAML + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/programming_fundamentals/data_formats` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/programming_fundamentals/data_formats +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +## DevNet Sandbox +No Sandbox is required for this lesson. \ No newline at end of file diff --git a/programming_fundamentals/data_formats/address_list.json b/programming_fundamentals/data_formats/address_list.json new file mode 100644 index 0000000..ed08bab --- /dev/null +++ b/programming_fundamentals/data_formats/address_list.json @@ -0,0 +1,16 @@ +{ + "addresses": [ + { + "ip": "172.16.0.2", + "netmask": "255.255.255.0" + }, + { + "ip": "172.16.0.3", + "netmask": "255.255.255.0" + }, + { + "ip": "172.16.0.4", + "netmask": "255.255.255.0" + } + ] +} diff --git a/programming_fundamentals/data_formats/address_list.xml b/programming_fundamentals/data_formats/address_list.xml new file mode 100644 index 0000000..9578400 --- /dev/null +++ b/programming_fundamentals/data_formats/address_list.xml @@ -0,0 +1,13 @@ + + + 172.16.0.2 + 255.255.255.0 + + + 172.16.0.3 + 255.255.255.0 + + + 172.16.0.4 + 255.255.255.0 + diff --git a/programming_fundamentals/data_formats/address_list.yaml b/programming_fundamentals/data_formats/address_list.yaml new file mode 100644 index 0000000..50d463d --- /dev/null +++ b/programming_fundamentals/data_formats/address_list.yaml @@ -0,0 +1,8 @@ +--- +addresses: +- ip: 172.16.0.2 + netmask: 255.255.255.0 +- ip: 172.16.0.3 + netmask: 255.255.255.0 +- ip: 172.16.0.4 + netmask: 255.255.255.0 diff --git a/programming_fundamentals/data_formats/requirements.txt b/programming_fundamentals/data_formats/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/programming_fundamentals/python_part_1/README.md b/programming_fundamentals/python_part_1/README.md new file mode 100644 index 0000000..d457f24 --- /dev/null +++ b/programming_fundamentals/python_part_1/README.md @@ -0,0 +1,20 @@ +# Python Part 1: Python Language and Script Basics + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/programming_fundamentals/python_part_1` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/programming_fundamentals/python_part_1 +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 3.6. A recent version of Python 2.7 or Python 3.5 should also work. + +***Note: During this lesson you will explore the basics of Python.*** + +## DevNet Sandbox +No Sandbox is required for this lesson. \ No newline at end of file diff --git a/programming_fundamentals/python_part_1/requirements.txt b/programming_fundamentals/python_part_1/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/programming_fundamentals/python_part_2/README.md b/programming_fundamentals/python_part_2/README.md new file mode 100644 index 0000000..fb54198 --- /dev/null +++ b/programming_fundamentals/python_part_2/README.md @@ -0,0 +1,20 @@ +# Python Part 2: Working with Libraries and Virtual Environments + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/programming_fundamentals/python_part_2` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/programming_fundamentals/python_part_2 +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 3.6. A recent version of Python 2.7 or Python 3.5 should also work. + +***Note: During this lesson you will learn about Python Virtual Environments and Libraries and practice using these tools.*** + +## DevNet Sandbox +No Sandbox is required for this lesson. \ No newline at end of file diff --git a/programming_fundamentals/python_part_2/requirements.txt b/programming_fundamentals/python_part_2/requirements.txt index 84847ba..e69de29 100644 --- a/programming_fundamentals/python_part_2/requirements.txt +++ b/programming_fundamentals/python_part_2/requirements.txt @@ -1,3 +0,0 @@ -requests -ncclient -pyang diff --git a/programming_fundamentals/python_part_3/README.md b/programming_fundamentals/python_part_3/README.md new file mode 100644 index 0000000..ef92776 --- /dev/null +++ b/programming_fundamentals/python_part_3/README.md @@ -0,0 +1,50 @@ +# Python Part 3: Useful Python Libraries for Network Engineers + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/programming_fundamentals/python_part_3` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/programming_fundamentals/python_part_3 +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 3.6. A recent version of Python 2.7 or Python 3.5 should also work. + +It is highly recommended to leverage Python Virtual Environments for completing exercises in this course. + +*There is no need to create independent venv for each lesson, but you can if you choose. At a minimum you should create 2 venvs, one for Python 2 and one for Python 3.* + +Follow these steps to create and activate a venv. + +***Note: If you are leveraging a shared venv across all lessons simply activate it.*** + +```bash +# OS X or Linux +virtualenv venv --python=python3 +source venv/bin/activate +``` + +```bash +# Windows (assumes Python 3 is default) +virtualenv venv +venv/Scripts/activate +``` + +#### Install Python Requirements for Lesson +With the Virtual Environment activated, use pip to install the necessary requirements. + +```bash +# From the code directory for this lesson +pip install -r requirements.txt +``` + +***Note: During the lesson, there are instructions to `pip install` different libraries. If you follow this setup, you will already have the libraries installed, but still run the commands to become familiar with using them*** + +## DevNet Sandbox +This lesson leverages the [IOS XE Programmability](https://devnetsandbox.cisco.com/RM/Diagram/Index/7fd27b24-7034-477d-9ad2-e2c8096dd1a5?diagramType=Topology) Sandbox. + +You will need to reserve an instance of the sandbox, and establish a VPN connection to your individual Sandbox to complete this lab. diff --git a/programming_fundamentals/python_part_3/requirements.txt b/programming_fundamentals/python_part_3/requirements.txt index 84847ba..ea5fd90 100644 --- a/programming_fundamentals/python_part_3/requirements.txt +++ b/programming_fundamentals/python_part_3/requirements.txt @@ -1,3 +1,5 @@ -requests -ncclient -pyang +ncclient==0.5.3 +netmiko==1.4.2 +PyYAML==3.12 +requests==2.18.2 +xmltodict==0.11.0 diff --git a/programming_fundamentals/rest_part_1/README.md b/programming_fundamentals/rest_part_1/README.md new file mode 100644 index 0000000..41c5364 --- /dev/null +++ b/programming_fundamentals/rest_part_1/README.md @@ -0,0 +1,20 @@ +# REST APIs Part 1: HTTP is for more than Web Browsing + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/programming_fundamentals/rest_part_1 ` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/programming_fundamentals/rest_part_1 +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + + +## DevNet Sandbox +This lesson leverages the [Always On: NETCONF/YANG & RESTCONF on IOS XE](https://devnetsandbox.cisco.com/RM/Diagram/Index/27d9747a-db48-4565-8d44-df318fce37ad?diagramType=Topology) Sandbox. This sandbox requires no reservation **or** VPN connection. + +***Note: In the video, a different DevNet Sandbox is used*** + +When running the `curl` for the RESTCONF example, leverage `https://ios-xe-mgmt.cisco.com:9443` as the URL instead of `https://10.10.20.21`. \ No newline at end of file diff --git a/programming_fundamentals/rest_part_1/curl_examples.sh b/programming_fundamentals/rest_part_1/curl_examples.sh new file mode 100644 index 0000000..92c944f --- /dev/null +++ b/programming_fundamentals/rest_part_1/curl_examples.sh @@ -0,0 +1,21 @@ +# Learning Series: Network Programmability Basics +# Module: Programming Fundamentals +# Lesson: REST Part 1 +# Author: Hank Preston +# +# curl_examples.sh +# Illustrate the following concepts: +# - REST API Basics +# - Leveraging curl utility + +# Example 1: Random Chuck Norris Joke +curl https://api.icndb.com/jokes/random + +# Example 2: Nerdy Chuck Norris Joke +curl https://api.icndb.com/jokes/random?limitTo=nerdy + +# Example 3: Network Programmability with RESTCONF +curl -vk \ + -u root:cisco123 \ + -H 'accept: application/yang-data+json' \ + https://ios-xe-mgmt.cisco.com:9443/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet2 diff --git a/programming_fundamentals/rest_part_1/requirements.txt b/programming_fundamentals/rest_part_1/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/programming_fundamentals/rest_part_2/README.md b/programming_fundamentals/rest_part_2/README.md new file mode 100644 index 0000000..fb776b9 --- /dev/null +++ b/programming_fundamentals/rest_part_2/README.md @@ -0,0 +1,54 @@ +# REST APIs Part 2: Making REST API Calls with Postman + +## "Gitting" the Code +All of the code and examples for this lesson is located in the `netprog_basics/programming_fundamentals/rest_part_2` directory. Clone and access it with the following commands: + +```bash +git clone https://github.com/CiscoDevNet/netprog_basics +cd netprog_basics/programming_fundamentals/rest_part_2 +``` + +## Local Workstation Setup +Be sure to complete the [General Workstation Setup](https://github.com/CiscoDevNet/netprog_basics/readme_resources/workstation_setup.md) instructions before beginning this lesson. + +### Postman Setup +During this lesson the Postman client for making REST API calls is used. For convenience we have included a `postmane_collection.json` file that contains all the REST API calls leveraged in the different lessons, and `postman_environment.json` files for each of the DevNet Sandboxes leveraged across the lessons. These files are all located in the [postman_config](https://github.com/CiscoDevNet/netprog_basics/postman_config) directory in the code repository. + +To leverage them, simply `Import` them into your Postman client. + +1. Collections: Use the **Import** button in the upper left corner of the client. +2. Environments: Use the **Import** button from the `Manage Environments` interface of the client. + +### Python Environment Setup +It is recommended that this lesson be completed using Python 3.6. A recent version of Python 2.7 or Python 3.5 should also work. + +It is highly recommended to leverage Python Virtual Environments for completing exercises in this course. + +*There is no need to create independent venv for each lesson, but you can if you choose. At a minimum you should create 2 venvs, one for Python 2 and one for Python 3.* + +Follow these steps to create and activate a venv. + +***Note: If you are leveraging a shared venv across all lessons simply activate it.*** + +```bash +# OS X or Linux +virtualenv venv --python=python3 +source venv/bin/activate +``` + +```bash +# Windows (assumes Python 3 is default) +virtualenv venv +venv/Scripts/activate +``` + +#### Install Python Requirements for Lesson +With the Virtual Environment activated, use pip to install the necessary requirements. + +```bash +# From the code directory for this lesson +pip install -r requirements.txt +``` + +## DevNet Sandbox +This lesson leverages the [Always On: APIC-EM](https://devnetsandbox.cisco.com/RM/Diagram/Index/2e0f9525-5f46-4f46-973e-0f0c1bf934fa?diagramType=Topology) Sandbox. This sandbox requires no reservation **or** VPN connection. \ No newline at end of file diff --git a/programming_fundamentals/rest_part_2/requirements.txt b/programming_fundamentals/rest_part_2/requirements.txt new file mode 100644 index 0000000..29abca2 --- /dev/null +++ b/programming_fundamentals/rest_part_2/requirements.txt @@ -0,0 +1 @@ +requests==2.18.2