08-30-2021 03:49 AM
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?
Solved! Go to Solution.
08-31-2021 01:41 AM
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
08-30-2021 06:08 AM
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
08-30-2021 12:29 PM
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"
}
]
}
}
08-31-2021 01:41 AM
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
08-31-2021 02:13 AM
It works magically. Thank you so mach!
08-30-2021 08:34 AM
08-30-2021 12:37 PM
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?
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