-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.yaml
91 lines (85 loc) · 2.75 KB
/
schema.yaml
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
$defs:
cidr: {type: string, pattern: "^([0-9]{1,3}[.]){3}[0-9]+/[0-9]*$"}
ip: {type: string, pattern: "^([0-9]{1,3}[.]){3}[0-9]+$"}
mac: {type: string, pattern: "^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$"}
intf: {type: string, pattern: "^.{1,15}$"}
fwd: {type: string, pattern: "^[0-9]{1,5}:[0-9]{1,5}/(tcp|udp)$"}
type: object
additionalProperties: false
required: ["links"]
properties:
links:
type: array
items:
type: object
oneOf: [{required: ["container"]},
{required: ["service"]}]
if: {properties: {type: {const: "veth"}}}
then:
allOf:
- {required: ["bridge"]}
- {not: {required: ["mode", "vlanid"]}}
else:
not: {required: ["bridge"]}
if: {properties: {type: {const: "vlan"}}}
then: {required: ["vlanid"]}
else: {not: {required: ["mode", "vlanid"]}}
additionalProperties: false
properties:
type:
type: string
default: "veth"
enum: [veth, dummy, vlan, ipvlan, ipvtap, macvlan, macvtap]
service: {type: string}
container: {type: string}
bridge: {type: string}
outer-dev: {type: string, pattern: "^.{1,15}$"}
dev: {type: string, pattern: "^.{1,15}$", default: "eth0"}
ip: { "$ref": "#/$defs/cidr" }
mac: { "$ref": "#/$defs/mac" }
mtu: {type: number}
nat: { "$ref": "#/$defs/ip" }
mode: {type: string}
vlanid: {type: number}
route:
oneOf: [{type: string},
{type: array, items: {type: string}}]
forward:
oneOf: [{ "$ref": "#/$defs/fwd" },
{type: array, items: { "$ref": "#/$defs/fwd" }}]
netem:
oneOf: [{type: string},
{type: array, items: {type: string}}]
ethtool:
oneOf: [{type: string},
{type: array, items: {type: string}}]
bridges:
type: array
items:
type: object
properties:
mode: {type: string, enum: [auto, ovs, linux, patch]}
tunnels:
type: array
items:
type: object
required: ["type", "bridge", "remote", "vni"]
properties:
type: {type: string, enum: [geneve, vxlan]}
bridge: {type: string}
remote: { "$ref": "#/$defs/ip" }
vni: {type: number}
netem:
oneOf: [{type: string},
{type: array, items: {type: string}}]
commands:
type: array
items:
type: object
required: ["command"]
oneOf: [{required: ["container"]},
{required: ["service"]}]
properties:
service: {type: string}
container: {type: string}
command: {type: string}