Popular Post tnp1807 Posted March 31 Popular Post Share Posted March 31 Hi all, i got ccie_restconf.py file which solution for task 3.2 from c4c team. I already verified in lab then it work fine. import requests import json import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) host = '10.3.11.1' port = '443' username = 'netadmin' password = 'CCIEInfr4' url = "https://{}:{}/restconf/data/Cisco-IOS-XE-interfaces-oper:interfaces/interface".format(host, port) headers = { 'Accept': 'application/yang-data+json', 'Content-Type': 'application/yang-data+json' } response = requests.get(url, auth=(username, password),headers=headers,verify=False) jsondata = response.json() print("-" * 100) print("{:<45} {:<30} {:<30}".format("Interface", "Ingress Octets", "Egress Octets")) print("-" * 100) for interface in jsondata['Cisco-IOS-XE-interfaces-oper:interface']: if interface['oper-status'] == "if-oper-state-ready" and interface['interface-type'] == "iana-iftype-ethernet-csmacd": interface_name = interface['name'] in_octets = interface['statistics']['in-octets'] out_octets = interface['statistics']['out-octets'] print("{:<45} {:<30} {:<30}".format(interface_name, in_octets, out_octets)) This is the hidden content, please Sign In or Sign Up 68 12 Link to comment Share on other sites More sharing options...
imhungry Posted March 31 Share Posted March 31 This is useful thank you. Where did you get this? Is this your solution based on the leaked dump or is this a solution that has been provided by C4C? It would have been even more useful for them to highlight the changes they have made to the ccie_restconf.py file that is provided in the exam. Link to comment Share on other sites More sharing options...
abamni Posted March 31 Share Posted March 31 Tnx Link to comment Share on other sites More sharing options...
takak Posted March 31 Share Posted March 31 great! Link to comment Share on other sites More sharing options...
zshengh Posted April 2 Share Posted April 2 great Link to comment Share on other sites More sharing options...
iev6can Posted April 2 Share Posted April 2 (edited) Is it required to create this entire script from scratch or is part of the script already provided in the exam? Please describe the other portions of the automation section. Edited April 2 by iev6can 1 Link to comment Share on other sites More sharing options...
giinzo Posted April 10 Share Posted April 10 thanks Link to comment Share on other sites More sharing options...
freebsd321 Posted April 15 Share Posted April 15 Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now