Path Status "Not Reachable" after edit cable terminaison by API #8786

Closed
opened 2025-12-29 20:41:12 +01:00 by adam · 1 comment
Owner

Originally created by @Etibru on GitHub (Oct 30, 2023).

NetBox version

v3.6.4

Python version

3.9

Steps to Reproduce

  1. Create 2 devices, one with 2 interfaces
    For exemple :
  • Device A, interface ge0/1 (interface id 1)
  • Device B, interfaces ge0/1 (interface id 2) and ge0/2 (interface id 3)
  1. Create cable between device A (ge0/1) to device B (ge0/1) (cable id 1)
    Creation by API or by front-end is OK.

  2. now I want to modify the b terminaison using the API, so move terminaison ge0/1 to ge0/2 on device B
    I use this API /api/dcim/cables/1/, with this datas:

{
  "type": "cat3",
  "a_terminations": [
    {
      "object_type": "dcim.interface",
      "object_id": 1
    }
  ],
  "b_terminations": [
    {
      "object_type": "dcim.interface",
      "object_id": 3
    }
  ],
  "status": "connected"
}

The result is 200 with this result:

{
  "id": 1,
  "url": "http://X.X.X.X/api/dcim/cables/1/",
  "display": "#1",
  "type": "cat3",
  "a_terminations": [
    {
      "object_type": "dcim.interface",
      "object_id": 1,
      "object": {
        "id": 1,
        "url": "http://X.X.X.X/api/dcim/interfaces/1/",
        "display": "ge1/0",
        "device": {
          "id": 1,
          "url": "http://X.X.X.X/api/dcim/devices/1/",
          "display": "A",
          "name": "A"
        },
        "name": "mgmt0",
        "cable": 1,
        "_occupied": true
      }
    }
  ],
  "b_terminations": [
    {
      "object_type": "dcim.interface",
      "object_id": 3,
      "object": {
        "id": 3,
        "url": "http://X.X.X.X/api/dcim/interfaces/3/",
        "display": "ge0/2",
        "device": {
          "id": 2,
          "url": "http://X.X.X.X/api/dcim/devices/2/",
          "display": "B",
          "name": "B"
        },
        "name": "ge0/2",
        "cable": null,
        "_occupied": false
      }
    }
  ],
  "status": {
    "value": "connected",
    "label": "Connected"
  },
  "tenant": null,
  "label": "",
  "color": "",
  "length": null,
  "length_unit": null,
  "description": "",
  "comments": "",
  "tags": [],
  "custom_fields": {},
  "created": "2023-10-30T09:53:55.841957Z",
  "last_updated": "2023-10-30T09:57:11.246006Z"
}

Expected Behavior

In the result of the API, in the section "b_terminations", maybe we need to have the fields "cable" and "_occupied" updated, so not with null and false.

Observed Behavior

Once the modification has been made, the cable is not updated on the updated interface side.
What's more, when the interface is consulted from the front-end, the cable is referenced, but with a Path Status of Not Reachable.

image

Originally created by @Etibru on GitHub (Oct 30, 2023). ### NetBox version v3.6.4 ### Python version 3.9 ### Steps to Reproduce 1. Create 2 devices, one with 2 interfaces For exemple : - Device A, interface ge0/1 (interface id 1) - Device B, interfaces ge0/1 (interface id 2) and ge0/2 (interface id 3) 2. Create cable between device A (ge0/1) to device B (ge0/1) (cable id 1) Creation by API or by front-end is OK. 3. now I want to modify the b terminaison using the API, so move terminaison ge0/1 to ge0/2 on device B I use this API **/api/dcim/cables/1/**, with this datas: ```json { "type": "cat3", "a_terminations": [ { "object_type": "dcim.interface", "object_id": 1 } ], "b_terminations": [ { "object_type": "dcim.interface", "object_id": 3 } ], "status": "connected" } ``` The result is 200 with this result: ```json { "id": 1, "url": "http://X.X.X.X/api/dcim/cables/1/", "display": "#1", "type": "cat3", "a_terminations": [ { "object_type": "dcim.interface", "object_id": 1, "object": { "id": 1, "url": "http://X.X.X.X/api/dcim/interfaces/1/", "display": "ge1/0", "device": { "id": 1, "url": "http://X.X.X.X/api/dcim/devices/1/", "display": "A", "name": "A" }, "name": "mgmt0", "cable": 1, "_occupied": true } } ], "b_terminations": [ { "object_type": "dcim.interface", "object_id": 3, "object": { "id": 3, "url": "http://X.X.X.X/api/dcim/interfaces/3/", "display": "ge0/2", "device": { "id": 2, "url": "http://X.X.X.X/api/dcim/devices/2/", "display": "B", "name": "B" }, "name": "ge0/2", "cable": null, "_occupied": false } } ], "status": { "value": "connected", "label": "Connected" }, "tenant": null, "label": "", "color": "", "length": null, "length_unit": null, "description": "", "comments": "", "tags": [], "custom_fields": {}, "created": "2023-10-30T09:53:55.841957Z", "last_updated": "2023-10-30T09:57:11.246006Z" } ``` ### Expected Behavior In the result of the API, in the section "b_terminations", maybe we need to have the fields "**cable**" and "**_occupied**" updated, so not with null and false. ### Observed Behavior Once the modification has been made, the cable is not updated on the updated interface side. What's more, when the interface is consulted from the front-end, the cable is referenced, but with a Path Status of Not Reachable. ![image](https://github.com/netbox-community/netbox/assets/56799322/1425103b-8359-4028-a3c4-9b601f2e011a)
adam closed this issue 2025-12-29 20:41:12 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 5, 2023):

You must use the cable terminations API endpoint (/api/dcim/cable-terminations/) to modify cable terminations. These may not be set on cables directly.

@jeremystretch commented on GitHub (Dec 5, 2023): You must use the cable terminations API endpoint (`/api/dcim/cable-terminations/`) to modify cable terminations. These may not be set on cables directly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8786