Compare commits

..

4 Commits

Author SHA1 Message Date
Mike Hansen
d3f610d9ef Correct indentation of instances block in switch.yml
The property 'instance' is not indented correctly and therefore doesn't end up under the loop-detection properties in the switch configuration.

Signed-off-by: Mike Hansen <mike.hansen@netexperience.com>
2024-02-26 11:35:09 -05:00
Olexandr, Mazur
711d7d9066 Merge pull request #10 from Telecominfraproject/change_vrf_id_to_integer
Change VRF id type from number to integer
2024-02-21 18:16:16 +02:00
Mike Hansen
89a78c61be Change VRF id type from number to integer
Signed-off-by: Mike Hansen <mike.hansen@netexperience.com>
2024-02-21 05:28:01 -05:00
Olexandr, Mazur
f5608bd42c Merge pull request #9 from Telecominfraproject/schema_fixes_and_updates
Align dhcp-relay with ols-ucentral-client, STP object typo #7 Fix spelling, make power limit an integer
2024-02-15 12:17:22 +02:00
7 changed files with 284 additions and 175 deletions

View File

@@ -40,7 +40,7 @@ properties:
vrf:
description:
VRF id.
type: number
type: integer
ipv4-unreachable:
description:
Define a list of non-interface specific UNREACHABLE routes.
@@ -58,4 +58,4 @@ properties:
vrf:
description:
VRF id.
type: number
type: integer

View File

@@ -30,7 +30,7 @@ properties:
vrf:
description:
VRF id.
type: number
type: integer
gateway:
description:
This option defines the static IPv4 gateway of the logical interface.
@@ -55,7 +55,7 @@ properties:
vrf:
description:
VRF id.
type: number
type: integer
metric:
description:
Optional metric value (define a NH route's weight / metric).
@@ -77,7 +77,7 @@ properties:
vrf:
description:
VRF id.
type: number
type: integer
multicast:
type: object
properties:

View File

@@ -43,50 +43,50 @@ properties:
enum:
- upstream
- downstream
instances:
description:
Define a list of configuration for each STP instance.
Meaning of this field depends on current
STP protocol (switch.loop-detection.protocol)
type: array
items:
type: object
properties:
id:
description:
Indicates instance to configure.
Depends on current STP protocol
If RPVSTP/PVSTP - vlan id
If MSTP - instance id
type: integer
enabled:
description:
Enable STP on this instance.
type: boolean
default: true
priority:
description:
Bridge priority.
type: integer
default: 32768
forward_delay:
description:
Defines the amount of time a switch port stays in the Listening
and Learning states before transitioning to the Forwarding state.
type: integer
default: 15
hello_time:
description:
Determines how often switches send BPDU.
type: integer
default: 2
max_age:
description:
Specifies the maximum time that a switch port should wait to
receive a BPDU from its neighbor before
considering the link as failed or disconnected.
type: integer
default: 20
instances:
description:
Define a list of configuration for each STP instance.
Meaning of this field depends on current
STP protocol (switch.loop-detection.protocol)
type: array
items:
type: object
properties:
id:
description:
Indicates instance to configure.
Depends on current STP protocol
If RPVSTP/PVSTP - vlan id
If MSTP - instance id
type: integer
enabled:
description:
Enable STP on this instance.
type: boolean
default: true
priority:
description:
Bridge priority.
type: integer
default: 32768
forward_delay:
description:
Defines the amount of time a switch port stays in the Listening
and Learning states before transitioning to the Forwarding state.
type: integer
default: 15
hello_time:
description:
Determines how often switches send BPDU.
type: integer
default: 2
max_age:
description:
Specifies the maximum time that a switch port should wait to
receive a BPDU from its neighbor before
considering the link as failed or disconnected.
type: integer
default: 20
ieee8021x:
description:
This section describes the global 802.1X (port access control) configuration.

View File

@@ -532,8 +532,8 @@ function instantiateGlobals(location, value, errors) {
}
function parseVrf(location, value, errors) {
if (!(type(value) in [ "int", "double" ]))
push(errors, [ location, "must be of type number" ]);
if (type(value) != "int")
push(errors, [ location, "must be of type integer" ]);
return value;
}
@@ -588,8 +588,8 @@ function instantiateGlobals(location, value, errors) {
}
function parseVrf(location, value, errors) {
if (!(type(value) in [ "int", "double" ]))
push(errors, [ location, "must be of type number" ]);
if (type(value) != "int")
push(errors, [ location, "must be of type integer" ]);
return value;
}
@@ -1259,6 +1259,115 @@ function instantiateSwitch(location, value, errors) {
obj.roles = parseRoles(location + "/roles", value["roles"], errors);
}
function parseInstances(location, value, errors) {
if (type(value) == "array") {
function parseItem(location, value, errors) {
if (type(value) == "object") {
let obj = {};
function parseId(location, value, errors) {
if (type(value) != "int")
push(errors, [ location, "must be of type integer" ]);
return value;
}
if (exists(value, "id")) {
obj.id = parseId(location + "/id", value["id"], errors);
}
function parseEnabled(location, value, errors) {
if (type(value) != "bool")
push(errors, [ location, "must be of type boolean" ]);
return value;
}
if (exists(value, "enabled")) {
obj.enabled = parseEnabled(location + "/enabled", value["enabled"], errors);
}
else {
obj.enabled = true;
}
function parsePriority(location, value, errors) {
if (type(value) != "int")
push(errors, [ location, "must be of type integer" ]);
return value;
}
if (exists(value, "priority")) {
obj.priority = parsePriority(location + "/priority", value["priority"], errors);
}
else {
obj.priority = 32768;
}
function parseForward_delay(location, value, errors) {
if (type(value) != "int")
push(errors, [ location, "must be of type integer" ]);
return value;
}
if (exists(value, "forward_delay")) {
obj.forward_delay = parseForward_delay(location + "/forward_delay", value["forward_delay"], errors);
}
else {
obj.forward_delay = 15;
}
function parseHello_time(location, value, errors) {
if (type(value) != "int")
push(errors, [ location, "must be of type integer" ]);
return value;
}
if (exists(value, "hello_time")) {
obj.hello_time = parseHello_time(location + "/hello_time", value["hello_time"], errors);
}
else {
obj.hello_time = 2;
}
function parseMax_age(location, value, errors) {
if (type(value) != "int")
push(errors, [ location, "must be of type integer" ]);
return value;
}
if (exists(value, "max_age")) {
obj.max_age = parseMax_age(location + "/max_age", value["max_age"], errors);
}
else {
obj.max_age = 20;
}
return obj;
}
if (type(value) != "object")
push(errors, [ location, "must be of type object" ]);
return value;
}
return map(value, (item, i) => parseItem(location + "/" + i, item, errors));
}
if (type(value) != "array")
push(errors, [ location, "must be of type array" ]);
return value;
}
if (exists(value, "instances")) {
obj.instances = parseInstances(location + "/instances", value["instances"], errors);
}
return obj;
}
@@ -2549,8 +2658,8 @@ function instantiateInterfaceIpv4(location, value, errors) {
}
function parseVrf(location, value, errors) {
if (!(type(value) in [ "int", "double" ]))
push(errors, [ location, "must be of type number" ]);
if (type(value) != "int")
push(errors, [ location, "must be of type integer" ]);
return value;
}
@@ -2622,8 +2731,8 @@ function instantiateInterfaceIpv4(location, value, errors) {
}
function parseVrf(location, value, errors) {
if (!(type(value) in [ "int", "double" ]))
push(errors, [ location, "must be of type number" ]);
if (type(value) != "int")
push(errors, [ location, "must be of type integer" ]);
return value;
}
@@ -2689,8 +2798,8 @@ function instantiateInterfaceIpv4(location, value, errors) {
}
function parseVrf(location, value, errors) {
if (!(type(value) in [ "int", "double" ]))
push(errors, [ location, "must be of type number" ]);
if (type(value) != "int")
push(errors, [ location, "must be of type integer" ]);
return value;
}

