cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1110
Views
0
Helpful
1
Replies

python model for openconfig-rib-bgp.yang is not created

vmusalir
Cisco Employee
Cisco Employee

Hi,

 

I am trying to generate models for CIsco XR PROD_BUILD_7_8_1_08I_DT_IMAGE.

openconfig-rib-bgp.yang present, but python model file for this corresponding yang is not created.

 

Could you please let me know what will be the issue?

 

Yang files used: /auto/xmpi/xr-yang/schemas/catchyang/PROD_BUILD_7_8_1_08I_DT_IMAGE/consolidated/

 

(venv) -bash-4.2$ pwd
/nobackup/vmusalir/ydk_build/ydk-gen
(venv) -bash-4.2$ ls yang/PROD_BUILD_7_8_1_08I_DT_IMAGE/ | grep openconfig-rib-bgp
openconfig-rib-bgp-attributes.yang
openconfig-rib-bgp-shared-attributes.yang
openconfig-rib-bgp-table-attributes.yang
openconfig-rib-bgp-tables.yang
openconfig-rib-bgp-types.yang
openconfig-rib-bgp.yang
(venv) -bash-4.2$
(venv) -bash-4.2$ ./generate.py --bundle profiles/bundles/cisco-ios-xr_7_8_1.json --python -v
<Skipped some output......>

Writing ydk-models-cisco-ios-xr-7.8.1/setup.cfg
creating dist
Creating tar archive
removing 'ydk-models-cisco-ios-xr-7.8.1' (and everything under it)

Successfully created source distribution at /nobackup/vmusalir/ydk_build/ydk-gen/gen-api/python/cisco_ios_xr-bundle/dist
=================================================
Successfully generated Python YDK at /nobackup/vmusalir/ydk_build/ydk-gen/gen-api/python/cisco_ios_xr-bundle
Please read /nobackup/vmusalir/ydk_build/ydk-gen/gen-api/python/cisco_ios_xr-bundle/README.md for information on how to install the package in your environment
Code generation and installation completed successfully!
Total time taken: 7 minutes 49 seconds

(venv) -bash-4.2$
(venv) -bash-4.2$ tar -tvf /nobackup/vmusalir/ydk_build/ydk-gen/gen-api/python/cisco_ios_xr-bundle/dist/ydk-models-cisco-ios-xr-7.8.1.tar.gz | grep rib_bgp
-rw-r--r-- vmusalir/eng 13850 2022-05-04 18:47 ydk-models-cisco-ios-xr-7.8.1/ydk/models/cisco_ios_xr/openconfig_rib_bgp_types.py
-rw-r--r-- vmusalir/eng 10499 2022-05-04 18:47 ydk-models-cisco-ios-xr-7.8.1/ydk/models/cisco_ios_xr/_meta/_openconfig_rib_bgp_types.py
(venv) -bash-4.2$

 

(venv) -bash-4.2$ cat profiles/bundles/cisco-ios-xr_7_8_1.json
{
  "name": "cisco-ios-xr",
  "version": "7.8.1",
  "core_version": "0.5.5",
  "author": "Cisco",
  "copyright": "Cisco",
  "description": "YDK bundle for Cisco IOS XR models",
  "long_description": "This YANG Development Kit (YDK) bundle provides APIs for Cisco IOS XR YANG models.",
  "models": {
    "dir": [
        "yang/PROD_BUILD_7_8_1_08I_DT_IMAGE"
    ]
  }
}
(venv) -bash-4.2$ 

 

 

ydk-gen clone command:

git clone https://github.com/CiscoDevNet/ydk-gen.git -b 0.5.5

 

Thanks and Regards,

Venkata Sudhakar

1 Reply 1

ygorelik
Cisco Employee
Cisco Employee

The YDK creates *.py files only if corresponding YANG file contains top level containers and lists. Sometimes the file contains only augments. In this case the corresponding API is included in the file, which augments the YANG definitions. I believe that is the case with the openconfog-rib-bgp.yang. Run utility generate.py with '-v' option to get more information about model API generation.

  Yan