-
Notifications
You must be signed in to change notification settings - Fork 59
/
ClassInheritance.py
50 lines (40 loc) · 1.68 KB
/
ClassInheritance.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""
Description
Demonstrate how to use Python class inheritance to leverage OpenIxia
library and extend the OpenIxia library with your own library.
Create your own classes and inherit the corresponding OpenIxia class.
Your scripts will be instantiating objects using your classes.
With inheritance, this allows your scripts to use all of OpenIxia functions
and use your added functions in your classes.
This allows you to keep getting OpenIxia updates without interferring with
your extended functions.
"""
from IxNetRestApi import *
from IxNetRestApiPortMgmt import PortMgmt
from IxNetRestApiTraffic import Traffic
from IxNetRestApiProtocol import Protocol
from IxNetRestApiStatistics import Statistics
from IxNetRestApiPacketCapture import PacketCapture
from IxNetRestApiQuickTest import QuickTest
class Connection(Connect):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class Port_Mgmt(PortMgmt):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def my_Own_Port_Mgmt_Function(self):
# Add and create your own function to extend the OpenIxia library.
pass
def exportJsonConfig(self):
# Overwrite the OpenIxia exportJsonConfig function.
# For enhancement or to fix a bug in exportJsonConfig().
pass
class Traffic_Config(Traffic):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class Protocol_Config(Protocol):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class Statistics_View(Statistics):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)