Enforce component properties (#3391)

* Disable additional properties for components

It is not a global option, it needs to be set per-definition.
Enabling it produces a lot of validation errors.

* Update json schema

Add missing fields and value constraints. The `rf_role` enum is
currently not included in the `generated_schema.json` from upstream,
so I "faked" it for now by added it manually.

* Rework custom power source marker

While you could technically have a device that does PoE and serial
console on the same port, this is just one very specific scenario.
Rename the custom property from `poe` to `_is_power_source` to be more
general and better reflect its intention, and properly document it in
the json schema.
Remove the property from device types where it is false, and where it's
unneeded because power-ports exist.

* Fix power draw

In NetBox the PSU modules have a power draw, but not the module-bays you
can put them into; so remove it from those. Plus some minor corrections.

* Fix PoE

Basically fix the casing by renaming from the wrong kebab-case to the
correct snake_case.

* Turn invalid comments into description

Only device types can have `comments`, everything else is limited to
`description`. So turn all invalid comments into descriptions.

* Fix mgmt_only

Console port in NetBox don't have a `mgmt_only` property, because they
are by definition management-only.

* Fix position(s)

Device bays don't have a position, because the child devices are
completely separate and don't share any naming/numbering.

* Miscellaneous fixes

Everything that didn't fit into the prior larger error categories.
Validation now passes again.
This commit is contained in:
m-hau
2025-08-08 23:10:01 +02:00
committed by GitHub
parent eeadf01038
commit 9e6cf8d017
173 changed files with 752 additions and 1037 deletions

View File

@@ -14,7 +14,7 @@ comments: Rack PDU, Basic, 0U/1U, 208V, 30A, (4) C19
power-ports:
- name: Source
type: nema-l6-30p
comments: 12f cord
description: 12f cord
power-outlets:
- name: Outlet 1
type: iec-60320-c19

View File

@@ -14,7 +14,7 @@ comments: Rack PDU, Basic, 0U/1U, 208V, 8.6kW, (3) C19
power-ports:
- name: Source
type: nema-l15-30p
comments: 12f cord
description: 12f cord
power-outlets:
- name: Outlet 1
type: iec-60320-c19

View File

@@ -14,7 +14,7 @@ comments: Rack PDU, Basic, 1U, 30A, 120V, (10)5-20
power-ports:
- name: Source
type: nema-l5-30p
comments: 12ft cord
description: 12ft cord
power-outlets:
- name: Outlet 1
type: nema-5-20r

View File

@@ -14,7 +14,7 @@ comments: Rack PDU, Basic, 1U, 15A, 120V, (10)5-15
power-ports:
- name: Source
type: nema-5-15p
comments: 12ft cord
description: 12ft cord
power-outlets:
- name: Outlet 1
type: nema-5-15r

View File

@@ -14,7 +14,7 @@ comments: Rack PDU, Basic, 1U, 20A, 120V, (10)5-20, 5-20P
power-ports:
- name: Source
type: nema-5-20p
comments: 12ft cord
description: 12ft cord
power-outlets:
- name: Outlet 1
type: nema-5-20r

View File

@@ -14,7 +14,7 @@ comments: Rack PDU, Basic, 1U, 20A, 120V, (10)5-20; L5-20P
power-ports:
- name: Source
type: nema-l5-20p
comments: 12ft cord
description: 12ft cord
power-outlets:
- name: Outlet 1
type: nema-5-20r

View File

@@ -14,7 +14,7 @@ comments: Rack PDU, Basic, 1U, 30A, 208V, (4) C19s
power-ports:
- name: Source
type: nema-l6-30p
comments: 10ft cord
description: 10ft cord
power-outlets:
- name: Outlet 1
type: iec-60320-c19

View File

@@ -14,7 +14,7 @@ comments: Rack PDU, Basic, 1U, 30A, 208V, (10) C13
power-ports:
- name: Source
type: nema-l6-30p
comments: 12ft cord
description: 12ft cord
power-outlets:
- name: Outlet 1
type: iec-60320-c13