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

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

Everyone's tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Cisco Employee

Re: RESTCONF reload packages


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
Highlighted
Cisco Employee

Re: RESTCONF reload packages


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

Highlighted
Cisco Employee

Re: RESTCONF reload packages

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