Skip to content

DeviceType_Count on Manufacturer #17976

@ZionDials

Description

@ZionDials

Deployment Type

Self-hosted

Triage priority

I volunteer to perform this work (if approved)

NetBox Version

v4.1.6

Python Version

3.10

Steps to Reproduce

GET /api/dcim/device-types/

{
    "count": 2424,
    "next": "https://netbox.com/api/dcim/device-types/?limit=50&offset=50",
    "previous": null,
    "results": [
        {
            "id": 1112,
            "url": "https://netbox.com/api/dcim/device-types/1112/",
            "display_url": "https://netbox.com/dcim/device-types/1112/",
            "display": "Thunder 4440 ADC",
            "manufacturer": {
                "id": 47,
                "url": "https://netbox.com/api/dcim/manufacturers/47/",
                "display": "A10",
                "name": "A10",
                "slug": "a10",
                "description": ""
            },
            "default_platform": null,
            "model": "Thunder 4440 ADC",
            "slug": "a10-thunder-4440-adc",
            "part_number": "TH4440",
            "u_height": 1.0,
            "exclude_from_utilization": false,
            "is_full_depth": true,
            "subdevice_role": null,
            "airflow": null,
            "weight": null,
            "weight_unit": null,
            "front_image": null,
            "rear_image": null,
            "description": "",
            "comments": "[A10 Thunder 4440 Applcation Delivery Controller Datasheet](https://www.a10networks.com/wp-content/uploads/A10-DS-Thunder-ADC.pdf)",
            "tags": [],
            "custom_fields": {},
            "created": "2024-10-28T06:49:53.123905-04:00",
            "last_updated": "2024-10-28T06:49:53.123918-04:00",
            "device_count": 0,
            "console_port_template_count": 0,
            "console_server_port_template_count": 0,
            "power_port_template_count": 0,
            "power_outlet_template_count": 0,
            "interface_template_count": 8,
            "front_port_template_count": 0,
            "rear_port_template_count": 0,
            "device_bay_template_count": 0,
            "module_bay_template_count": 0,
            "inventory_item_template_count": 0
        }
    ]
}

Note "devicetype_count" is missing.

Expected Behavior

The expected response, according to the OpenAPI specification for Netbox:

GET /api/dcim/device-types/

{
    "count": 2424,
    "next": "https://netbox.com/api/dcim/device-types/?limit=50&offset=50",
    "previous": null,
    "results": [
        {
            "id": 1112,
            "url": "https://netbox.com/api/dcim/device-types/1112/",
            "display_url": "https://netbox.com/dcim/device-types/1112/",
            "display": "Thunder 4440 ADC",
            "manufacturer": {
                "id": 47,
                "url": "https://netbox.com/api/dcim/manufacturers/47/",
                "display": "A10",
                "name": "A10",
                "slug": "a10",
                "description": "",
                "devicetype_count": 1
            },
            "default_platform": null,
            "model": "Thunder 4440 ADC",
            "slug": "a10-thunder-4440-adc",
            "part_number": "TH4440",
            "u_height": 1.0,
            "exclude_from_utilization": false,
            "is_full_depth": true,
            "subdevice_role": null,
            "airflow": null,
            "weight": null,
            "weight_unit": null,
            "front_image": null,
            "rear_image": null,
            "description": "",
            "comments": "[A10 Thunder 4440 Applcation Delivery Controller Datasheet](https://www.a10networks.com/wp-content/uploads/A10-DS-Thunder-ADC.pdf)",
            "tags": [],
            "custom_fields": {},
            "created": "2024-10-28T06:49:53.123905-04:00",
            "last_updated": "2024-10-28T06:49:53.123918-04:00",
            "device_count": 0,
            "console_port_template_count": 0,
            "console_server_port_template_count": 0,
            "power_port_template_count": 0,
            "power_outlet_template_count": 0,
            "interface_template_count": 8,
            "front_port_template_count": 0,
            "rear_port_template_count": 0,
            "device_bay_template_count": 0,
            "module_bay_template_count": 0,
            "inventory_item_template_count": 0
        }
    ]
}

Observed Behavior

According to the OpenAPI specification BriefManufacturer has a required field of "devicetype_count". However, when querying DeviceTypes and ModuleTypes, the field is not populated and causes SDKs using the OpenAPI generator, to fail.

Go-Netbox Creating Manufacture errors out because of missing required property devicetype_count #165

Metadata

Metadata

Assignees

No one assigned

    Labels

    netboxseverity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: backlogAwaiting selection for worktype: bugA confirmed report of unexpected behavior in the application

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions