CCNP 350-401 ENCOR Question 539 DISCUSSION

  • 1151 views
  • 2023-07-05
« Back to Main Menu

Which Python code snippet must be added to the script to save the returned configuration as a JSON-formatted file?

Q539

A. 
with open(“ifaces.json”, “w”) as OutFile:
 OutFile.write(Response.text)

B. 
with open(“ifaces.json”, “w”) as OutFile:
 OutFile.write(Response.json())

C. 
with open(“ifaces.json”, “w”) as OutFile:
 JSONResponse = json.loads(Response.text)
 OutFile.write(JSONResponse)

D. 
with open(“ifaces.json”, “w”) as OutFile:
 OutFile.write(Response)

Which Python code snippet must be added to the script to save the returned configuration as a JSON-formatted file?

Q539

A. 
with open(“ifaces.json”, “w”) as OutFile:
 OutFile.write(Response.text)

B. 
with open(“ifaces.json”, “w”) as OutFile:
 OutFile.write(Response.json())

C. 
with open(“ifaces.json”, “w”) as OutFile:
 JSONResponse = json.loads(Response.text)
 OutFile.write(JSONResponse)

D. 
with open(“ifaces.json”, “w”) as OutFile:
 OutFile.write(Response)

Correct Answer: B

Support AceITCert.com by buying stuff you need!

4 Comments

ohhhvictor

Aggressive load-balancing on the WLC allows the LAPs to load-balance wireless clients across APs in an LWAPP system.

This feature can be used in order to load-balance clients across LAPs on a single controller.

2024-01-24 04:22:44
ohhhvictor

Explanation The json() method of theResponseinterface takes aResponsestream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. Response.textreturns the content of the response (string), in unicode so we can write it to a file. Note: response.json() returns a JSON object of the result so it cannot be written to a file directly.

2024-01-24 04:23:06
IgorLVG

2024-08-10 14:01:48
IgorLVG

File_object.write(str1)

 

the function writes receives a string argument, not json

2024-08-10 14:06:11
In order to participate in the comments you need to be logged-in.
You can sign-up or login (it's free).