-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
98 lines (85 loc) · 3 KB
/
models.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
package onosclient
type Flows struct {
Flow []Flow `json:"flows"`
}
type Flow struct {
AppID string `json:"appid"`
Bytes int `json:"bytes,omitempty"`
DeviceID string `json:"deviceid,omitempty"`
GroupID int `json:"groupid,omitempty"`
ID string `json:"id,omitempty"`
IsPermanent bool `json:"ispermanent,omitempty"`
LastSeen int `json:"lastseen,omitempty"`
Life int `json:"life,omitempty"`
LiveType string `json:"livetype,omitempty"`
Packets int `json:"packets,omitempty"`
Priority int `json:"priority,omitempty"`
State string `json:"state,omitempty"`
TableID int `json:"tableid,omitempty"`
TableName string `json:"tablename,omitempty"`
Timeout int `json:"timeout,omitempty"`
Selector Selector `json:"selector,omitempty"`
Treatment Treatment `json:"treatment,omitempty"`
}
type Instruction struct {
Port string `json:"port,omitempty"`
Type string `json:"type,omitempty"`
}
type Intents struct {
Intents []Intent `json:"intents"`
}
type Intent struct {
AppID string `json:"appId"`
ID string `json:"id,omitempty"`
Key string `json:"key,omitempty"`
State string `json:"state,omitempty"`
Type string `json:"type"`
Resources []string `json:"resources,omitempty"`
Selector *Selector `json:"selector,omitempty"` //pointer so omitempty is honored
Treatment *Treatment `json:"treatment,omitempty"`
Priority int `json:"priority,omitempty"`
Constraints []Constraints `json:"constraints,omitempty"`
One string `json:"one"`
Two string `json:"two"`
}
type Selector struct {
Criteria []Criteria `json:"criteria,omitempty"`
}
type Criteria struct {
EthType string `json:"ethtype,omitempty"`
Mac string `json:"mac,omitempty"`
Port int `json:"port,omitempty"`
Type string `json:"type,omitempty"`
}
type Treatment struct {
ClearDeferred bool `json:"cleardeferred,omitempty"`
Deferred []Instructions `json:"deferred,omitempty"` //for deferred instructions
Instructions []Instructions `json:"instructions,omitempty"`
}
type Instructions struct {
Port string `json:"port,omitempty"`
Type string `json:"type,omitempty"`
}
type Constraints struct {
Inclusive bool `json:"inclusive,omitempty"`
Types []string `json:"types,omitempty"`
Type string `json:"type,omitempty"`
}
type Hosts struct {
Hosts []Host `json:"hosts"`
}
type Host struct {
ID string `json:"id"`
Mac string `json:"mac"`
Vlan string `json:"vlan"`
InnerVlan string `json:"innerVlan"`
OuterTpid string `json:"outerTpid"`
Configured bool `json:"configured"`
Suspended bool `json:"suspended"`
IPAddresses []string `json:"ipAddresses"`
Locations []Location `json:"locations,omitempty"`
}
type Location struct {
ElementID string `json:"elementId"`
Port string `json:"port"`
}