ictdesigntools.identifiers¶
Identifiers for spaces, racks, panels, ports, cables and cords, in the ANSI/TIA-606 forms.
Every badge, net flag, schedule row and NetBox label made by the library takes its name from here, so they agree. The forms are those of ANSI/TIA-606-B, table 1 and annex A; check them against the edition a project names (606-C and 606-D keep the same delimiters):
- telecommunications space
[[c-]b-]fs:1DC - cabinet or rack
fs.xy:1DC.AD02 - patch panel
fs.xy-r:1DC.AD02-35 - port
fs.xy-r:p:1DC.AD02-35:01 - cable between panels, near
/far:AD02-35:01 / AG13-07:A1 - patch cord, near
\far:AD07-37:01 \ AD07-07:A1
f is the floor (left out in a one-floor building) and s the space, together one code
such as 1DC or 3TR; c and b are the campus and building, needed from
administration class 3 and 4. x and y are the rack's floor-grid coordinates, letters
then digits. r is the panel's top-most unit counted from the bottom of the rack's usable
space (horizontal cable managers are not counted), with an optional _r2 for a panel or
module inside it. p is the port, and -p2 closes a range of ports. A cable is named from
the end where the label is read: the near end first.
Only ASCII letters, digits and the delimiters -, ., :, _, / and \ are
used, so the names pass through CSV and DCIM imports intact. Where a panel unit uses letters,
I, O and Q are left out as the standard asks.
>>> port = Port(Panel(Rack("AD", "02", Space("1DC")), "35"), "01")
>>> str(port)
'1DC.AD02-35:01'
>>> Port.parse("1DC.AD02-35:01") == port
True
>>> str(Cable(port, Port.parse("1DC.AG13-07:A1")).short())
'AD02-35:01 / AG13-07:A1'
Space
dataclass
¶
A telecommunications space: code is the floor and space together (1DC, 3TR,
405), building and campus the prefixes administration classes 3 and 4 need.
Rack
dataclass
¶
A cabinet or rack by its floor-grid tile: x letters and y digits (AD,
02). space is left out when every rack named is in the same space.
Panel
dataclass
¶
A patch panel (or termination block) by unit, its top-most unit as a fixed number of
digits (35, 07); sub names a panel or module within it.
Port
dataclass
¶
A port on a panel; last closes a range (:01-24).
Cable
dataclass
¶
A cable between two panels (/), or a patch cord (\) when cord is set. The
near end is where the label is read; flipped() gives the label for the far end.
panel_unit ¶
panel_unit(
position: float,
u_height: float,
starting_unit: int = 1,
desc_units: bool = False,
digits: int = 2,
) -> str
The unit a panel is named by: its top-most unit, counted from the bottom of the rack's
usable space. position is NetBox's, the lowest-numbered unit the panel takes. A rack
numbered from the top down (desc_units) names it by the top-most unit's own number, so
the labels match the rails; say so on the drawing.
>>> panel_unit(35, 1), panel_unit(10, 2), panel_unit(10.5, 1), panel_unit(1, 2, desc_units=True)
('35', '11', '11', '01')
Source code in src/ictdesigntools/identifiers.py
panel_of ¶
The identifier of a panel mounted in a rack: device is a spaces.racks.Device
with a position and rack_type the RackType it is in.
>>> from ictdesigntools.spaces.racks import Device, device_type, rack_type
>>> pp = Device(device_type("patch-panel-24-1u"), 42)
>>> str(panel_of(Rack("AD", "02"), pp, rack_type("generic-cabinet-42u-600x1070")))
'AD02-42'
Source code in src/ictdesigntools/identifiers.py
grid_rack ¶
A rack on a floor grid from a column of letters and a row number, the row padded to
digits so the names sort (grid_rack("AD", 2) is AD02).
Source code in src/ictdesigntools/identifiers.py
check_class ¶
What a space's identifier lacks for an administration class: a building from class 3, a campus from class 4. An empty list when it is complete.