Extension of cable information available via API (v3.3-beta1) #6721

Closed
opened 2025-12-29 19:44:29 +01:00 by adam · 0 comments
Owner

Originally created by @tomasz-c on GitHub (Jul 27, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.3-beta1

Feature type

Data model extension

Proposed functionality

The current beta version (v3.3-beta1) has severely limited the cable information available through the API.
This feature request is a request to restore the cable information that is available in Netbox version 3.2.x

Until now, there was a lot of information available regarding the cable:
https://demo.netbox.dev/api/dcim/cables/1/

{
    "id": 1,
    "url": "https://demo.netbox.dev/api/dcim/cables/1/",
    "display": "#1",
    "termination_a_type": "circuits.circuittermination",
    "termination_a_id": 15,
    "termination_a": {
        "id": 15,
        "url": "https://demo.netbox.dev/api/circuits/circuit-terminations/15/",
        "display": "Termination Z: DM-Yonkers",
        "circuit": {
            "id": 14,
            "url": "https://demo.netbox.dev/api/circuits/circuits/14/",
            "display": "DEOW4921",
            "cid": "DEOW4921"
        },
        "term_side": "Z",
        "cable": 1,
        "_occupied": true
    },
    "termination_b_type": "dcim.interface",
    "termination_b_id": 157,
    "termination_b": {
        "id": 157,
        "url": "https://demo.netbox.dev/api/dcim/interfaces/157/",
        "display": "GigabitEthernet0/0/0",
        "device": {
            "id": 13,
            "url": "https://demo.netbox.dev/api/dcim/devices/13/",
            "display": "dmi01-yonkers-rtr01",
            "name": "dmi01-yonkers-rtr01"
        },
        "name": "GigabitEthernet0/0/0",
        "cable": 1,
        "_occupied": true
    },
    "type": "smf",
    "status": {
        "value": "connected",
        "label": "Connected"
    },
    "tenant": null,
    "label": "",
    "color": "ffeb3b",
    "length": null,
    "length_unit": null,
    "tags": [],
    "custom_fields": {},
    "created": "2020-12-30T00:00:00Z",
    "last_updated": "2020-12-30T19:32:32.279000Z"
}

and in the beta version there are only object IDs:
https://beta-demo.netbox.dev/api/dcim/cables/1/

{
    "id": 1,
    "url": "https://beta-demo.netbox.dev/api/dcim/cables/1/",
    "display": "#1",
    "type": "smf",
    "a_terminations": [
        {
            "object_type": "circuits.circuittermination",
            "object_id": 15
        }
    ],
    "b_terminations": [
        {
            "object_type": "dcim.interface",
            "object_id": 157
        }
    ],
    "status": {
        "value": "connected",
        "label": "Connected"
    },
    "tenant": null,
    "label": "",
    "color": "ffeb3b",
    "length": null,
    "length_unit": null,
    "tags": [],
    "custom_fields": {},
    "created": "2020-12-30T00:00:00Z",
    "last_updated": "2020-12-30T19:32:32.279000Z"
}

I understand that version 3.3 allows to connect multiple ends with one cable, but the result presented in the API could simply be a lists of dictionaries (a_terminations and b_terminations) similar to the one in the current version (v3.2), for example:

{
    "id": 1,
    "url": "https://beta-demo.netbox.dev/api/dcim/cables/1/",
    "display": "#1",
    "type": "smf",
    "a_terminations": [
        {
            "type": "circuits.circuittermination",
            "id": 15,
            "url": "https://demo.netbox.dev/api/circuits/circuit-terminations/15/",
            "display": "Termination Z: DM-Yonkers",
            "circuit": {
                "id": 14,
                "url": "https://demo.netbox.dev/api/circuits/circuits/14/",
                "display": "DEOW4921",
                "cid": "DEOW4921"
            },
            "term_side": "Z",
            "cable": 1,
            "_occupied": true
        }
    ],
    "b_terminations": [
        {
            "type": "dcim.interface",
            "id": 157,
            "url": "https://demo.netbox.dev/api/dcim/interfaces/157/",
            "display": "GigabitEthernet0/0/0",
            "device": {
                "id": 13,
                "url": "https://demo.netbox.dev/api/dcim/devices/13/",
                "display": "dmi01-yonkers-rtr01",
                "name": "dmi01-yonkers-rtr01"
            },
            "name": "GigabitEthernet0/0/0",
            "cable": 1,
            "_occupied": true
        }
    ],
    "status": {
        "value": "connected",
        "label": "Connected"
    },
    "tenant": null,
    "label": "",
    "color": "ffeb3b",
    "length": null,
    "length_unit": null,
    "tags": [],
    "custom_fields": {},
    "created": "2020-12-30T00:00:00Z",
    "last_updated": "2020-12-30T19:32:32.279000Z"
}

Use case

Making it easier to retrieve cable information using the API so that we don't have to generate additional requests to follow objects to get more information.

Database changes

No response

External dependencies

No response

Originally created by @tomasz-c on GitHub (Jul 27, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.3-beta1 ### Feature type Data model extension ### Proposed functionality The current beta version (v3.3-beta1) has severely limited the cable information available through the API. This feature request is a request to restore the cable information that is available in Netbox version 3.2.x Until now, there was a lot of information available regarding the cable: https://demo.netbox.dev/api/dcim/cables/1/ ```json { "id": 1, "url": "https://demo.netbox.dev/api/dcim/cables/1/", "display": "#1", "termination_a_type": "circuits.circuittermination", "termination_a_id": 15, "termination_a": { "id": 15, "url": "https://demo.netbox.dev/api/circuits/circuit-terminations/15/", "display": "Termination Z: DM-Yonkers", "circuit": { "id": 14, "url": "https://demo.netbox.dev/api/circuits/circuits/14/", "display": "DEOW4921", "cid": "DEOW4921" }, "term_side": "Z", "cable": 1, "_occupied": true }, "termination_b_type": "dcim.interface", "termination_b_id": 157, "termination_b": { "id": 157, "url": "https://demo.netbox.dev/api/dcim/interfaces/157/", "display": "GigabitEthernet0/0/0", "device": { "id": 13, "url": "https://demo.netbox.dev/api/dcim/devices/13/", "display": "dmi01-yonkers-rtr01", "name": "dmi01-yonkers-rtr01" }, "name": "GigabitEthernet0/0/0", "cable": 1, "_occupied": true }, "type": "smf", "status": { "value": "connected", "label": "Connected" }, "tenant": null, "label": "", "color": "ffeb3b", "length": null, "length_unit": null, "tags": [], "custom_fields": {}, "created": "2020-12-30T00:00:00Z", "last_updated": "2020-12-30T19:32:32.279000Z" } ``` and in the beta version there are only object IDs: https://beta-demo.netbox.dev/api/dcim/cables/1/ ```json { "id": 1, "url": "https://beta-demo.netbox.dev/api/dcim/cables/1/", "display": "#1", "type": "smf", "a_terminations": [ { "object_type": "circuits.circuittermination", "object_id": 15 } ], "b_terminations": [ { "object_type": "dcim.interface", "object_id": 157 } ], "status": { "value": "connected", "label": "Connected" }, "tenant": null, "label": "", "color": "ffeb3b", "length": null, "length_unit": null, "tags": [], "custom_fields": {}, "created": "2020-12-30T00:00:00Z", "last_updated": "2020-12-30T19:32:32.279000Z" } ``` I understand that version 3.3 allows to connect multiple ends with one cable, but the result presented in the API could simply be a lists of dictionaries (`a_terminations` and `b_terminations`) similar to the one in the current version (v3.2), for example: ```json { "id": 1, "url": "https://beta-demo.netbox.dev/api/dcim/cables/1/", "display": "#1", "type": "smf", "a_terminations": [ { "type": "circuits.circuittermination", "id": 15, "url": "https://demo.netbox.dev/api/circuits/circuit-terminations/15/", "display": "Termination Z: DM-Yonkers", "circuit": { "id": 14, "url": "https://demo.netbox.dev/api/circuits/circuits/14/", "display": "DEOW4921", "cid": "DEOW4921" }, "term_side": "Z", "cable": 1, "_occupied": true } ], "b_terminations": [ { "type": "dcim.interface", "id": 157, "url": "https://demo.netbox.dev/api/dcim/interfaces/157/", "display": "GigabitEthernet0/0/0", "device": { "id": 13, "url": "https://demo.netbox.dev/api/dcim/devices/13/", "display": "dmi01-yonkers-rtr01", "name": "dmi01-yonkers-rtr01" }, "name": "GigabitEthernet0/0/0", "cable": 1, "_occupied": true } ], "status": { "value": "connected", "label": "Connected" }, "tenant": null, "label": "", "color": "ffeb3b", "length": null, "length_unit": null, "tags": [], "custom_fields": {}, "created": "2020-12-30T00:00:00Z", "last_updated": "2020-12-30T19:32:32.279000Z" } ``` ### Use case Making it easier to retrieve cable information using the API so that we don't have to generate additional requests to follow objects to get more information. ### Database changes _No response_ ### External dependencies _No response_
adam added the status: acceptedtype: featurebeta labels 2025-12-29 19:44:29 +01:00
adam closed this issue 2025-12-29 19:44:30 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6721