ConfigFileFormat » History » Version 5
Vince Lehman, 03/01/2016 09:17 AM
1 | 1 | Vince Lehman | ConfigFileFormat |
---|---|---|---|
2 | ================ |
||
3 | |||
4 | # File Format v2.0 |
||
5 | |||
6 | ## Topology Schema |
||
7 | ``` JSON |
||
8 | { |
||
9 | "$schema": "http://json-schema.org/draft-04/schema#", |
||
10 | "id": "/", |
||
11 | "type": "object", |
||
12 | "properties": { |
||
13 | "hosts": { |
||
14 | "id": "hosts", |
||
15 | "type": "array", |
||
16 | "items": [], |
||
17 | "description": "Array of hosts in the topology" |
||
18 | }, |
||
19 | "links": { |
||
20 | "id": "links", |
||
21 | "type": "array", |
||
22 | "items": [], |
||
23 | "description": "Array of links in the topology" |
||
24 | }, |
||
25 | "routers": { |
||
26 | "id": "routers", |
||
27 | "type": "array", |
||
28 | "items": [], |
||
29 | "description": "Array of routers in the topology" |
||
30 | }, |
||
31 | "switches": { |
||
32 | "id": "switches", |
||
33 | "type": "array", |
||
34 | "items": [], |
||
35 | "description": "Array of switches in the topology" |
||
36 | }, |
||
37 | "version": { |
||
38 | "id": "version", |
||
39 | "type": "string", |
||
40 | "description": "File format version" |
||
41 | } |
||
42 | }, |
||
43 | "required": [ |
||
44 | "hosts", |
||
45 | "links", |
||
46 | "routers", |
||
47 | "switches", |
||
48 | "version" |
||
49 | ] |
||
50 | } |
||
51 | |||
52 | ``` |
||
53 | 2 | Vince Lehman | |
54 | ## Host Schema |
||
55 | ``` JSON |
||
56 | { |
||
57 | "$schema": "http://json-schema.org/draft-04/schema#", |
||
58 | "id": "Host", |
||
59 | "type": "object", |
||
60 | "properties": { |
||
61 | "number": { |
||
62 | "id": "number", |
||
63 | "type": "string" |
||
64 | }, |
||
65 | "opts": { |
||
66 | "id": "opts", |
||
67 | "type": "object", |
||
68 | "properties": { |
||
69 | "cpu": { |
||
70 | "id": "cpu", |
||
71 | "type": "string" |
||
72 | }, |
||
73 | "hostname": { |
||
74 | "id": "hostname", |
||
75 | "type": "string" |
||
76 | }, |
||
77 | "mem": { |
||
78 | "id": "mem", |
||
79 | "type": "string" |
||
80 | }, |
||
81 | "nfd": { |
||
82 | "id": "nfd", |
||
83 | "type": "object", |
||
84 | "properties": { |
||
85 | "log-level": { |
||
86 | "id": "log-level", |
||
87 | "type": "string" |
||
88 | } |
||
89 | } |
||
90 | }, |
||
91 | "nlsr": { |
||
92 | "id": "nlsr", |
||
93 | "type": "object", |
||
94 | "properties": { |
||
95 | "angle": { |
||
96 | "id": "angle", |
||
97 | "type": "string" |
||
98 | }, |
||
99 | "hyperbolic-state": { |
||
100 | "id": "hyperbolic-state", |
||
101 | "type": "string" |
||
102 | }, |
||
103 | "log-level": { |
||
104 | "id": "log-level", |
||
105 | "type": "string" |
||
106 | }, |
||
107 | "max-faces-per-prefix": { |
||
108 | "id": "max-faces-per-prefix", |
||
109 | "type": "string" |
||
110 | }, |
||
111 | "network": { |
||
112 | "id": "network", |
||
113 | "type": "string" |
||
114 | }, |
||
115 | "radius": { |
||
116 | "id": "radius", |
||
117 | "type": "string" |
||
118 | }, |
||
119 | "router": { |
||
120 | "id": "router", |
||
121 | "type": "string" |
||
122 | }, |
||
123 | "site": { |
||
124 | "id": "site", |
||
125 | "type": "string" |
||
126 | } |
||
127 | } |
||
128 | }, |
||
129 | "nodeNum": { |
||
130 | "id": "nodeNum", |
||
131 | "type": "integer" |
||
132 | } |
||
133 | 3 | Vince Lehman | }, |
134 | "required": [ |
||
135 | "hostname", |
||
136 | "nodeNum" |
||
137 | ] |
||
138 | 2 | Vince Lehman | }, |
139 | "x": { |
||
140 | "id": "x", |
||
141 | "type": "string" |
||
142 | }, |
||
143 | "y": { |
||
144 | "id": "y", |
||
145 | "type": "string" |
||
146 | } |
||
147 | }, |
||
148 | "required": [ |
||
149 | "number", |
||
150 | "opts", |
||
151 | "x", |
||
152 | "y" |
||
153 | ], |
||
154 | "description": "Configuration for a single host" |
||
155 | } |
||
156 | ``` |
||
157 | 4 | Vince Lehman | |
158 | ## Link Schema |
||
159 | ``` JSON |
||
160 | { |
||
161 | "$schema": "http://json-schema.org/draft-04/schema#", |
||
162 | "id": "Link", |
||
163 | "type": "object", |
||
164 | "properties": { |
||
165 | "dest": { |
||
166 | "id": "dest", |
||
167 | "type": "string" |
||
168 | }, |
||
169 | "opts": { |
||
170 | "id": "opts", |
||
171 | "type": "object", |
||
172 | "properties": { |
||
173 | "bw": { |
||
174 | "id": "bw", |
||
175 | "type": "integer" |
||
176 | }, |
||
177 | "delay": { |
||
178 | "id": "delay", |
||
179 | "type": "string" |
||
180 | }, |
||
181 | "loss": { |
||
182 | "id": "loss", |
||
183 | "type": "integer" |
||
184 | } |
||
185 | } |
||
186 | }, |
||
187 | "src": { |
||
188 | "id": "src", |
||
189 | "type": "string" |
||
190 | } |
||
191 | }, |
||
192 | "required": [ |
||
193 | "dest", |
||
194 | "opts", |
||
195 | "src" |
||
196 | ] |
||
197 | } |
||
198 | ``` |
||
199 | 5 | Vince Lehman | |
200 | ## Switch Schema |
||
201 | ``` JSON |
||
202 | { |
||
203 | "$schema": "http://json-schema.org/draft-04/schema#", |
||
204 | "id": "/", |
||
205 | "type": "object", |
||
206 | "properties": { |
||
207 | "number": { |
||
208 | "id": "number", |
||
209 | "type": "string" |
||
210 | }, |
||
211 | "opts": { |
||
212 | "id": "opts", |
||
213 | "type": "object", |
||
214 | "properties": { |
||
215 | "hostname": { |
||
216 | "id": "hostname", |
||
217 | "type": "string" |
||
218 | }, |
||
219 | "nodeNum": { |
||
220 | "id": "nodeNum", |
||
221 | "type": "integer" |
||
222 | } |
||
223 | }, |
||
224 | "required": [ |
||
225 | "hostname", |
||
226 | "nodeNum" |
||
227 | ] |
||
228 | }, |
||
229 | "x": { |
||
230 | "id": "x", |
||
231 | "type": "string" |
||
232 | }, |
||
233 | "y": { |
||
234 | "id": "y", |
||
235 | "type": "string" |
||
236 | } |
||
237 | }, |
||
238 | "required": [ |
||
239 | "number", |
||
240 | "opts", |
||
241 | "x", |
||
242 | "y" |
||
243 | ] |
||
244 | } |
||
245 | ``` |