Skip to content

Commit

Permalink
Closes #614: Add support for module bays and inventory items
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Dec 30, 2021
1 parent dfc7ba6 commit 14217f3
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ to be added.
- `interfaces`
- `rear-ports`
- `front-ports`
- `module-bays`*
- `device-bays`
- `inventory-items`*

*Supported on NetBox v3.2 or later.

The available fields for each type of component are listed below.

Expand Down Expand Up @@ -99,11 +103,24 @@ The available fields for each type of component are listed below.
- `type`: Port type slug (API value)
- `positions`: The number of front ports that can map to this rear port (default: 1)

#### Module Bays

- `name`: Name
- `label`: Label
- `position`: The module bay's position within the parent device

#### Device Bays

- `name`: Name
- `label`: Label

#### Inventory Items

- `name`: Name
- `label`: Label
- `manufacturer`: The name of the manufacturer which produces this item
- `part_id`: The part ID assigned by the manufacturer

## Data Validation / Commit Quality Checks

There are two ways this repo focuses on keeping quality device-type definitions:
Expand Down
47 changes: 47 additions & 0 deletions tests/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,23 @@
"$ref": "#/definitions/rear-port"
}
},
"module-bays": {
"type": "array",
"items": {
"$ref": "#/definitions/module-bay"
}
},
"device-bays": {
"type": "array",
"items": {
"$ref": "#/definitions/device-bay"
}
},
"inventory-items": {
"type": "array",
"items": {
"$ref": "#/definitions/inventory-item"
}
}
},
"required": ["manufacturer", "model", "slug"],
Expand Down Expand Up @@ -537,6 +549,22 @@
"required": ["name", "type"]
},

"module-bay": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"position": {
"type": "string"
}
},
"required": ["name"]
},

"device-bay": {
"type": "object",
"properties": {
Expand All @@ -548,6 +576,25 @@
}
},
"required": ["name"]
},

"inventory-item": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"manufacturer": {
"type": "string"
},
"part_id": {
"type": "string"
}
},
"required": ["name"]
}

}
Expand Down

0 comments on commit 14217f3

Please sign in to comment.