kytos-ng / maintenance

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

POST /api/kytos/maintenance/ is allowing overwrite the `status` #48

Closed viniarck closed 1 year ago

viniarck commented 2 years ago

Currently, if the status is set, which is meant for the backend to control the state of the maintenance window, it's being accepted, as a result users can create inconsistencies for instance a maintenance window that hasn't started yet, but is already finished:

{
    "id": "some_mw",
    "description": "some_mw",
    "start": "2022-03-11T12:05:01-0300",
    "end": "2022-03-11T14:38:01-0300",
    "items": [
        "{{dpid}}"
    ],
    "status": 2
}