View File

@@ -429,7 +429,7 @@
},
"vrf": {
"description": "VRF id.",
"type": "number"
"type": "integer"
}
}
}
@@ -450,7 +450,7 @@
},
"vrf": {
"description": "VRF id.",
"type": "number"
"type": "integer"
}
}
}
@@ -767,42 +767,42 @@
"downstream"
]
}
}
},
"instances": {
"description": "Define a list of configuration for each STP instance. Meaning of this field depends on current STP protocol (switch.loop-detection.protocol)",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "Indicates instance to configure. Depends on current STP protocol If RPVSTP/PVSTP - vlan id If MSTP - instance id",
"type": "integer"
},
"enabled": {
"description": "Enable STP on this instance.",
"type": "boolean",
"default": true
},
"priority": {
"description": "Bridge priority.",
"type": "integer",
"default": 32768
},
"forward_delay": {
"description": "Defines the amount of time a switch port stays in the Listening and Learning states before transitioning to the Forwarding state.",
"type": "integer",
"default": 15
},
"hello_time": {
"description": "Determines how often switches send BPDU.",
"type": "integer",
"default": 2
},
"max_age": {
"description": "Specifies the maximum time that a switch port should wait to receive a BPDU from its neighbor before considering the link as failed or disconnected.",
"type": "integer",
"default": 20
},
"instances": {
"description": "Define a list of configuration for each STP instance. Meaning of this field depends on current STP protocol (switch.loop-detection.protocol)",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "Indicates instance to configure. Depends on current STP protocol If RPVSTP/PVSTP - vlan id If MSTP - instance id",
"type": "integer"
},
"enabled": {
"description": "Enable STP on this instance.",
"type": "boolean",
"default": true
},
"priority": {
"description": "Bridge priority.",
"type": "integer",
"default": 32768
},
"forward_delay": {
"description": "Defines the amount of time a switch port stays in the Listening and Learning states before transitioning to the Forwarding state.",
"type": "integer",
"default": 15
},
"hello_time": {
"description": "Determines how often switches send BPDU.",
"type": "integer",
"default": 2
},
"max_age": {
"description": "Specifies the maximum time that a switch port should wait to receive a BPDU from its neighbor before considering the link as failed or disconnected.",
"type": "integer",
"default": 20
}
}
}
}
@@ -1340,7 +1340,7 @@
},
"vrf": {
"description": "VRF id.",
"type": "number"
"type": "integer"
}
}
}
@@ -1369,7 +1369,7 @@
},
"vrf": {
"description": "VRF id.",
"type": "number"
"type": "integer"
},
"metric": {
"description": "Optional metric value (define a NH route's weight / metric).",
@@ -1394,7 +1394,7 @@
},
"vrf": {
"description": "VRF id.",
"type": "number"
"type": "integer"
}
}
}

