-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_toop.py
122 lines (97 loc) · 2.42 KB
/
mod_toop.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class PhyProvider:
def __init__(self):
self.attenuation_az = None
self.attenuation_za = None
# // PhyProvider
# type PhyProvider struct {
# Positive float32 `json:"attenuation-az"`
# Reverse float32 `json:"attenuation-za"`
# }
class Physical:
def __init__(self):
self.ip = None
self.link_type = None
self.implement_state = None
self.provider = PhyProvider()
# // 物理属性
# type Physical struct {
# Ip string `json:"ip"`
# LinkType string `json:"link-type"`
# State string `json:"implement-state"`
# Provider PhyProvider `json:"provider"`
# }
class PhySrc:
def __init__(self):
self.source_node = None
self.source_tp = None
self.node_ip = None
# // source terminal point
# type PhySrc struct {
# SrcNode string `json:"source-node"`
# SrcTp string `json:"source-tp"`
# NodeIp string `json:"-"`
# }
class PhyDst:
def __init__(self):
self.dest_node = None
self.dest_tp = None
self.node_ip = None
# // destination terminal point
# type PhyDst struct {
# DstNode string `json:"dest-node"`
# DstTp string `json:"dest-tp"`
# NodeIp string `json:"-"`
# }
class PhyNode:
def __init__(self):
self.node_id = None
self.physical = Physical()
# // node
# type PhyNode struct {
# NodeId string `json:"node-id"`
# Physical Physical `json:"otn-phy-topology:physical"`
# }
class PhyLink:
def __init__(self):
self.link_id = None
self.physical = Physical()
self.source = PhySrc()
self.destination = PhyDst()
# // link
# type PhyLink struct {
# LinkId string `json:"link-id"`
# Physical Physical `json:"otn-phy-topology:physical"`
# Src PhySrc `json:"source"`
# Dst PhyDst `json:"destination"`
# }
class PhyTopology:
def __init__(self):
self.link = [PhyLink()]
self.node = [PhyNode()]
# // topology
# type PhyTopology struct {
# Link []PhyLink `json:"link"`
# Node []PhyNode `json:"node"`
# }
class PhyTopoRep:
def __init__(self):
self.topology = [PhyTopology()]
# // reply
# type PhyTopoRep struct {
# Topology []PhyTopology `json:"topology"`
# }
class InstanceDetails:
def __init__(self):
self.moduleName = None
self.myIp = None
self.user = None
self.passwd = None
self.namespace = None
# // zk InstanceDetails
# type InstanceDetails struct {
# ModuleName string `json:"moduleName"`
# MyIp string `json:"myIp"`
# User string `json:"user"`
# Pwd string `json:"passwd"`
# Namespace string `json:"namespace"`
# }