Add netbox_rack_type module and rack_type option for netbox_rack - #1576
Add netbox_rack_type module and rack_type option for netbox_rack#1576jbartus wants to merge 3 commits into
Conversation
…lookup endpoint Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ldrozdz93
left a comment
There was a problem hiding this comment.
[claude]
Review Summary
LGTM — approving. netbox_rack_type faithfully mirrors the canonical netbox_device_type module, and the framework registration across the shared netbox_utils.py registries (API_APPS_ENDPOINTS, QUERY_TYPES, CONVERT_TO_ID, ENDPOINT_NAME_MAPPING, ALLOWED_QUERY_PARAMS, SLUG_REQUIRED) is complete and consistent with its siblings.
The _convert_identical_keys guard correctly preserves form_factor for the rack_types endpoint end-to-end: form_factor is not in CONVERT_KEYS, and run()'s rack block is gated on endpoint_name == "rack" (which is "rack_type" here), so neither path rewrites it. The new unit test pins both arms of the guard, the unit suite passes, and black is clean.
One non-blocking wording nit left inline on the new comment.
wording correction/improvement Co-authored-by: ldrozdz93 <39065752+ldrozdz93@users.noreply.github.com>
|
Approved, but there's a CI failure. |
New Behavior
netbox_rack_typemodule to create/update/delete rack types (dcim.rack-types, NetBox v4.1+).rack_typeoption onnetbox_rackto associate a rack with a type.rack-typesendpoint innb_lookup.Contrast to Current Behavior
Rack types can't be managed through the collection today (only via raw
uritasks). Includes a one-line fix in_convert_identical_keys()so theform_factor→typelegacy conversion skips therack_typesendpoint, which usesform_factornatively; covered by a unit test.Discussion: Benefits and Drawbacks
Fills a NetBox 4.1 gap. Backwards-compatible. Tested end-to-end against NetBox v4.5 plus unit/integration tests.
Changes to the Documentation
Adds the
NB_RACK_TYPESautodata entry.Proposed Release Note Entry
Added
netbox_rack_typemodule, arack_typeoption onnetbox_rack, and arack-typesendpoint innb_lookup.Double Check
develbranch.