cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
465
Views
0
Helpful
2
Replies

ned-settings cisco-ios-write-memory-setting disabled

haofan
Level 4
Level 4

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.

1 Accepted Solution

Accepted Solutions

yfherzog
Cisco Employee
Cisco Employee

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

View solution in original post

2 Replies 2

yfherzog
Cisco Employee
Cisco Employee

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

Hi Yftach,

     Thanks for your help. I also work. my payload format is wrong. Now it could work.