Created
April 8, 2014 03:54
-
-
Save kongou-ae/10088949 to your computer and use it in GitHub Desktop.
show_acl.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import onep | |
| from onep.element import * | |
| from onep.interfaces import * | |
| from onep.routing import * | |
| from onep.policy import * | |
| from onep.core.util import * | |
| if __name__ == '__main__': | |
| network_element = NetworkElement('MyRouter's FQDN','testapp') | |
| session_config = SessionConfig(SessionConfig.SessionTransportMode.TLS) | |
| session_config.ca_certs = '/home/cisco/MYDOMAIN.ca.pem' | |
| try: | |
| session_handle = network_element.connect('username','Password',session_config) | |
| aclList = Acl.get_acl_list(network_element, 1) | |
| for acl in aclList: | |
| print(acl) | |
| network_element.disconnect() | |
| except Exception as e: | |
| print( 'type:' + str(type(e))) | |
| print( 'args:' + str(e.args)) | |
| print( 'message:' + e.message) | |
| network_element.disconnect() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment