exam questions

Exam 200-901 All Questions

View all questions & answers for the 200-901 exam

Exam 200-901 topic 1 question 33 discussion

Actual exam question from Cisco's 200-901
Question #: 33
Topic #: 1
[All 200-901 Questions]

Refer to the exhibit.

What does the Python function do?

  • A. It returns HTTP Basic Authentication.
  • B. It returns DNAC user and password.
  • C. It reads a token from a local JSON file and posts the token to the DNAC URL.
  • D. It returns an authorization token.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Requium
Highly Voted 4 years, 5 months ago
D: https://developer.cisco.com/learning/lab/dnav3-dnac-nbapi-hello-world/step/4
upvoted 55 times
...
xXAzazelXx
Highly Voted 4 years, 4 months ago
import requests from requests.auth import HTTPBasicAuth def get_auth_token(): url = 'https://sandboxdnac.cisco.com/dna/system/api/v1/auth/token' resp = requests.post(url, auth=HTTPBasicAuth("devnetuser", "Cisco123!")) token = resp.json()['Token'] print(token) return token I think it is D, as the print out is: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI1ZTlkYmI3NzdjZDQ3ZTAwNGM2N2RkMGUiLCJhdXRoU291cmNlIjoiaW50ZXJuYWwiLCJ0ZW5hbnROYW1lIjoiVE5UMCIsInJvbGVzIjpbIjVkYzQ0NGQ1MTQ4NWM1MDA0YzBmYjIxMiJdLCJ0ZW5hbnRJZCI6IjVkYzQ0NGQzMTQ4NWM1MDA0YzBmYjIwYiIsImV4cCI6MTU5NDMwNjI0OSwiaWF0IjoxNTk0MzAyNjQ5LCJqdGkiOiIwY2Q5YjQyYy1iNWU2LTQ5ZTEtODVjZC1mZWI2MWY2NjQ5ZjYiLCJ1c2VybmFtZSI6ImRldm5ldHVzZXIifQ.OZk5uvMSmC2wG7AIXND_0FNdxTRgpXwiVnO2Vi4eM3uoGV28zYV4da12kchBKvqO9Rkc3SYppCzZXK_bVZ7jObKkWN6SBF_KFUo3avoFee-XCgzznTd2NBBoyu_0fyBinWwF_NX3tIQRX4TMgHdvKtKBVeYPAtSE-qHDUGVLAA7VoWuDipE-ktvo4BigYfSptXxTRtTOa1_vTsrwQ0PGiLWNzKA6ruBiCb8i_Tgo7x93MUp0tNy5866Fn51Ix8lcIhW1D0eRCTOZNe-J2e0QYNrAV1Xtv3zpS1p75joEq0kpdjon7NB6lGjFeUV_vGR9IXTQVhKY6KDan7SgCpMvUQ
upvoted 15 times
...
julian_1306
Most Recent 1 year, 5 months ago
Selected Answer: D
Its the D seach here (ctrl + f ) for : will return an Authorization Token The cisco page says that return authorization token , so de discustion over authorization and authentication is ended . and also its super obvios that return a token. https://developer.cisco.com/site/dnac-101/
upvoted 4 times
...
aniket2610
1 year, 6 months ago
Selected Answer: A
Keyword - Authentication vs Authorization token
upvoted 1 times
...
Pelau_the_Engineer
1 year, 10 months ago
C. It reads a token from a local JSON file and posts the token to the DNAC URL. The Python function in the exhibit appears to read a token from a local JSON file by calling the json.load() function and passing in the file name as an argument. Then it makes a POST request to a specific URL using the requests.post() function and passing in the URL, the token and headers as arguments. The script also sets verify=False in the post method which could indicate that it is skipping SSL/TLS verification. Given the context of the question (DNAC) and the parameters passed to the post method, it can be inferred that the script is likely interacting with the Cisco DNA Center (DNAC) API and the token read from the local JSON file is an authentication token that the script is using to authenticate to the DNAC API.
upvoted 1 times
herrmann69
10 months, 1 week ago
C is wrong Are we looking at the same input? Where do you read "json.load()"?
upvoted 1 times
...
...
mellohello
1 year, 11 months ago
Selected Answer: D
Option A, "It returns HTTP Basic Authentication," is incorrect. While the function does use HTTP Basic Authentication to authenticate the request, it does not return the authentication itself. Option B, "It returns DNAC user and password," is also incorrect. The function does not return the DNAC_USER and DNAC_PASSWORD variables. Option C, "It reads a token from a local JSON file and posts the token to the DNAC URL," is also incorrect. The function does not read a token from a local JSON file and does not post a token to the DNAC URL. Instead, it makes an HTTP POST request to the DNAC URL and parses the response from the server as JSON.
upvoted 2 times
...
macxsz
2 years, 6 months ago
Selected Answer: D
D. It does not POST anything, it returns a token
upvoted 2 times
...
kibo_muc
2 years, 7 months ago
Selected Answer: D
The right answer should be D as the function is returning a token.
upvoted 2 times
...
sds85
2 years, 9 months ago
And D its authorization no authentication
upvoted 1 times
...
sds85
2 years, 9 months ago
Selected Answer: A
https://en.wikipedia.org/wiki/Basic_access_authentication
upvoted 1 times
Iam_someone
2 years, 7 months ago
Your first problem is relying on Wiki
upvoted 5 times
...
...
designated
2 years, 9 months ago
Selected Answer: D
D, it is returning a token.
upvoted 2 times
...
parkjunsung
2 years, 9 months ago
Selected Answer: D
D: https://developer.cisco.com/learning/lab/dnav3-dnac-nbapi-hello-world/step/4
upvoted 1 times
...
Ernick
2 years, 11 months ago
Selected Answer: D
D is correct
upvoted 1 times
...
dem159
3 years ago
Selected Answer: D
The right answer is D because the function is returning the token.
upvoted 2 times
...
CaptainPirate
3 years ago
D Is wrong.It says Authorization Token.It wld be correct if it was Authentication token.
upvoted 1 times
...
bluesky2022
3 years, 1 month ago
Answer D, returns the token. Basic Auth is just a header not a value in python.
upvoted 1 times
...
lupindepin
3 years, 1 month ago
D because token = resp.json()['Token'] is corresponding to the response json payload which key is "token", so value will be the token
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...