cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
529
Views
5
Helpful
1
Replies

API for device check-sync wait-for-lock

peterwang75
Level 1
Level 1

Hi Guys,

We are trying to do check-sync with wait-for-lock option, the NSO CLI is below:

admin@ncs# devices device ABCD check-sync wait-for-lock { timeout 30 }

The question is how to invoke it from API? we tried to put the "wait-for-lock" in the payload or in the URL, none of them worked, see below.

 

curl -X POST --header 'Content-Type: application/vnd.yang.operation+json' --header 'Accept: text/plain' --header 'Authorization: Basic YWRtaW46YWRtaW4=' -d '{"input": {"wait-for-lock":""}}' 'http://localhost:8080/api/running/devices/device/ABCD/_operations/check-sync'

 

curl -X POST --header 'Content-Type: application/vnd.yang.data+json' --header 'Accept: text/html' --header 'Authorization: Basic YWRtaW46YWRtaW4=' -d '{}' 'http://localhost:8080/api/running/devices/device/ABCD/_operations/check-sync/wait-for-lock'

 

I had a look at the YANG model, "wait-for-lock" is a presence container, but still couldn't workout how to make the API call. Hope someone can help here!

This is the first time I am posting a question here, sorry if the question is not clear. 

 

1 Reply 1

peterwang75
Level 1
Level 1
Solved.

curl -X POST --header 'Content-Type: application/vnd.yang.operation+json' --header 'Accept: application/vnd.yang.operation+json' --header 'Authorization: Basic YWRtaW46YWRtaW4=' -d '{
"input":{
"wait-for-lock":{
"timeout":30
}
}
}
' 'http://localhost:8080/api/running/devices/device/ABCD/_operations/check-sync'
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: