Question 92 of 100 from exam 350-901-DEVCOR: Developing Applications Using Cisco Core Platforms and APIs

Question 92 of 100 from exam 350-901-DEVCOR: Developing Applications Using Cisco Core Platforms and APIs

Question

import sys, requests

URL = “https: //ios-xe-mgmt.cisco.com: 9443”
USER - ‘root’
PASS = ‘C!sco0123’

url = URL + “/restconf/data/ietf-interfaces: interfaces”
headers = {‘content-type’: ‘application/yang-data+json’, ‘accept’:
‘application/yang-datatjson’ }

result = requests.get(url, auth=(USER, PASS), headers=headers)
x json = result.json()
flagDown = 0
print (r_json.keys())
for record in r_json[“ietf-interfaces: interfaces”] [“interface”] :
print (“{0:<35}”.format (“interface: “ + record[“name”]), end=”"”)
if(‘address’ in record[“ietf-ip:ipv4”]):
print ("{0:<15}”. format (record [“ietf£-ip:ipv4”] [Naddress”] [0] [“ip”]), end="”)
else:
print ("{0:<15}”. format (“No IPv4”), end=""”)
print (“{0:<9}”.format(“status: “), end=””)
print (str (record[“enabled”]) )
if (record[“enabled”]==False) :
flagDown=1
print ("”)
if (flagDown) :
print(“At least one interface is down”)
else
print (“All interfaces are up”)

except:
print (“Exception: “ + str(sys.ecx_info() [0] + “ “ + str(sys.ecx_info() [1]))
print (“Error: “ + str(result.status_code), result.text)

Refer to the exhibit.

What is the output of this IOS-XE configuration program?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

D.