fix: use object_types instead of content_types for NetBox 4.4.x custom fields

The NetBox API changed the field name from content_types to object_types.
This commit is contained in:
2026-02-04 15:08:01 +00:00
parent 3672f25ffc
commit f4ba38a735

View File

@@ -56,7 +56,7 @@ DEVICE_TYPE_SLUG = "ceos-lab"
CUSTOM_FIELDS = [
# Device custom fields
{
"content_types": ["dcim.device"],
"object_types": ["dcim.device"],
"name": "asn",
"label": "ASN",
"type": "integer",
@@ -64,7 +64,7 @@ CUSTOM_FIELDS = [
"description": "BGP Autonomous System Number assigned to this device",
},
{
"content_types": ["dcim.device"],
"object_types": ["dcim.device"],
"name": "mlag_domain_id",
"label": "MLAG Domain ID",
"type": "text",
@@ -72,7 +72,7 @@ CUSTOM_FIELDS = [
"description": "MLAG domain identifier",
},
{
"content_types": ["dcim.device"],
"object_types": ["dcim.device"],
"name": "mlag_peer_address",
"label": "MLAG Peer Address",
"type": "text",
@@ -80,7 +80,7 @@ CUSTOM_FIELDS = [
"description": "MLAG peer IP address",
},
{
"content_types": ["dcim.device"],
"object_types": ["dcim.device"],
"name": "mlag_local_address",
"label": "MLAG Local Address",
"type": "text",
@@ -88,7 +88,7 @@ CUSTOM_FIELDS = [
"description": "MLAG local IP address",
},
{
"content_types": ["dcim.device"],
"object_types": ["dcim.device"],
"name": "mlag_virtual_mac",
"label": "MLAG Virtual MAC",
"type": "text",
@@ -97,7 +97,7 @@ CUSTOM_FIELDS = [
},
# Interface custom fields
{
"content_types": ["dcim.interface"],
"object_types": ["dcim.interface"],
"name": "mlag_peer_link",
"label": "MLAG Peer Link",
"type": "boolean",
@@ -105,7 +105,7 @@ CUSTOM_FIELDS = [
"description": "Marks interface as MLAG peer-link",
},
{
"content_types": ["dcim.interface"],
"object_types": ["dcim.interface"],
"name": "mlag_id",
"label": "MLAG ID",
"type": "integer",
@@ -114,7 +114,7 @@ CUSTOM_FIELDS = [
},
# VRF custom fields
{
"content_types": ["ipam.vrf"],
"object_types": ["ipam.vrf"],
"name": "l3vni",
"label": "L3 VNI",
"type": "integer",
@@ -122,7 +122,7 @@ CUSTOM_FIELDS = [
"description": "Layer 3 VNI for EVPN symmetric IRB",
},
{
"content_types": ["ipam.vrf"],
"object_types": ["ipam.vrf"],
"name": "vrf_vlan",
"label": "VRF VLAN",
"type": "integer",
@@ -131,7 +131,7 @@ CUSTOM_FIELDS = [
},
# IP Address custom fields
{
"content_types": ["ipam.ipaddress"],
"object_types": ["ipam.ipaddress"],
"name": "virtual_ip",
"label": "Virtual IP",
"type": "boolean",