kytos-ng / maintenance

Kytos Maintenance Window NApp
https://kytos-ng.github.io/api/maintenance.html
0 stars 7 forks source link

It's not allowing to create a MW on an existing interface #82

Closed viniarck closed 6 months ago

viniarck commented 9 months ago

It's not allowing to create a MW on an existing interface

How to reproduce

❯ curl -s http://0.0.0.0:8181/api/kytos/topology/v3/interfaces/ | jq '.interfaces["00:00:00:00:00:00:00:01:1"]'
{
  "id": "00:00:00:00:00:00:00:01:1",
  "name": "s1-eth1",
  "port_number": 1,
  "mac": "a2:be:76:40:16:7e",
  "switch": "00:00:00:00:00:00:00:01",
  "type": "interface",
  "nni": false,
  "uni": true,
  "speed": 1250000000.0,
  "metadata": {},
  "lldp": true,
  "active": true,
  "enabled": true,
  "status": "UP",
  "status_reason": [],
  "link": ""
}
❯ curl -H 'Content-Type: application/json' -X POST http://127.0.0.1:8181/api/kytos/maintenance/v1/ -d '{ "id": "some_mw", "description": "some_mw", "start": "2023-12-12T17:03:00-0300", "end": "2023-12-12T17:10:00-0300", "interfaces": [ "00:00:00:00:00:00:00:01:1" ] }'
{"description":"Window contains non-existant items: {'switches': [], 'interfaces': [], 'links': ['00:00:00:00:00:00:00:01:1']}","code":400}

Notice it returned 400, and returned that a link wasn't found, so it's incorrectly trying to find an interface as a link apparently. Also, trivial detail, but there's a typo "existant" instead of "existent"

cc'ing @Ktmi and @italovalcy for their information, for now leave this without any priority label (Italo feel free to set it if you'll need to use this in the short term), but good thing that links MW are being created, so it can be used trying to target the underlying interface. In the future, when this gets prioritized and fixed let's also cover this with e2e test too.

viniarck commented 7 months ago

@HeriLFIU will work on this one. Thanks, Heriberto.