IOS XE hello world using Restconf

Simple hello world in IOS XE using Restconf.

The script prints the status of the hostname and version of IOS XE.

For real use, consider using environment variables rather than hardcoding credentials for your iosxe instance.

For demo purposes, the script connects to the iosxe always-On sandbox, so you can test it right away.

Below are the restconf paths used to get the data.

/restconf/data/Cisco-IOS-XE-native:native/version
/restconf/data/Cisco-IOS-XE-native:native/hostname

How to use it

Install dependencies

pip install -r requirements.txt

To run the script do:

python hello_world.py

Output printed

❯ python hello_world.py
Reviewed 10.10.20.175
Hostname found: dist-rtr01
IOS XE Version found: 17.6
❯
View code on GitHub
  • Owner

  • Contributors

    +1Github contributor
  • Categories

  • Products

    IOS XE
  • Programming Languages

    Python
  • License

    BSD 3-Clause "New" or "Revised" License

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.