Skip to content

Hands-On Exercises

Lab Overview

The lab environment runs in a Docker Container and contains references for all of the cURL scripts and Python Requests code that you will build. A PowerPoint Presentation file will guide you through each of the following exercises:

  1. cURL Introduction.
  2. Python Requests Introduction.
  3. ACI1
  4. DNAC1
  5. Meraki1
  6. vManage SD-WAN1
  7. Webex1

:fontawesome-solid-tools: Lab Requirements

You only need a few things to start working through the hands-on exercises:

  1. A Docker runtime environment.

  2. An IDE tool2.

  3. A terminal program.

  4. Microsoft PowerPoint.


Lab Setup Instructions

Follow these steps to set up the hands-on lab environment:

Lab Setup Directions

Attention

  • This option assumes you have an operational Docker runtime environment and that your Docker daemon can connect to and download images from Docker Hub.
  • The screenshots in the directions represent an example from a macOS Terminal, and the same commands and procedures also work with Windows PowerShell.
Step 1
  1. Copy the following command to your clipboard.

    docker run -it --name curl-pyreq1 wwt01/curl-pyreq
    
  2. Open a terminal shell on the same system as your Docker runtime environment.

  3. Paste the command into your terminal shell.
  4. Press your Enter or Return key to run the command.

1_docker_run

2_docker_pull

Tip

You will know your Container is active and ready for use when your terminal prompt changes to something like this:

root@da343f292e5a:/code#

3_docker_container_prompt

Docker Command Details

The Docker Command performs the following actions:

  1. Downloads the wwt01/curl-pyreq Docker Image from Docker Hub.
  2. Creates a new Docker Container with the name curl-pyreq1
  3. Attaches to the Container shell.
Step 2

Click the botton below to download the instructional Microsoft PowerPoint slides:

4_powerpoint_download

Step 3

Open the PowerPoint Presentation.

5_powerpoint_slides

Step 4

Complete each of the exercises, in sequence:

  1. The slides provide command examples for you to follow:

    6_powerpoint_code_example

  2. The presenter notes provide step-by-step instructions to guide you through each slide and exercise.

  3. After each cURL command entry or Python Requests code run, a slide with a screen recording will show you what you should expect to see:

    7_powerpoint_screen_recording_example

  4. Enter the cURL command examples in your Container prompt.

  5. Use the Container's Python REPL to enter the Python Request code examples.

Attention

There may be some slight variances between the output in the screen recordings and the output in your Docker environment, although each of the cURL commands and Python Requests code blocks should run successfully.

Lab Environment Shutdown and Restart

To shut down the lab environment, from your terminal window press Ctrl+D and wait for the terminal prompt to change back to its standard development computer prompt.

8_docker_stop_and_exit

Lab Environment Docker Command Reference

Use the following commands to manage your Docker lab environment:

  • Restart an existing lab environment Container (restores previous lab progress):
docker start curl-pyreq1
  • Delete an existing lab environment Container (removes previous lab progress):
docker stop curl-pyreq1
docker rm curl-pyreq1
  • Remove the Docker Image:
docker stop curl-pyreq1
docker rm curl-pyreq1
docker rmi wwt01/curl-pyreq

Tips

  1. Start the PowerPoint presentation in slide show mode for an authentic step-by-step walkthrough experience.

    • Slide animations will advance through a series of small, more consumable steps.
    • If you have a second monitor, you can click through the slide show and read the instructions in the presentation script simultaneously.
  2. The Git repository includes a resources directory where you can find subdirectories, organized by topic and REST API platform.

    • All of the shell scripts and Python code in the PowerPoint slides, are in curl and python subdirectories.
    • Both the curl and python directories contain subdirectories for each section of the presentation (examples, ACI, DNAC, etc.).
    • Keep the Git repository open in a browser window if you want a quick reference for any of the cURL commands or Python Requests code.

Feedback, Issues, & Contributions

What can you do you need some help? If you:

  • Run into a problem with the lab.
  • Have a question about the presentation content.
  • Want to make a suggestion
  • Want to make your own contribution to this project.

Please, open an Issue or create a Pull Request. This repository is a community project, and your feedback will make the learning experience better for you and those who follow you in their learning journeys.


  1. Includes the following sub-sections: Platform-Specific API Overview, cURL REST API exercises, and Python Requests REST API exercises. 

  2. Optional. You may use the Python REPL in the Docker Container to enter the Python Requests code examples.