View File

@@ -251,7 +251,7 @@
]
},
"vrf": {
"type": "number"
"type": "integer"
}
}
}
@@ -269,7 +269,7 @@
]
},
"vrf": {
"type": "number"
"type": "integer"
}
}
}
@@ -547,35 +547,35 @@
"downstream"
]
}
}
},
"instances": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"enabled": {
"type": "boolean",
"default": true
},
"priority": {
"type": "integer",
"default": 32768
},
"forward_delay": {
"type": "integer",
"default": 15
},
"hello_time": {
"type": "integer",
"default": 2
},
"max_age": {
"type": "integer",
"default": 20
},
"instances": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"enabled": {
"type": "boolean",
"default": true
},
"priority": {
"type": "integer",
"default": 32768
},
"forward_delay": {
"type": "integer",
"default": 15
},
"hello_time": {
"type": "integer",
"default": 2
},
"max_age": {
"type": "integer",
"default": 20
}
}
}
}
@@ -1094,7 +1094,7 @@
]
},
"vrf": {
"type": "number"
"type": "integer"
}
}
}
@@ -1119,7 +1119,7 @@
]
},
"vrf": {
"type": "number"
"type": "integer"
},
"metric": {
"type": "number"
@@ -1140,7 +1140,7 @@
]
},
"vrf": {
"type": "number"
"type": "integer"
}
}
}

View File

@@ -280,7 +280,7 @@
},
"vrf": {
"description": "VRF id.",
"type": "number"
"type": "integer"
}
}
}
@@ -301,7 +301,7 @@
},
"vrf": {
"description": "VRF id.",
"type": "number"
"type": "integer"
}
}
}
@@ -618,42 +618,42 @@
"downstream"
]
}
}
},
"instances": {
"description": "Define a list of configuration for each STP instance. Meaning of this field depends on current STP protocol (switch.loop-detection.protocol)",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "Indicates instance to configure. Depends on current STP protocol If RPVSTP/PVSTP - vlan id If MSTP - instance id",
"type": "integer"
},
"enabled": {
"description": "Enable STP on this instance.",
"type": "boolean",
"default": true
},
"priority": {
"description": "Bridge priority.",
"type": "integer",
"default": 32768
},
"forward_delay": {
"description": "Defines the amount of time a switch port stays in the Listening and Learning states before transitioning to the Forwarding state.",
"type": "integer",
"default": 15
},
"hello_time": {
"description": "Determines how often switches send BPDU.",
"type": "integer",
"default": 2
},
"max_age": {
"description": "Specifies the maximum time that a switch port should wait to receive a BPDU from its neighbor before considering the link as failed or disconnected.",
"type": "integer",
"default": 20
},
"instances": {
"description": "Define a list of configuration for each STP instance. Meaning of this field depends on current STP protocol (switch.loop-detection.protocol)",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "Indicates instance to configure. Depends on current STP protocol If RPVSTP/PVSTP - vlan id If MSTP - instance id",
"type": "integer"
},
"enabled": {
"description": "Enable STP on this instance.",
"type": "boolean",
"default": true
},
"priority": {
"description": "Bridge priority.",
"type": "integer",
"default": 32768
},
"forward_delay": {
"description": "Defines the amount of time a switch port stays in the Listening and Learning states before transitioning to the Forwarding state.",
"type": "integer",
"default": 15
},
"hello_time": {
"description": "Determines how often switches send BPDU.",
"type": "integer",
"default": 2
},
"max_age": {
"description": "Specifies the maximum time that a switch port should wait to receive a BPDU from its neighbor before considering the link as failed or disconnected.",
"type": "integer",
"default": 20
}
}
}
}
@@ -1248,7 +1248,7 @@
},
"vrf": {
"description": "VRF id.",
"type": "number"
"type": "integer"
}
}
}
@@ -1277,7 +1277,7 @@
},
"vrf": {
"description": "VRF id.",
"type": "number"
"type": "integer"
},
"metric": {
"description": "Optional metric value (define a NH route's weight / metric).",
@@ -1302,7 +1302,7 @@
},
"vrf": {
"description": "VRF id.",
"type": "number"
"type": "integer"
}
}
}