CCNA AI and Network Operations • Set 13
CCNA AI and Network Operations Practice Test 13 — 15 questions with explanations. Free, no signup.
You are connected to R1 (198.51.100.1/24). Using RESTCONF, you need to retrieve the current operational status of GigabitEthernet0/0/0 via the ietf-interfaces YANG model, then update its description to 'WAN-Link-to-R2' using a PATCH request with the Cisco-IOS-XE-native YANG model. The candidate must identify the correct base URI, YANG module path, HTTP headers (Accept: application/yang-data+json), interpret the JSON response, and recognize the error that occurs when an incorrect Content-Type header or wrong YANG path is used.
R1#show running-config | section interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/0
ip address 198.51.100.1 255.255.255.0
description Link-to-R2
no shutdown
!
R1#show ip interface brief | include GigabitEthernet0/0/0
GigabitEthernet0/0/0 198.51.100.1 YES manual up up
RESTCONF base URI: https://198.51.100.1:443/restconf
Curl attempt (GET) — correct:
curl -k -u admin:cisco -H "Accept: application/yang-data+json" https://198.51.100.1/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet0%2F0%2F0
Curl attempt (PATCH) — incorrect (wrong YANG path):
curl -k -u admin:cisco -X PATCH -H "Content-Type: application/yang-data+json" -d '{"Cisco-IOS-XE-native:description":"WAN-Link-to-R2"}' https://198.51.100.1/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet0%2F0%2F0/description
Response to PATCH above: 400 Bad Request - "YANG path does not match data: expected 'Cisco-IOS-XE-native:interface' at root"
Curl attempt (PATCH) — correct:
curl -k -u admin:cisco -X PATCH -H "Content-Type: application/yang-data+json" -d '{"Cisco-IOS-XE-native:description":"WAN-Link-to-R2"}' https://198.51.100.1/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet=GigabitEthernet0%2F0%2F0/description
Response to correct PATCH: 204 No ContentR1#show running-config | section interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/0
ip address 198.51.100.1 255.255.255.0
description Link-to-R2
no shutdown
!
R1#show ip interface brief | include GigabitEthernet0/0/0
GigabitEthernet0/0/0 198.51.100.1 YES manual up up
RESTCONF base URI: https://198.51.100.1:443/restconf
Curl attempt (GET) — correct:
curl -k -u admin:cisco -H "Accept: application/yang-data+json" https://198.51.100.1/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet0%2F0%2F0
Curl attempt (PATCH) — incorrect (wrong YANG path):
curl -k -u admin:cisco -X PATCH -H "Content-Type: application/yang-data+json" -d '{"Cisco-IOS-XE-native:description":"WAN-Link-to-R2"}' https://198.51.100.1/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet0%2F0%2F0/description
Response to PATCH above: 400 Bad Request - "YANG path does not match data: expected 'Cisco-IOS-XE-native:interface' at root"
Curl attempt (PATCH) — correct:
curl -k -u admin:cisco -X PATCH -H "Content-Type: application/yang-data+json" -d '{"Cisco-IOS-XE-native:description":"WAN-Link-to-R2"}' https://198.51.100.1/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet=GigabitEthernet0%2F0%2F0/description
Response to correct PATCH: 204 No Content