glaciation.devices package
Submodules
glaciation.devices.magictsw module
- glaciation.devices.magictsw.TSWDisableMirror(ip, P1, P2, bridge)[source]
Function to disable link between 2 TSWs
- Parameters:
ip (string) – ip address of tsw
P1 (string) – port of tsw. Options (X1,X2,X3,X4,La1,Lb1,La2,Lb2)
P2 (string) – port of tsw. Options (X1,X2,X3,X4,La1,Lb1,La2,Lb2)
bridge (int) – number os bridge to link 2 ports. Options (1,2,3)
- glaciation.devices.magictsw.TSWMirror(ip, P1, P2, bridge)[source]
Function to disable link between 2 TSWs :param ip: ip address of tsw :type ip: string :param P1: port of tsw. Options (X1,X2,X3,X4,La1,Lb1,La2,Lb2) :type P1: string :param P2: port of tsw. Options (X1,X2,X3,X4,La1,Lb1,La2,Lb2) :type P2: string :param bridge: number os bridge to link 2 ports. Options (1,2,3) :type bridge: int
glaciation.devices.moxa_TN_5508A module
- glaciation.devices.moxa_TN_5508A.port_mirror(ip, s_port, d_port, mode=0, cmd='check')[source]
Moxa configure mirroring using snmp
- Parameters:
ip (string) – ip address of moxa switch
s_port (int) – source port number
d_port (int) – destination port number
mode (int) – 0 -> only incoming traffic, 1 -> only outgoing traffic, 2 -> incoming and outgoing traffic (default is 0)
cmd (string) – “disable”,”enable” or “check”. Check print the port state (default is check)
- glaciation.devices.moxa_TN_5508A.set_port(ip, port, cmd='check')[source]
This function disables the port “port” of Moxa Car Switch via SNMP cmd: “disable”,”enable” or “check”. Check print the port state
- Parameters:
ip (string) – ip address of moxa switch
port (int) – port number
cmd (string) – “disable”,”enable” or “check”. Check print the port state (default is check)
glaciation.devices.uploader module
- glaciation.devices.uploader.loadConfs(ips, devType, confFolder, multiProcess=True, defaultConns=None, queue=False)[source]
Search available method to upload and upload files from confFolder recursively to devices in ips addresses posibility to delete files in the remote device inserting a file named __delete__ with file paths to be deleted
- Parameters:
ips (list/string) – list ip address of the target devices. If a list is given, each ip address is going to be executed in a new Process in parallel (Multiprocessing) If ips is not a list, the function is not going to start a new Process (Thread)
devType (fixed string (Vega, HMI_S, TSW)) – In case of list it will call itself with each type If a list is given confFolder must be a list as well Example without list: loadConfs([ips1], “Vega”, CONF, multiProcess=True) Example with list: loadConfs([ips1,ips2], [“Vega”,”TSW”], [CONF, CONF_TSW], multiProcess=True)
confFolder (string) – Folder containing the files to upload
multiProcess (bool) – If True all configurations will run in a new process in parallel (default is True)
defaultConns (string) – Path to default connection json. The default connections json file will be override
queue (string) – For internal use only, to share memory between processes (default is False)
- Raises:
Exception – loadConfError
Examples –
CONF = /path/to/confFolder | CONF_TSW = /path/to/confFolder2 | ips1 = [“172.16.5.1”,”172.16.5.2”,”172.16.5.1”,”172.16.5.2”] | ips2 = [“172.16.3.1”,”172.16.3.2”,”172.16.4.1”,”172.16.4.2”] | loadConfs(ips1, “Vega”, CONF, multiProcess=False) | loadConfs([ips1,ips2], [“Vega”,”TSW”], [CONF, CONF_TSW] , multiProcess=True)