An automation script executes an HTTP GET request to a Cisco RESTCONF API endpoint. The router responds with the following JSON payload:
{
"ietf-interfaces:interface": {
"name": "GigabitEthernet1",
"description": "Uplink to Core",
"type": "iana-if-type:ethernetCsmacd",
"enabled": true,
"ietf-ip:ipv4": {
"address": [
{
"ip": "192.168.1.1",
"netmask": "255.255.255.0"
}
]
}
}
}
What is the value of the "description" key in this interface configuration?
- Uplink to CoreAnswer
- BGigabitEthernet1
- Ciana-if-type:ethernetCsmacd
- D192.168.1.1
Answer
Uplink to Core
In the provided JSON object, the string key 'description' maps directly to the value 'Uplink to Core'.
Step-by-Step Solution
Key Concept
JSON Key-Value Pair Extraction