You are on page 1of 31

Getting Setup and Verifying

the Lab Environment


Module 2

Citlalli Amoros / Rogelio Valtierra


APO SE
Agosto 3, 2020
The Game Plan!

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
DEVNET Express
Algunos puntos a considerar:

 Laptop

 Prepara tu ambiente virtual

 Cliente de VPN Cisco Anyconnect versión 4 en adelante instalado. En caso de no tenerlo


en este link lo pueden descargar para MAC o WIN:
https://cisco.box.com/s/ee57vqi2wvmx49z041is2qombi5eq2yu

 Cliente para conexión a escritorio remoto, si utilizan MAC el de Microsoft es


recomendable

 Tener una cuenta de Webex teams en https://www.webex.com/team-collaboration.html


pueden crear una de prueba en el botón “Try teams free”
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Get you setup and ready to code!
1. Locate the Lab Instructions.
2. Choose which development environment you will use, and get
connected.
3. Setup your development environment.
1. Download the sample code to your development environment.
2. Create a Python virtual environment and install some packages.
3. Add the API keys to your development environment.
4. Install the Postman collections.

4. Verify your development environment can access the Meraki APIs.

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Locate the Lab Instructions

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
https://developer.cisco.com/learning/devnet-
express/devnet-express-meraki

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
DevNet Learning Labs | Terminology

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Choose and Connect:
Your Development Environment

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Which Development Environment will you use?
Local Dev Environment Remote Dev Environment

Use your local environment... Use the remote environment...


If you have a functional Python If you do not have a functional
development environment on your Python development environment
laptop that you want to use. on your laptop.
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Option 1:
Your Local Development Environment

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Your Local Environment
You will need the following on your laptop...
• Text Editor
Preferably one designed for coding and that understands Python syntax

• Bash Shell
• Python 3.6+ Interpreter
The code samples have been developed and tested with Python v3.6+

• Postman
• Internet Connectivity
The Meraki APIs are served from the cloud. You’ll need to be able to connect to these.

...and you will need to be comfortable using these tools the way you have them configured.
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Option 2:
The Remote Development Environment

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Connecting to the Remote Development Environment
Two Ways

Browser www
HTTPS RDP

“Guacamole”

RDP Client RDP RDP


+
AnyConnect
VPN

AnyConnect

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Connecting to the
Remote Development Environment
Using the Web Portal:
1. Browse to the Web
Portal URL.
2. Login using the VPN
Username & VPN
Password if prompted.
3. Click on the “CentOS”
workstation.

Using AnyConnect + RDP:


1. Copy & paste the VPN
hostname into your
AnyConnect Client.
2. Connect using the VPN
Username and VPN
Password.
3. Connect to the RDP IP
using the RDP Username
and RDP Password.
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Tips to make your life better...
• Do all of your work in the remote lab environment:
• Open the Lab Instructions using the browser in the remote environment.
https://developer.cisco.com/learning/devnet-express/devnet-express-meraki
• Open the Webex Teams web client in a separate tab in the remote
browser.
https://web.webex.com
• This will make copying and pasting URLs, tokens, and etc. much easier!
• If you need to copy and paste text between your local workstation
and the remote workstation, remember the keyboard shortcut:

Control + Alt + Shift


© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
CentOS Power User Tips
Window Management
• “Snap Windows” with
“Win + Left/Right Arrow”
(“Cmd + arrow on MacOS)

Copy/Paste Shortcuts in CentOS


• Control + C/V except…
• Control + Shift + C/V in Terminal

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Finding the Code Editor | Atom

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Setup your
Dev Environment

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Download “git” the Code!
https://github.com/CiscoDevNet/meraki-code
• Open bash terminal, and run the following commands.
# Change to where you want your code
cd ~/code

# Clone the code


git clone https://github.com/CiscoDevNet/meraki-code

# Change into the repository directory


cd meraki-code

• Remember this location! You’ll start here for every lab.


© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Create a Python Virtual Environment
This will create a “clean” Python environment that will allow us to run all
of the labs and missions.

# Mac or Linux

python3.6 –m venv venv


source venv/bin/activate
pip install –r requirements.txt

# Windows
py -3 –m venv venv
source venv/Scripts/activate
pip install –r requirements.txt

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Prepare your Lab Environment File(s)
• Open ~/code/meraki-code/env_user.py in your code editor.
• Add:
• Your Webex Teams Access Token | We’ll show you where to get it.
• Webex Teams Room ID | We will share this with you in our Webex Teams space.

• Meraki API Key | We will share this with you in our Webex Teams space.

# User Input

WT_ACCESS_TOKEN = ""
WT_ROOM_ID = ""
MERAKI_API_KEY = "6bec40cf957de430a6f1f2baa056b99a4fac9ea0"

# End User Input


Example portion of env_lab.py
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Get Your Webex Teams Access Token
Get your WebEx Teams Access Token at:
https://developer.webex.com/docs/api/getting-started

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Install the Postman Collections
1. Open Postman.
2. Click Import
3. Select all of the files in:
~/code/meraki-code/postman

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Verify!
Run the verify.py script to verify your development environment has
been setup successfully.
Issues?
 Ensure you are working in the ~/code/meraki-code directory.
 Ensure your Python virtual environment is active.

 Ensure you have saved your env_user.py file.

# Mac or Linux

python verify.py

# Windows

py verify.py

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Wrap Up

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
What you learned in this module…
• Choose your Development Environment and connect to your lab pod
• Clone the Code Repository
• Setup Python Virtual Environment
• Install Postman Collection and Environments
• Prepare Lab Environment Files
• Run Verification Script

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Connect with Us and share Your Story…

@CiscoDevNet
#DevNetExpress
facebook.com/ciscodevnet/
http://github.com/CiscoDevNet developer.cisco.com
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
@CiscoDevNet | #DevNetExpress
Reference

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Super Secret Guacamole Keyboard Shortcut

Control + Alt + Shift

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
@CiscoDevNet | #DevNetExpress

You might also like