cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
696
Views
5
Helpful
1
Replies

Getting Action input list using REST/RESTCONF

DanielSan6998
Level 1
Level 1

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:

 

/api/running/webui-l2vc

{
    "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"
        }
    }
}

 

 

1 Reply 1

ramkraja
Cisco Employee
Cisco Employee

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:

/api/running/webui-l2vc

 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