cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2016
Views
10
Helpful
6
Replies

NSO RESTCONF NED migration

Hi, Team

 

I need to change NED for device LAB-vXR from cisco-iosxr-cli-7.26  to  cisco-iosxr-cli-7.33 via restconf request.

 

Сli command for this operation is "request devices device LAB-vXR migrate new-ned-id cisco-iosxr-cli-7.33"

 

I khow command for fetching ssh host-keys via restconf has such sintax (got from https://developer.cisco.com/docs/nso/#!cisco-nso-restconf-swagger-api-docs)

 

curl -u admin-X POST -H 'Accept: application/yang-data+json' http://10.10.10.10:8080/restconf/data/tailf-ncs:devices/device=LAB-vXR/ssh/fetch-host-keys

 

And i suupose request for migration should be something like that  

curl -u admin-X POST -H 'Accept: application/yang-data+json' pwtm284Nhttp://10.10.10.10:8080/restconf/data/tailf-ncs:devices/device=LAB-vXR/migrate/new-ned-id=cisco-iosxr-cli-7.26

 

But it does not work as expected. Where am I going wrong?

1 Accepted Solution

Accepted Solutions

Hi!

As @snovello stated the input parameters of course have to be
supplied in the payload body, and the migrate action that should
be used is under /devices/device:

$ curl -u admin -X POST -H "Accept: application/yang-data+json"
-H "Content-Type: application/yang-data+json"
--data '{"input": {"new-ned-id": "cisco-iosxr-cli-7.33"}}'
http://10.10.10.10:8000/restconf/data/tailf-ncs:devices/device=LAB-vXR/migrate

 

View solution in original post

6 Replies 6

perander
Cisco Employee
Cisco Employee

What error do you get?

Can it be because the migrate action is in the ned-id list?

I.e. the url would be

    http://10.10.10.10:8080/restconf/data/tailf-ncs:devices/device=LAB-vXR/ned-id=cisco-iosxr-cli-7.26/migrate/new-ned-id=cisco-iosxr-cli-7.33

Hi @perander, thnks for reply! 

 

Error:

[admin@server]$ curl -u admin-X POST -H 'Accept: application/yang-data+json' http://10.10.10.10:8080/restconf/data/tailf-ncs:devices/device=LAB-vXR/migrate/ned-id=cisco-iosxr-cli-7.33
Enter host password for user 'admin':
{
"ietf-restconf:errors": {
"error": [
{
"error-type": "application",
"error-tag": "invalid-value",
"error-message": "uri keypath not found"
}
]
}
}

 

Yuor request has same error

 

[admin@serever]$ curl -u admin -X POST -H 'Accept: application/yang-data+json' http://10.10.10.10:8080/restconf/data/tailf-ncs:devices/device=LAB-vXR/ned-id=cisco-iosxr-cli-7.26/migrate/new-ned-id=cisco-iosxr-cli-7.33
Enter host password for user 'admin':
{
"ietf-restconf:errors": {
"error": [
{
"error-type": "application",
"error-tag": "invalid-value",
"error-message": "uri keypath not found"
}
]
}
}

 

Hi!

As @snovello stated the input parameters of course have to be
supplied in the payload body, and the migrate action that should
be used is under /devices/device:

$ curl -u admin -X POST -H "Accept: application/yang-data+json"
-H "Content-Type: application/yang-data+json"
--data '{"input": {"new-ned-id": "cisco-iosxr-cli-7.33"}}'
http://10.10.10.10:8000/restconf/data/tailf-ncs:devices/device=LAB-vXR/migrate

 

It works magically. Thank you so mach!

snovello
Cisco Employee
Cisco Employee
Hello,
The input parameters of actions cannot be passed in via the URL in RESTCONF, they have to be given in the document you include in your post call. I don’t have an example for a NED migration at hand but have included a pointer to calling an action with parameters where you can see the body

https://www.postman.com/ciscodevnet/workspace/cisco-devnet-s-public-workspace/request/3224967-9bc13bac-d319-49bc-b1da-361ce2ee7d2e

Hi, @snovello! Thanks for your participating, but It seems for me that exec `live-status' commands does not fit for migration devise in NSO from one ned to another. We can use it for example if we need to obtain some operational data from devise like "show intrface status" or "show interface Gi0/1". Any other ideas?