netopsauto package
Juniper Instance
- class netopsauto.juniper.Juniper(host_name, host_address, user, password)
A class which implements Juniper Networks PyEZ module.
Initializes a new instance of a Juniper device.
- Parameters
host_name (str) – host name for Juniper device
host_address (str) – host address for Juniper device
user (str) – username for Juniper login
password (str) – password for Juniper login
- activate_port_security(port_list)
Activates secure-access-port option for the list of specified ports for the current Juniper instance.
- Parameters
port_list (list) – List of desired ports to have secure-access-port enabled
- change_password(user, password)
Will hash inputted password for new user login for the current Juniper instance.
- Parameters
user (str) – New desired username for login
password (str) – New desired password for login
- delete_snmp(community, trap_group, address)
Will delete an snmp address for the given community and trap group.
- Parameters
community (str) – SNMP community
trap_group (str) – SNMP trap group
address (str) – SNMP address
- get_enabled_interfaces()
- Returns
list of Physical Interfaces which read
Enabled, Physical link is Down- Return type
list
- get_secure_access_port_status(port=None)
Generates dictionary of ports and their secure-access-port status for the given Juniper instance.
- Parameters
port (int, optional) – Port number (0-47 or 0-23) for the current Juniper instance
- Returns
Dictionary of ports with and their ethernet-switching-options status (active or inactive).
- Return type
dict
Note
If the port parameter is filled, the function will return the status of the individual port.
- initialize_device()
Initializes new instance of jnpr.junos.device.Device.
Optionally call this function to utilize the PyEz Device instance directly, otherwise the associated functions provided by the netopsauto.juniper.Juniper class will initialize a Device object for you.
- Returns
- set_rescue_config()
Runs the
request system configuration rescue savecommand for the current Juniper instance
- set_snmp(community, trap_group, address)
Will set a new snmp address for the given community and trap group.
- Parameters
community (str) – SNMP community
trap_group (str) – SNMP trap group
address (str) – SNMP address