10-30-2019 08:27 AM
Hi I'm trying to get the inputs defined for a package action using REST API ¿Do you have any idea?
I can list actions (operations), this way:
{ "webui-l2vc:webui-l2vc": { "operations": { "prechecks": "/api/running/webui-l2vc/_operations/prechecks", "configuration": "/api/running/webui-l2vc/_operations/configuration", "postchecks": "/api/running/webui-l2vc/_operations/postchecks", "delete": "/api/running/webui-l2vc/_operations/delete" } } }
10-31-2019 09:44 AM
Hi I'm trying to get the inputs defined for a package action using REST API ¿Do you have any idea?
I can list actions (operations), this way:
Hi,
First of all, you should REALLY migrate to RESTCONF, since the legacy REST interface has already been deprecated, and it will be removed in a future release.
Now, as for your original question, it is not possible to get action inputs directly, either in REST or in RESTCONF. The way to do it in RESTCONF would be to get the source of the relevant yang model. See https://tools.ietf.org/html/rfc8040#section-3.7
So, in NSO, you would first do a GET on:
/restconf/data/ietf-yang-library:modules-state
This would give you all the loaded modules (mounted in the top-level global mount-point).
Find the module you are interested in. The output will have a 'schema' node, that contains the location of the module's schema. Do a GET on that location. For example, it could be something like:
/restconf/tailf/modules/webui-l2vc
This will give you the whole module, from which you can look up the action.
/Ram
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