Table of Contents
RESTCONF is defined in the RFC 8040.
The following RESTCONF methods are sent by the client:
- GET: to retrieve data for a resource
- POST: to create a data resource
- PUT: to create or replace the target data resource
- DELETE: to delete the target resource
- HEAD: to retrieve the header fields (which contain the metadata for a resource) that would be returned for the comparable GET method, without the response message-body. It is supported for all resources that support the GET method
EOS supports the 5 RESTCONF methods.
EOS can be configured to run a RESTCONF server.
Examples: https://github.com/arista-netdevops-community/restconf_demo_with_arista
Once we configured the devices to stream OpenConfig data to CVP, we can use RESTCONF and the GET method to retrieve OpenConfig data from CVP.
Only the RESTCONF GET method is supported with CVP.
This document describes how to access OpenConfig data streamed by the devices to CVP using RESTCONF.
Note: This is not yet fully supported by Arista so do not use it on production
Refer to the OpenConfig directory
To use RESTCONF with CVP, token based authentication is required.
To enable token based authentication, refer to this directory and copy the token into an environment variable.
token=xxxxx
echo $token
We can now use RESTCONF to access device OpenConfig data on CVP.
arista-origin
and arista-target
need to be added as query arguments in the URL:
- The default
arista-origin
isarista
arista-origin
isarista
for CVP data (inventory ...)arista-origin
isopenconfig
for the data streamed by devices to CVP
- The default
arista-target
is CVP.- To get the states of a device,
arista-target
must be the deviceID (SN of the switch).
- To get the states of a device,
The deviceID is the device SN.
on CVP GUI, go to Devices > Inventory to get the device SN.
To get CVP data (inventory ...), here's the URL format:
https://{{cvp_ip_address}}/restconf/data/{{cvp_path}}?arista-origin=arista&arista-target=
To get the OpenConfig data streamed by a device to CVP, here's the URL format:
https://{{cvp_ip_address}}/restconf/data/{{OpenConfig_path}}?arista-target={{device_SN}}&arista-origin=openconfig
Use the telemetry browser on CVP GUI (Settings and Tools > Developper Tools > Telemetry Browser) to view the OpenConfig data stored in CloudVision telemetry database. The paths in CVP are not exactly the OpenConfig paths. You will need to manipulate them to be able to use them with cURL or requests.
Refer to the YANG directory to understand how to generate paths and trees from YANG modules.
You will find in this directory examples using:
- The cURL command-line tool
- The requests Python library