cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
776
Views
0
Helpful
3
Replies

Error while running yanger with imported module.

RajeevNair89882
Level 1
Level 1

I would like to create a swagger documentation with yanger but when i running the yanger commands with imported module, its giving me error.

 

 yanger \
    --format=swagger \
    -t expand \
    --output=/tmp/test.swagger \
    --swagger-host 127.0.0.1:8080 \

    --path test-common.yang \

    test-cloud-connect-cfs.yang

 

am getting the below error while running, 

 

test-cloud-connect-cfs.yang:0: error: No data modules given, at least one data module is required for Swagger.

could someone help on this please?

3 Replies 3

rogaglia
Cisco Employee
Cisco Employee

Here what I use:

yanger -p yang/. -t expand -f swagger yang/etsi-nfv-descriptors.yang --swagger-host 127.0.0.1:8080 --swagger-basepath /restconf | python -m json.tool > nfvo_swagger.json

 

hi rogo, 

I tried to generate swagger file for one of our module,

yanger -p access-port/src/yang/ -t expand -f swagger l2vpn/src/yang/l2vpn.yang --swagger-host 127.0.0.1:8080 --swagger-basepath /restconf | python -m json.tool > nfvo_swagger.json

i got the following, 

access-port/src/yang/access-port.yang:16: error: module 'Cisco-IOS-XR-um-interface-cfg' not found
access-port/src/yang/access-port.yang:54: error: the node 'interfaces' from module 'Cisco-IOS-XR-um-interface-cfg' (in node 'config' from 'tailf-ncs') is not found
Expecting value: line 1 column 1 (char 0)

I understood that, need to put the NED file in the path. 

yanger -p access-port/src/yang/ -p cisco-iosxr-nc-7.5/src/yang -t expand -f swagger l2vpn/src/yang/l2vpn.yang --swagger-host 127.0.0.1:8080 --swagger-basepath /restconf | python -m json.tool > nfvo_swagger.json

now got the following, 

 

/nso/install/ncs/ncs-5.6.4/src/ncs/yang/tailf-ncs-cluster.yang:461: error: typedef 'aes-256-cfb-128-encrypted-string' in module 'tailf-common' not found
/nso/install/ncs/ncs-5.6.4/src/ncs/yang/tailf-ncs-devices.yang:4321: error: typedef 'aes-256-cfb-128-encrypted-string' in module 'tailf-common' not found

questions is, 

how to import user-defined module (like access-port) and NED folder which is dependency for the target module ?

need samples.

 

perander
Cisco Employee
Cisco Employee

You need at least one data node, e.g. container, list, leaf-list, leaf etc.