ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 92 - 350-601 discussion

Report
Export

Refer to the exhibit.

Why does the python code for Cisco NX-API print an error message?

A.

The ''type'' is wrong in the header of the request and should be ''cli_ conf''.

Answers
A.

The ''type'' is wrong in the header of the request and should be ''cli_ conf''.

B.

NX-API does not allow configuration for features via the requests module.

Answers
B.

NX-API does not allow configuration for features via the requests module.

C.

The ''type'' is wrong is the body of the request and should be ''cli_ conf''.

Answers
C.

The ''type'' is wrong is the body of the request and should be ''cli_ conf''.

D.

The JSON is not a supported format for the NX-API.

Answers
D.

The JSON is not a supported format for the NX-API.

Suggested answer: C

Explanation:

'Commands that belong to different message types should not be mixed. For example, show commands are cli_show message type and are not supported in cli_conf mode.'

https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus7000/sw/programmability/guide/cisco_nexus7000_programmability_guide_8x/b-cisco-nexus7000-programmability-guide-8x_chapter_011.html

the payload 'type' value is wrong in the body of the request. For the request to be successful, it should be changes to 'cli_conf'.

For example, if we run the same request with the updated payload:

{

'ins_api': {

'version': '1.0',

'type': 'cli_conf',

'chunk': '0',

'sid': '1',

'input': 'configure terminal ;feature hsrp',

'output_format': 'json'

}

}

We get a 200 response:

{

'ins_api': {

'sid': 'eoc',

'type': 'cli_conf',

'version': '1.0',

'outputs': {

'output': [

{

'code': '200',

'msg': 'Success',

'body': {}

},

{

'code': '200',

'msg': 'Success',

'body': {}

}

]

}

}

}

CLI verification:

nxos9kv# sh run | inc hsrp

feature hsrp

asked 10/10/2024
Blake Heffelfinger
37 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first