DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1

RESTCONF helps support a common, REST-based
programming model for network automation in general.


Enabling RESTCONF on Cisco IOS XE is simple and
straightforward. First, RESTCONF runs over HTTPS, so
a secure HTTP server is enabled on the device by issuing
ip http secure-server in configuration mode. Next,
RESTCONF is enabled with the restconf command in
configuration mode. Once these two commands are
entered and a network administrator account exists on
the device, RESTCONF is ready to be accessed. Cisco IOS
XE 16.6.3 and Postman 7.13 are used in the following
examples.


Devices that implement the RESTCONF protocol should
expose a resource called /.well-known/host-meta in
order to enable the discovery of the REST API root
resource programmatically. Using Postman to perform a
GET request on the https://{{host}}:{{port}}/.well-
known/host-meta endpoint results in the output shown
in Figure 12-6.


Figure 12-6 Getting the REST API Root Resource


The href attribute in the response contains the path to
the REST API root resource: /restconf. Exploring the
API further and performing a GET request on
https://{{host}}:{{port}}/restconf will expose the top-
level resources available in RESTCONF: data and
operations, as shown in Figure 12-7.

Free download pdf