09-26-2017 09:58 PM - edited 03-01-2019 04:00 AM
Hi experts:
I find set ned-settings cisco-ios-write-memory-setting disabled by NSO rest api only support xml payload, for json payload, it could not work.
ned.json file is as below:
"ned-settings": {
"tailf-ned-cisco-ios-meta:cisco-ios-write-memory-setting": "on-commit"
}
bash-4.2# time curl -i -u admin:admin -X PATCH -H "Content-Type: application/vnd.yang.data+json" -s http://127.0.0.1:8080/api/config/devices/device/NG03/ned-settings -T ned.json
HTTP/1.1 100 Continue
Server:
Allow: GET, POST, OPTIONS, HEAD
Content-Length: 0
HTTP/1.1 500 Internal Server Error
Server:
Date: Wed, 27 Sep 2017 08:28:28 GMT
Allow: GET, POST, OPTIONS, HEAD
Content-Length: 0
Content-Type: text/plain
Thanks.
Solved! Go to Solution.
09-27-2017 07:39 AM
Hi,
I use this json:
YFHERZOG-M-W1ZZ:stacked-example yfherzog$ cat test.json
{
"ned-settings": { "tailf-ned-cisco-ios-meta:cisco-ios-write-memory-setting": "on-commit" }
}
with this curl command:
YFHERZOG-M-W1ZZ:stacked-example yfherzog$ curl -i -u admin:admin http://localhost:8080/api/running/devices/device/ios-0/ned-settings -X PATCH -H "Content-Type: application/vnd.yang.data+json" -T test.json
HTTP/1.1 100 Continue
Server:
Allow: GET, POST, OPTIONS, HEAD
Content-Length: 0
HTTP/1.1 204 No Content
Server:
Date: Wed, 27 Sep 2017 14:37:34 GMT
Allow: GET, POST, OPTIONS, HEAD
Last-Modified: Wed, 27 Sep 2017 14:37:34 GMT
Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
Etag: 1506-523054-199805
Content-Length: 0
Content-Type: text/html
Pragma: no-cache
That seems to be working as expected for me.
Yftach
09-27-2017 07:39 AM
Hi,
I use this json:
YFHERZOG-M-W1ZZ:stacked-example yfherzog$ cat test.json
{
"ned-settings": { "tailf-ned-cisco-ios-meta:cisco-ios-write-memory-setting": "on-commit" }
}
with this curl command:
YFHERZOG-M-W1ZZ:stacked-example yfherzog$ curl -i -u admin:admin http://localhost:8080/api/running/devices/device/ios-0/ned-settings -X PATCH -H "Content-Type: application/vnd.yang.data+json" -T test.json
HTTP/1.1 100 Continue
Server:
Allow: GET, POST, OPTIONS, HEAD
Content-Length: 0
HTTP/1.1 204 No Content
Server:
Date: Wed, 27 Sep 2017 14:37:34 GMT
Allow: GET, POST, OPTIONS, HEAD
Last-Modified: Wed, 27 Sep 2017 14:37:34 GMT
Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
Etag: 1506-523054-199805
Content-Length: 0
Content-Type: text/html
Pragma: no-cache
That seems to be working as expected for me.
Yftach
09-27-2017 07:00 PM
Hi Yftach,
Thanks for your help. I also work. my payload format is wrong. Now it could work.
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