-
Notifications
You must be signed in to change notification settings - Fork 0
/
ovn_southbound.go
331 lines (297 loc) · 11.6 KB
/
ovn_southbound.go
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
package dbtypes
// Type: OVN_Southbound
// Version: 20.21.0
// Tables: 31
// Address_Set
type AddressSetSB struct {
Addresses OVSSet[string] `json:"addresses"`
Name *string `json:"name"`
}
// BFD
type BFDSB struct {
DetectMult *int `json:"detect_mult"`
Disc *int `json:"disc"`
DstIp *string `json:"dst_ip"`
ExternalIds OVSMapString `json:"external_ids"`
LogicalPort *string `json:"logical_port"`
MinRx *int `json:"min_rx"`
MinTx *int `json:"min_tx"`
Options OVSMapString `json:"options"`
SrcPort *int `json:"src_port"`
Status *string `json:"status"`
}
// Chassis
type ChassisSB struct {
Encaps OVSSet[UUID] `json:"encaps"` // Encap
ExternalIds OVSMapString `json:"external_ids"`
Hostname *string `json:"hostname"`
Name *string `json:"name"`
NbCfg *int `json:"nb_cfg"`
OtherConfig OVSMapString `json:"other_config"`
TransportZones OVSSet[string] `json:"transport_zones"`
VtepLogicalSwitches OVSSet[string] `json:"vtep_logical_switches"`
}
// Chassis_Private
type ChassisPrivateSB struct {
Chassis *UUID `json:"chassis,omitempty"` // Chassis
ExternalIds OVSMapString `json:"external_ids"`
Name *string `json:"name"`
NbCfg *int `json:"nb_cfg"`
NbCfgTimestamp *int `json:"nb_cfg_timestamp"`
}
// Connection
type ConnectionSB struct {
ExternalIds OVSMapString `json:"external_ids"`
InactivityProbe *int `json:"inactivity_probe,omitempty"`
IsConnected *bool `json:"is_connected"`
MaxBackoff *int `json:"max_backoff,omitempty"`
OtherConfig OVSMapString `json:"other_config"`
ReadOnly *bool `json:"read_only"`
Role *string `json:"role"`
Status OVSMapString `json:"status"`
Target *string `json:"target"`
}
// Controller_Event
type ControllerEventSB struct {
Chassis *UUID `json:"chassis,omitempty"` // Chassis
EventInfo OVSMapString `json:"event_info"`
EventType *string `json:"event_type"`
SeqNum *int `json:"seq_num"`
}
// DHCP_Options
type DHCPOptionsSB struct {
Code *int `json:"code"`
Name *string `json:"name"`
Type *string `json:"type"`
}
// DHCPv6_Options
type DHCPv6OptionsSB struct {
Code *int `json:"code"`
Name *string `json:"name"`
Type *string `json:"type"`
}
// DNS
type DNSSB struct {
Datapaths OVSSet[UUID] `json:"datapaths"` // Datapath_Binding
ExternalIds OVSMapString `json:"external_ids"`
Records OVSMapString `json:"records"`
}
// Datapath_Binding
type DatapathBindingSB struct {
ExternalIds OVSMapString `json:"external_ids"`
LoadBalancers OVSSet[UUID] `json:"load_balancers"`
TunnelKey *int `json:"tunnel_key"`
}
// Encap
type EncapSB struct {
ChassisName *string `json:"chassis_name"`
Ip *string `json:"ip"`
Options OVSMapString `json:"options"`
Type *string `json:"type"`
}
// FDB
type FDBSB struct {
DpKey *int `json:"dp_key"`
Mac *string `json:"mac"`
PortKey *int `json:"port_key"`
}
// Gateway_Chassis
type GatewayChassisSB struct {
Chassis *UUID `json:"chassis,omitempty"` // Chassis
ExternalIds OVSMapString `json:"external_ids"`
Name *string `json:"name"`
Options OVSMapString `json:"options"`
Priority *int `json:"priority"`
}
// HA_Chassis
type HAChassisSB struct {
Chassis *UUID `json:"chassis,omitempty"` // Chassis
ExternalIds OVSMapString `json:"external_ids"`
Priority *int `json:"priority"`
}
// HA_Chassis_Group
type HAChassisGroupSB struct {
ExternalIds OVSMapString `json:"external_ids"`
HaChassis OVSSet[UUID] `json:"ha_chassis"` // HA_Chassis
Name *string `json:"name"`
RefChassis OVSSet[UUID] `json:"ref_chassis"` // Chassis
}
// IGMP_Group
type IGMPGroupSB struct {
Address *string `json:"address"`
Chassis *UUID `json:"chassis,omitempty"` // Chassis
Datapath *UUID `json:"datapath,omitempty"` // Datapath_Binding
Ports OVSSet[UUID] `json:"ports"` // Port_Binding
}
// IP_Multicast
type IPMulticastSB struct {
Datapath *UUID `json:"datapath"` // Datapath_Binding
Enabled *bool `json:"enabled,omitempty"`
EthSrc *string `json:"eth_src"`
IdleTimeout *int `json:"idle_timeout,omitempty"`
Ip4Src *string `json:"ip4_src"`
Ip6Src *string `json:"ip6_src"`
Querier *bool `json:"querier,omitempty"`
QueryInterval *int `json:"query_interval,omitempty"`
QueryMaxResp *int `json:"query_max_resp,omitempty"`
SeqNo *int `json:"seq_no"`
TableSize *int `json:"table_size,omitempty"`
}
// Load_Balancer
type LoadBalancerSB struct {
Datapaths OVSSet[UUID] `json:"datapaths"` // Datapath_Binding
ExternalIds OVSMapString `json:"external_ids"`
Name *string `json:"name"`
Options OVSMapString `json:"options"`
Protocol *string `json:"protocol,omitempty"`
Vips OVSMapString `json:"vips"`
}
// Logical_DP_Group
type LogicalDPGroupSB struct {
Datapaths OVSSet[UUID] `json:"datapaths"` // Datapath_Binding
}
// Logical_Flow
type LogicalFlowSB struct {
Actions *string `json:"actions"`
ControllerMeter *string `json:"controller_meter,omitempty"`
ExternalIds OVSMapString `json:"external_ids"`
LogicalDatapath *UUID `json:"logical_datapath,omitempty"` // Datapath_Binding
LogicalDpGroup *UUID `json:"logical_dp_group,omitempty"` // Logical_DP_Group
Match *string `json:"match"`
Pipeline *string `json:"pipeline"`
Priority *int `json:"priority"`
TableId *int `json:"table_id"`
Tags OVSMapString `json:"tags"`
}
// MAC_Binding
type MACBindingSB struct {
Datapath *UUID `json:"datapath"` // Datapath_Binding
Ip *string `json:"ip"`
LogicalPort *string `json:"logical_port"`
Mac *string `json:"mac"`
}
// Meter
type MeterSB struct {
Bands OVSSet[UUID] `json:"bands"` // Meter_Band
Name *string `json:"name"`
Unit *string `json:"unit"`
}
// Meter_Band
type MeterBandSB struct {
Action *string `json:"action"`
BurstSize *int `json:"burst_size"`
Rate *int `json:"rate"`
}
// Multicast_Group
type MulticastGroupSB struct {
Datapath *UUID `json:"datapath"` // Datapath_Binding
Name *string `json:"name"`
Ports OVSSet[UUID] `json:"ports"` // Port_Binding
TunnelKey *int `json:"tunnel_key"`
}
// Port_Binding
type PortBindingSB struct {
Chassis *UUID `json:"chassis,omitempty"` // Chassis
Datapath *UUID `json:"datapath"` // Datapath_Binding
Encap *UUID `json:"encap,omitempty"` // Encap
ExternalIds OVSMapString `json:"external_ids"`
GatewayChassis OVSSet[UUID] `json:"gateway_chassis"` // Gateway_Chassis
HaChassisGroup *UUID `json:"ha_chassis_group,omitempty"` // HA_Chassis_Group
LogicalPort *string `json:"logical_port"`
Mac OVSSet[string] `json:"mac"`
NatAddresses OVSSet[string] `json:"nat_addresses"`
Options OVSMapString `json:"options"`
ParentPort *string `json:"parent_port,omitempty"`
RequestedChassis *UUID `json:"requested_chassis,omitempty"` // Chassis
Tag *int `json:"tag,omitempty"`
TunnelKey *int `json:"tunnel_key"`
Type *string `json:"type"`
Up *bool `json:"up,omitempty"`
VirtualParent *StringSet `json:"virtual_parent,omitempty"`
}
// Port_Group
type PortGroupSB struct {
Name *string `json:"name"`
Ports OVSSet[string] `json:"ports"`
}
// RBAC_Permission
type RBACPermissionSB struct {
Authorization OVSSet[string] `json:"authorization"`
InsertDelete *bool `json:"insert_delete"`
Table *string `json:"table"`
Update OVSSet[string] `json:"update"`
}
// RBAC_Role
type RBACRoleSB struct {
Name *string `json:"name"`
}
// SB_Global
type SBGlobalSB struct {
Connections OVSSet[UUID] `json:"connections"` // Connection
ExternalIds OVSMapString `json:"external_ids"`
Ipsec *bool `json:"ipsec"`
NbCfg *int `json:"nb_cfg"`
Options OVSMapString `json:"options"`
Ssl *UUID `json:"ssl,omitempty"` // SSL
}
// SSL
type SSLSB struct {
BootstrapCaCert *bool `json:"bootstrap_ca_cert"`
CaCert *string `json:"ca_cert"`
Certificate *string `json:"certificate"`
ExternalIds OVSMapString `json:"external_ids"`
PrivateKey *string `json:"private_key"`
SslCiphers *string `json:"ssl_ciphers"`
SslProtocols *string `json:"ssl_protocols"`
}
// Service_Monitor
type ServiceMonitorSB struct {
ExternalIds OVSMapString `json:"external_ids"`
Ip *string `json:"ip"`
LogicalPort *string `json:"logical_port"`
Options OVSMapString `json:"options"`
Port *int `json:"port"`
Protocol *string `json:"protocol,omitempty"`
SrcIp *string `json:"src_ip"`
SrcMac *string `json:"src_mac"`
Status *string `json:"status,omitempty"`
}
type OVNSouthbound struct {
Date Time `json:"_date"`
Comment string `json:"_comment"`
IsDiff bool `json:"_is_diff"`
AddressSet map[string]AddressSetSB `json:"Address_Set"`
BFD map[string]BFDSB `json:"BFD"`
Chassis map[string]ChassisSB `json:"Chassis"`
ChassisPrivate map[string]ChassisPrivateSB `json:"Chassis_Private"`
Connection map[string]ConnectionSB `json:"Connection"`
ControllerEvent map[string]ControllerEventSB `json:"Controller_Event"`
DHCPOptions map[string]DHCPOptionsSB `json:"DHCP_Options"`
DHCPv6Options map[string]DHCPv6OptionsSB `json:"DHCPv6_Options"`
DNS map[string]DNSSB `json:"DNS"`
DatapathBinding map[string]DatapathBindingSB `json:"Datapath_Binding"`
Encap map[string]EncapSB `json:"Encap"`
FDB map[string]FDBSB `json:"FDB"`
GatewayChassis map[string]GatewayChassisSB `json:"Gateway_Chassis"`
HAChassis map[string]HAChassisSB `json:"HA_Chassis"`
HAChassisGroup map[string]HAChassisGroupSB `json:"HA_Chassis_Group"`
IGMPGroup map[string]IGMPGroupSB `json:"IGMP_Group"`
IPMulticast map[string]IPMulticastSB `json:"IP_Multicast"`
LoadBalancer map[string]LoadBalancerSB `json:"Load_Balancer"`
LogicalDPGroup map[string]LogicalDPGroupSB `json:"Logical_DP_Group"`
LogicalFlow map[string]LogicalFlowSB `json:"Logical_Flow"`
MACBinding map[string]MACBindingSB `json:"MAC_Binding"`
Meter map[string]MeterSB `json:"Meter"`
MeterBand map[string]MeterBandSB `json:"Meter_Band"`
MulticastGroup map[string]MulticastGroupSB `json:"Multicast_Group"`
PortBinding map[string]PortBindingSB `json:"Port_Binding"`
PortGroup map[string]PortGroupSB `json:"Port_Group"`
RBACPermission map[string]RBACPermissionSB `json:"RBAC_Permission"`
RBACRole map[string]RBACRoleSB `json:"RBAC_Role"`
SBGlobal map[string]SBGlobalSB `json:"SB_Global"`
SSL map[string]SSLSB `json:"SSL"`
ServiceMonitor map[string]ServiceMonitorSB `json:"Service_Monitor"`
}
func (sb OVNSouthbound) IsValid() bool {
return len(sb.SBGlobal) > 0
}