mirror of
https://github.com/Telecominfraproject/ols-ucentral-schema.git
synced 2026-03-20 03:39:31 +00:00
Compare commits
2 Commits
change_vrf
...
fix_loop_d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3f610d9ef | ||
|
|
711d7d9066 |
@@ -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.
|
||||
|
||||
109
schemareader.uc
109
schemareader.uc
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user