Question

Difficulty: EasyInterpreting JSON Encoded Data

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?

  1. Uplink to CoreAnswer
  2. B
    GigabitEthernet1
  3. C
    iana-if-type:ethernetCsmacd
  4. D
    192.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

1
Locate the key named "description" within the root "ietf-interfaces:interface" JSON object.
The key "description" is identified in the object.
JSON formatted data maps unique key strings to corresponding values using colons.
2
Extract the string value assigned after the colon for the "description" key.
The value extracted is "Uplink to Core".
The string enclosed in quotes following "description": represents the value.

Key Concept

JSON Key-Value Pair Extraction
Rate this question