cisco IOS XE — Example: Configuring the RESTCONF Protocol

Use the show netconf-yang sessions detail command to view detailed information about NETCONF/RESTCONF sessions: Device# show netconf-yang sessions detail R: Global-lock on running datastore C: Global-lock on candidate datastore S: Global-lock on startup datastore Number of sessions : 1 session-id : 19 transport : netconf-ssh username : admin source-host : 2001:db8::1 login-time : 2018-10-26T12:37:22+00:00 in-rpcs : 0 in-bad-rpcs : 0 out-rpc-errors : 0 out-notifications : 0 global-lock : None Configuration Examples for the RESTCONF Protocol Example: Configuring the RESTCONF Protocol RESTCONF Requests (HTTPS Verbs):

The following is a sample RESTCONF request that shows the HTTPS verbs allowed on a targeted resource. In this example, the logging monitor command is used.. root:~# curl -i -k -X "OPTIONS" "https://10.85.116.30:443/restconf/data/Cisco-IOS-XE-native:native/logging/monitor/severity" \ > -H 'Accept: application/yang-data+json' \ > -u 'admin:admin' HTTP/1.1 200 OK Server: nginx Date: Mon, 23 Apr 2018 15:27:57 GMT Content-Type: text/html Content-Length: 0 Connection: keep-alive Allow: DELETE, GET, HEAD, PATCH, POST, PUT, OPTIONS >>>>>>>>>>> Allowed methods Cache-Control: private, no-cache, must-revalidate, proxy-revalidate Accept-Patch:

application/yang-data+xml, application/yang-data+json Pragma: no-cache root:~# POST (Create) Request The POST operation creates a configuration which is not present in the targeted device. RESTCONF Protocol Configuration Examples for the RESTCONF Protocol RESTCONF Protocol 27