350-401 Exam QuestionsBrowse all questions from this exam

350-401 Exam - Question 853


Refer to the exhibit. What is achieved by the XML code?

Show Answer
Correct Answer: C

The given XML code establishes a NETCONF session and sends a <get-config> RPC payload to retrieve the running configuration of an extended ACL named 'fip'. The code then parses the XML response and extracts the access list sequence rules into a dictionary. The specific line that confirms this is 'd1=xmltodict.parse(r1.xml)['rpc-reply']['data']['native']['ip']['access-list']['extended']['access-list-seq-rule']', which indicates that the parsed information includes the details of the access list sequence rules, not just the sequence numbers. Therefore, the proper action taken by the code is to read the access list sequence rules from the output into a dictionary list.

Discussion

11 comments
Sign in to comment
kldoyle97Option: C
Jan 14, 2024

A and B cannot be correct because the python code is not using the print function/ display information. based on the code, I believe the answer is C because the last line is reference Sequence numbers ["access-list-seq-rule"]

d4doppelgangerOption: D
Mar 20, 2024

The output would look something like this. { '10': { 'sequence': '10', 'action': 'permit', 'source': '192.168.1.0 0.0.0.255', 'destination': 'any', 'protocol': 'ip', 'description': 'Allow traffic from 192.168.1.0/24 to any' }, '20': { 'sequence': '20', 'action': 'deny', 'source': 'any', 'destination': 'any', 'protocol': 'icmp', 'description': 'Deny all ICMP traffic' }, ... }

MizuchanOption: C
Jan 28, 2024

xmitodict that means C.

slacker_at_workOption: C
Mar 8, 2024

• The Python code establishes a NETCONF session with a Cisco IOS XE device and sends a <get-config> RPC payload to retrieve the running configuration of an extended ACL named "fip". • It then parses the XML response received from the device and extracts the access list sequence numbers from the configuration data of the extended ACL rules. • This sequence numbers are then read into a dictionary list.

kivi_bgOption: C
Jan 28, 2024

Answer C This is based on the line d1= xmltodict.parse(r1.xml)['rpc-reply']['data']['native']['ip']['access-list']['extended']['access-list-seq-rule'], which indicates that the XML response is parsed, and the specific information about access list sequence rules is extracted into a dictionary.

slacker_at_workOption: D
Mar 8, 2024

pl1 = [ <get-config xmlns="urn.ietf.params.xml.ns.netconf base:1.0"> <source> <running/> </source> <filter> <native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native"> <ip> <access-list> <extended xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-acl"> <name>fip</name> </extended> </access-list> </ip> </native> </filter> </get-config> ] with manager.connect(host=10.1.1.1, port=830, username=cisco, password=cisco, timeout=90, hostkey_verify=False) as m for rpc in pl1. r1=m.dispatch(et.fromstring(rpc)) d1=xmitodict.parse(r1.xml)['rpc-reply']['data']['native']['ip']['access-list']['extended']['access-list-seq-rule']

supershysherlockOption: D
Mar 18, 2024

The correct answer will depend on the exact functionality of the NETCONF library and functions being used (like xmltodict.parse). If the functions xmltodict.parse and md.dispatch are being used as typically intended, they would parse the NETCONF response into a dictionary (D). So, based on the typical use of these functions, Option D is the most likely correct answer. It reads the output of the command into a dictionary list, allowing for structured access to the data within the application or script.

SeMo0o0oOption: C
Jun 10, 2024

im going with C

SeMo0o0o
Jun 18, 2024

after rereading the output, i think C is partially correct. the code does parse the access list sequence rules into a dictionary, but it doesn't specify that only sequence numbers are extracted. So D is more accurate

SeMo0o0o
Jun 30, 2024

after rereading the output, i think C is partially correct. the code does parse the access list sequence rules into a dictionary, but it doesn't specify that only sequence numbers are extracted. So D is more accurate

SeMo0o0oOption: D
Jun 18, 2024

D is correct the code does parse the access list sequence rules into a dictionary, but it doesn't specify that only sequence numbers are extracted.

a197cbfOption: D
Jul 10, 2024

My vote is for D. The "access-list-seq-rule" is NOT just the value of the sequence number. The command would require the sub-tag <sequence> to pull the sequence number separately. Here's a sample XML format of an <access-list-seq-rule> block: <access-list-seq-rule> <sequence>10</sequence> <ace-rule> <action>permit</action> <protocol>tcp</protocol> <any/> <dst-any/> <dst-range1>5060</dst-range1> <dst-range2>5061</dst-range2> </ace-rule> </access-list-seq-rule> With that, if the most drilled-down block is the "access-list-seq-rule" then D makes sense since it's listing out each entire rule per sequence number, rather than just the sequence numbers themselves like option C specifies. If anyone disagrees, please correct me if I'm wrong.

Mohaned990_goOption: D
Jul 22, 2024

correct D