SD-WAN vSmartPolicy2HTML published

Description

Simplifies viewing and navigating large vSmart CLI policies.

This python script will convert a vSmart CLI policy into an HTML page with hyperlinks to the different elements of the policy.

Output Screenshot

Screen Shot of Output

Instructions

Save vSmart policy as a .txt file.

NOTE: The script relies on space indents to correctly parse the configuration. It expects that "policy" and "apply-policy" will have no spaces and each subsequent section or setting heirachy is indented by a single additional space. This should be the standard CLI output. Any issues with this indentation may cause the parsing to fail. **If you copy the policy from the "Policy Preview" in vManage, the "sla-class" section may be indented with an extra space that needs to be removed.

NOTE: The script has not been tested against all potential policy elements.

NOTE: Do not include the full vSmart configuration. This will parse only the policy.

Execute the script. The name of the policy file can be passed as an option or the user will be prompted for the file name. Examples:

python3 policy2html.py

or

./policy2html.py sample-policy.txt

View code on GitHub

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.