openBackhaul / MicroWaveDeviceInventory

Physical and logical inventory of the MW SDN Domain
Apache License 2.0
5 stars 1 forks source link

/core-model-1-4:network-control-domain=cache/link={uuid}/link-port={uuid} - PUT for unknown link #970

Closed kmohr-soprasteria closed 2 weeks ago

kmohr-soprasteria commented 2 months ago

Link-Port data can only be put if the related link is already inside the cache.

For now it's okay, if we just allow linkports to be put, if the link is already there. (If we decide we want to be able to also put linkports if the link is not yet there, I think we can add that functionality still later on.)

But: the responseMessage should at least indicate that the put failed, because the link is missing in the cache. So it should be something like "link >linkId< not found in cache: cannot put linkport for unknown link"


If I try the following put request I end up with a 500: image

However, if I put the link first:

and then try again, I get a 204: image

kmohr-soprasteria commented 1 month ago

The >...< in the example message "link >linkId< not found in cache: cannot put linkport for unknown link" should just outline that the linkid is a parameter and the >< should not actually be included in the message.

Ziabatcha commented 1 month ago

Tested with 1.1.2e and observed 404 response with message ("code": 404, "message": "link >533616788< not found in cache: cannot put linkport for unknown link" )

http://xxx:xxx/core-model-1-4:network-control-domain=cache/link=533616788/link-port=5

Body:
{
  "core-model-1-4:link-port": [
    {
      "local-id": "5",
      "link-port-direction": "core-model-1-4:PORT_DIRECTION_INPUT",
      "logical-termination-point": "513250008+2146435233"
    }
  ]
}
Response

{
  "code": 404,
  "message": "link >533616788< not found in cache: cannot put linkport for unknown link"
}
Ziabatcha commented 2 weeks ago

Tested with 1.1.2f and observed 404 response with message ("code": 404, "message": "link 533616788 not found in cache: cannot put linkport for unknown link"

Expected 404 response while trying to do the PUT for unknown link. its working as expected hence closing the issue

API: http://XX:XX/core-model-1-4:network-control-domain=cache/link=533616788/link-port=6
Body:
{
  "core-model-1-4:link-port": [
    {
      "local-id": "6",
      "link-port-direction": "core-model-1-4:PORT_DIRECTION_INPUT",
      "logical-termination-point": "513250008+2146435233"
    }
  ]
}

Response:
{
  "code": 404,
  "message": "link 533616788 not found in cache: cannot put linkport for unknown link"
}