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:
git clone https://github.com/CiscoDevNet/netprog_basics
cd netprog_basics/programming_fundamentals/rest_part_2
Be sure to complete the General Workstation Setup instructions before beginning this lesson.
During this lesson the Postman client for making REST API calls is used. For convenience we have included a postman_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 directory in the code repository.
To leverage them, simply Import
them into your Postman client.
- Collections: Use the Import button in the upper left corner of the client.
- Environments: Use the Import button from the
Manage Environments
interface of the client.
Reminder: Many network devices leverage self-signed certificates for
https://
APIs. Don't forget to turn OFF SSL certificate checking within Postman settings.
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.
# OS X or Linux
virtualenv venv --python=python3
source venv/bin/activate
# Windows (assumes Python 3 is default)
virtualenv venv
venv/Scripts/activate
With the Virtual Environment activated, use pip to install the necessary requirements.
# From the code directory for this lesson
pip install -r requirements.txt
This lesson leverages the Always On: APIC-EM Sandbox. This sandbox requires no reservation or VPN connection.
You can download the slides for this lesson here.
Suggestion: Right click, "Open in new tab"