Skip to content
This repository was archived by the owner on Aug 21, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions module03/03-environment-03-mission/hello_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@

# we need to know our token
TOKEN = 'insert-your-token-from-developer.ciscospark.com-here'
NAME = 'existing-event-room-name-inserted-here'
NAME = 'existing-event-room-name-inserted-here'
RESTCONF = 'insert-restconf-ip-or-url-here'
APIC_EM = 'insert-apic-em-ip-or-url-here'


#Function to check if restconf is accessible
def check_restconf(address):
# Retconf enabled device's address and default entry level
restconf_api= "https://"+address+"/api"
# Retconf enabled device's address and default entry level
restconf_api= "http://"+address+":8008/api"

# Parameter passed during the call
params = {"verbose" : ""}

# Necessary headers to make an API call
headers = {
"authorization" : "Basic cm9vdDpDIXNjMDEyMw==",
"authorization" : "Basic YWRtaW46QzFzY28xMjM0NQ==",
"content-type" : "application/vnd.yang.data+json",
"accept" : "application/vnd.yang.api+json"
}
Expand All @@ -46,8 +46,8 @@ def check_apic_em(address):
"content-type": "application/json"
}
payload = {
"username" : "devnetuser",
"password" : "Cisco123!"
"username" : "admin",
"password" : "C1sco12345"
}
#Making Rest call
apic_em_response = requests.post(apic_em_api, headers=headers, data=json.dumps(payload), verify=False)
Expand Down Expand Up @@ -80,4 +80,3 @@ def check_apic_em(address):
else:
spark_send_message(TOKEN, room_id, 'Unfortunately, APIC-EM is working properly.\n')
print("Please check room " + NAME + ", there are messages posted on your behalf")

Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
# the variables below assume the user is leveraging the
# network programmability lab and accessing csr1000v
# use the IP address or hostname of your CSR1000V device
HOST = 'ios-xe-mgmt.cisco.com'
HOST = '198.18.133.218'
# use the NETCONF port for your CSR1000V device
PORT = 10000
PORT = 2022
# use the user credentials for your CSR1000V device
USER = 'root'
PASS = 'C!sc0123'

USER = 'admin'
PASS = 'C1sco12345'

# create a main() method
def main():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
# the variables below assume the user is leveraging the
# network programmability lab and accessing csr1000v
# use the IP address or hostname of your CSR1000V device
HOST = 'ios-xe-mgmt.cisco.com'
HOST = '198.18.133.218'
# use the NETCONF port for your CSR1000V device
PORT = 10000
PORT = 2022
# use the user credentials for your CSR1000V device
USER = 'root'
PASS = 'C!sc0123'
USER = 'admin'
PASS = 'C1sco12345'

# create a main() method
def main():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
# the variables below assume the user is leveraging the
# network programmability lab and accessing csr1000v
# use the IP address or hostname of your CSR1000V device
HOST = 'ios-xe-mgmt.cisco.com'
HOST = '198.18.133.218'
# use the NETCONF port for your CSR1000V device
PORT = 10000
PORT = 2022
# use the user credentials for your CSR1000V device
USER = 'root'
PASS = 'C!sc0123'
USER = 'admin'
PASS = 'C1sco12345'


# create a main() method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
# the variables below assume the user is leveraging the
# network programmability lab and accessing csr1000v
# use the IP address or hostname of your CSR1000V device
HOST = 'ios-xe-mgmt.cisco.com'
HOST = '198.18.133.218'
# use the NETCONF port for your CSR1000V device
PORT = 10000
PORT = 2022
# use the user credentials for your CSR1000V device
USER = 'root'
PASS = 'C!sc0123'
USER = 'admin'
PASS = 'C1sco12345'
MODULE_NAME = 'ietf-interfaces.yang'


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
# the variables below assume the user is leveraging the
# network programmability lab and accessing csr1000v
# use the IP address or hostname of your CSR1000V device
HOST = 'ios-xe-mgmt.cisco.com'
HOST = '198.18.133.218'
# use the NETCONF port for your CSR1000V device
PORT = 10000
PORT = 2022
# use the user credentials for your CSR1000V device
USER = 'root'
PASS = 'C!sc0123'
USER = 'admin'
PASS = 'C1sco12345'
# XML file to open
FILE = 'get_interfaces.xml'

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"id": "1a8f4537-91f1-04b5-397a-d5fbc47c4c39",
"name": "dCloud",
"values": [
{
"key": "host",
"value": "198.18.133.218",
"type": "text",
"enabled": true
},
{
"key": "port",
"value": "8008",
"type": "text",
"enabled": true
},
{
"key": "username",
"value": "admin",
"type": "text",
"enabled": true
},
{
"key": "password",
"value": "C1sco12345",
"type": "text",
"enabled": true
}
],
"timestamp": 1473883564692,
"_postman_variable_scope": "environment",
"_postman_exported_at": "2016-09-14T20:06:09.958Z",
"_postman_exported_using": "Postman/4.7.1"
}

This file was deleted.

Loading