Closed MianMuhammadTalhaIqbal closed 3 years ago
Sorry, the words were not originally written for that context. For the first mention of "previous labs," the intention is that you would use the Module found in https://developer.cisco.com/learning/modules/dnac-rest-apis.
For the second mention of "instructions in the BYOD section" you would use the instructions found in the "How To Setup Your Own Computer" in the blue banner as this screenshot shows. Apologies for the confusion, we'll fix the text. Thanks for reporting!
Thank you so much
Sorry for bothering you again @annegentle I need a little help. Is there anything wrong with the above code. I'm getting the following error while running this script.
Hi @MianMuhammadTalhaIqbal -- that error is due to the Python code in our Learning Labs not ignoring SSL warnings. If you want to have the code ignore SSL errors, you can use the example in the DNA Center documentation: https://developer.cisco.com/docs/dna-center/#!authentication-and-authorization/code
The revision to the Learning Labs code is like so:
import requests
from requests.auth import HTTPBasicAuth
from dnac_config import DNAC, DNAC_PORT, DNAC_USER, DNAC_PASSWORD
import urllib3
urllib3.disable_warnings()
# Notice the two lines above are added so that SSL warnings are disabled
def get_auth_token():
"""
Building out Auth request. Using requests.post to make a call to the Auth Endpoint
"""
url = 'https://sandboxdnac.cisco.com/dna/system/api/v1/auth/token' # Endpoint URL
resp = requests.post(url, auth=HTTPBasicAuth(DNAC_USER, DNAC_PASSWORD), verify=False) # Make the POST Request, notice the verify=False addition
token = resp.json()['Token'] # Retrieve the Token from the returned JSON
print("Token Retrieved: {}".format(token)) # Print out the Token
return token # Create a return statement to send the token back for later use
if __name__ == "__main__":
get_auth_token()
Thank you so much
Closing issue since code can be written either way.
https://developer.cisco.com/certification/exam-topic-associate/ Devnet Associate Exam v1.0 (200-901)
3.0 Cisco Platforms and Development Module Problem#1 Pre-Requisite: You should also have an understanding of these foundational topics: 1) The previous labs in the "Introduction to Cisco DNA Center Programmability" Learning Lab Module.
Cannot find this previous lab
Problem#2: Cisco DNA Center Northbound API "Hello Network: Step 1: Postman collection, environment and Cisco DNA Center token Following the instructions in the BYOD section at the top of this learning lab you should have successfully imported the Postman collection and environment. If everything went well you should see the following image:
Cannot find BYOD section at the top of this learning lab...
Please help.....