cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1942
Views
15
Helpful
2
Replies

RESTCONF reload packages

Hi all, 

trying to reload packages from a restconf call like 

https://U:P@host:8888/restconf/operations/packages/reload

 

but how can i specify force ?

 

i have tried sending {'force':true} in a json body but that comes back with 

{
"errors": {
"error": [
{
"error-message": "1: Bad JSON character: '",
"error-path": "/tailf-ncs:packages/reload",
"error-tag": "malformed-message",
"error-type": "application"
}
]
}
}

 

 

thanks

regards

Yale

1 Accepted Solution

Accepted Solutions

ramkraja
Cisco Employee
Cisco Employee

yale.prince@leidos.com wrote:

trying to reload packages from a restconf call like 

https://U:P@host:8888/restconf/operations/packages/reload

but how can i specify force ?

i have tried sending {'force':true} in json body


'force' is modeled as an empty leaf (in tailf-ncs-packages.yang), and so, it should not have a value.

This should work:

 

curl -X POST -H "Content-Type: application/yang-data+json" http://U:P@host:8888/restconf/operations/packages/reload -d '{"input": {"force":""}}'

 

Or this, if you want to use xml:

 

curl -X POST -H "Content-Type: application/yang-data+xml" http://U:P@host:8888/restconf/operations/packages/reload -d "<input><force/></input>"

 

/Ram

View solution in original post

2 Replies 2

ramkraja
Cisco Employee
Cisco Employee

yale.prince@leidos.com wrote:

trying to reload packages from a restconf call like 

https://U:P@host:8888/restconf/operations/packages/reload

but how can i specify force ?

i have tried sending {'force':true} in json body


'force' is modeled as an empty leaf (in tailf-ncs-packages.yang), and so, it should not have a value.

This should work:

 

curl -X POST -H "Content-Type: application/yang-data+json" http://U:P@host:8888/restconf/operations/packages/reload -d '{"input": {"force":""}}'

 

Or this, if you want to use xml:

 

curl -X POST -H "Content-Type: application/yang-data+xml" http://U:P@host:8888/restconf/operations/packages/reload -d "<input><force/></input>"

 

/Ram

Empty leafs are encoded as '"force": [null]' according to RFC 7951 JSON Encoding of Data Modeled with YANG Section 6.9. The "empty" Type

Polls
AI-powered tools for network troubleshooting are likely to be part of everyone’s workflow sooner or later. What is the single biggest challenge or concern you see with adopting these tools in your organization?