From dfc7ba6df5d248e36f9fdb6c6088ffab44c9e0fb Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Thu, 30 Dec 2021 13:41:40 -0500 Subject: [PATCH] Closes #613: Add support for component labels --- README.md | 26 +++++++++++++++++--------- tests/schema.json | 24 ++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4160f91e7..00d43784a 100644 --- a/README.md +++ b/README.md @@ -51,57 +51,65 @@ The available fields for each type of component are listed below. #### Console Ports -- `name`: Port name +- `name`: Name +- `label`: Label - `type`: Port type slug (API value) #### Console Server Ports -- `name`: Port name +- `name`: Name +- `label`: Label - `type`: Port type slug (API value) #### Power Ports -- `name`: Port name +- `name`: Name +- `label`: Label - `type`: Port type slug (API value) - `maximum_draw`: The port's maximum power draw, in watts (optional) - `allocated_draw`: The port's allocated power draw, in watts (optional) #### Power Outlets -- `name`: Outlet name +- `name`: Name +- `label`: Label - `type`: Port type slug (API value) - `power_port`: The name of the power port on the device which powers this outlet (optional) - `feed_leg`: The phase (leg) of power to which this outlet is mapped; A, B, or C (optional) #### Interfaces -- `name`: Interface name +- `name`: Name +- `label`: Label - `type`: Interface type slug (API value) - `mgmt_only`: A boolean which indicates whether this interface is used for management purposes only (default: false) #### Front Ports -- `name`: Port name +- `name`: Name +- `label`: Label - `type`: Port type slug (API value) - `rear_port`: The name of the rear port on this device to which the front port maps - `rear_port_position`: The corresponding position on the mapped rear port (default: 1) #### Rear Ports -- `name`: Port name +- `name`: Name +- `label`: Label - `type`: Port type slug (API value) - `positions`: The number of front ports that can map to this rear port (default: 1) #### Device Bays -- `name`: Bay name +- `name`: Name +- `label`: Label ## Data Validation / Commit Quality Checks There are two ways this repo focuses on keeping quality device-type definitions: - Pre-Commit Checks - Optional for helping to identify simple issues before committing. (trailing-whitespace, end-of-file-fixer, check-yaml, yamlfmt, yamllint) - - [Install pre-commit](https://pre-commit.com/#install) (or just use the requirements.txt file) + - [Install pre-commit](https://pre-commit.com/#install) (`pip install pre-commit`) - To install the pre-commit script `pre-commit install` - To run the pre-commit script on changed files `pre-commit run` - To run the pre-commit script on all files `pre-commit run --all` diff --git a/tests/schema.json b/tests/schema.json index e27e817ea..c6bd50894 100644 --- a/tests/schema.json +++ b/tests/schema.json @@ -87,6 +87,9 @@ "name": { "type": "string" }, + "label": { + "type": "string" + }, "type": { "type": "string", "enum": [ @@ -116,6 +119,9 @@ "name": { "type": "string" }, + "label": { + "type": "string" + }, "type": { "type": "string", "enum": [ @@ -144,6 +150,9 @@ "name": { "type": "string" }, + "label": { + "type": "string" + }, "type": { "type": "string", "enum": [ @@ -251,6 +260,9 @@ "name": { "type": "string" }, + "label": { + "type": "string" + }, "type": { "type": "string", "enum": [ @@ -352,6 +364,9 @@ "name": { "type": "string" }, + "label": { + "type": "string" + }, "type": { "type": "string", "enum": [ @@ -443,6 +458,9 @@ "name": { "type": "string" }, + "label": { + "type": "string" + }, "type": { "type": "string", "enum": [ @@ -484,6 +502,9 @@ "name": { "type": "string" }, + "label": { + "type": "string" + }, "type": { "type": "string", "enum": [ @@ -521,6 +542,9 @@ "properties": { "name": { "type": "string" + }, + "label": { + "type": "string" } }, "required": ["name"]