cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1920
Views
10
Helpful
6
Replies

REST API to RESTCONF

Hi,

 

I have a package that i call from the rest API like so (package is called vlan)

 

curl -v -X POST -T vlan.xml -u yale:******** http://localhost:8080/api/config

 

vlan.xml -


<vlan>
<vl-name>six</vl-name>
<device>nx1</device>
<vlan-id>10</vlan-id>
</vlan>

 

 

what is the equivalent call but for RESTCONF

 

 

Thanks

Regards

Yale

1 Accepted Solution

Accepted Solutions

richsun
Cisco Employee
Cisco Employee

Check out https://wwwin-github.cisco.com/nsopl/rest-api-explorer In short, if you know the REST API path, e.g.,

/api/config/devices/device/DEVICE1

the corresponding RESTCONF path is

/restconf/data/devices/device=DEVICE1?content=config

Same payload should work for both. 

 

View solution in original post

6 Replies 6

richsun
Cisco Employee
Cisco Employee

Check out https://wwwin-github.cisco.com/nsopl/rest-api-explorer In short, if you know the REST API path, e.g.,

/api/config/devices/device/DEVICE1

the corresponding RESTCONF path is

/restconf/data/devices/device=DEVICE1?content=config

Same payload should work for both. 

 

 curl -v -X POST -T vlan.xml -u yale:****** http://localhost:8080/restconf/data?content=config

Many thanks

 

Is there a document that explain/details what other options i have for content= etc ?

I copied section 4.8.1 from RESTCONF RFC8040 into rest-api-explorer  for "content="

 

Check out the NSO user guide, all query parameters are documented there.

 

https://developer.cisco.com/docs/nso/guides/#!the-restconf-api/query-parameters

swarudka
Cisco Employee
Cisco Employee

Hi 
i want to enable/install rest api explorer on NSO
Can anyone please help me with require steps to enable same.

 

Thanks

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: