05-07-2019 11:32 PM
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
Solved! Go to Solution.
05-08-2019 03:33 AM
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
05-08-2019 03:33 AM
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
06-26-2019 04:43 AM
Empty leafs are encoded as '"force": [null]' according to RFC 7951 JSON Encoding of Data Modeled with YANG Section 6.9. The "empty" Type
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide