05-14-2020 09:56 AM - edited 05-14-2020 12:39 PM
I can deploy my service with:
HTTP GET call http://{{NSO_IP}}:{{NSO_HTTP_PORT}}/restconf/data/tailf-ncs:services/interface_migrate:interface_migrate XML payload: <interface_migrate xmlns="http://com/example/interface_migrate"> <device>router2</device> <Bundle-Ether-interface>160</Bundle-Ether-interface> <shudown>true</shutdown> </interface_migrate>
DELETE the service doesn't seem to work
DELETE DELETE: http://{{NSO_IP}}:{{NSO_HTTP_PORT}}/restconf/data/tailf-ncs:services/interface_migrate:interface_migrate With or without payload Returns { "errors": { "error": [ { "error-message": "uri keypath not found", "error-tag": "invalid-value", "error-type": "application" } ] } }
When I check to see what's deployed on the device i can see
admin@ncs# show devices device router2 service-list
service-list [ "/ncs:services/interface_migrate {router2}" "/ncs:services/interface_migrate{router2 102}" ]
So how do I pass this in the URL? I have tried adding "router2 102", {router 2 102}, =router2 and just about every other combination I could think of?
Anyone know what I am missing?
thank you in advance
Solved! Go to Solution.
05-14-2020 03:12 PM
For get or delete of a multi-key instance you need to provide both keys comma-separated.
This should do it:
DELETE/GET: http://{{NSO_IP}}:{{NSO_HTTP_PORT}}/restconf/data/tailf-ncs:services/interface_migrate:interface_migrate=router2,102
05-14-2020 11:22 AM
Hi Richard,
So assuming that your service interface_migrate is a list and the key looks like <device>router2<\device> is the key/instance identifier.
To delete this instance you'd need to add the key to your URL:
http://{{NSO_IP}}:{{NSO_HTTP_PORT}}/restconf/data/tailf-ncs:services/interface_migrate:interface_migrate=router2
should work.
It looks like in you DELETE's below, you have an added "_" in front of you service name - interface_migrate:_interface_migrate:
DELETE: http://{{NSO_IP}}:{{NSO_HTTP_PORT}}/restconf/data/tailf-ncs:services/interface_migrate:_interface_migrate
I'm not sure you you've gotten a {router2 102} as a service instance in your service list for the device, had you previously used that as a <device> value previously?
If you do your GET with accept "application/vnd.yang.collection+xml" does that instance get shown?
05-14-2020 12:54 PM
Hi Larry,
The leading _ was a typo on my part. Adding =router2 to the url just gives me the same results.
My YANG model looks like this:
list interface_migrate { key "device Bundle-Ether-interface";
#show devices device router2 service-list returns:
service-list [ "/ncs:services/interface_migrate{router2 102}" ]
So with both device and Bundle-Ether-interface as keys to the list, how would I include both in the URL as I seem to be unable to delete without both.
Thanks
Richard
05-14-2020 03:12 PM
For get or delete of a multi-key instance you need to provide both keys comma-separated.
This should do it:
DELETE/GET: http://{{NSO_IP}}:{{NSO_HTTP_PORT}}/restconf/data/tailf-ncs:services/interface_migrate:interface_migrate=router2,102
05-15-2020 06:47 AM
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