kytos-ng / maintenance

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

Validation of user input for switches, interfaces and links #7

Closed ajoaoff closed 1 year ago

ajoaoff commented 3 years ago

Original issue opened by @italovalcy at https://github.com/kytos/maintenance/issues/37.

When we create a new maintenance window, the user input parameters are not validated: the only check is to make sure the item under MW is a link, interface, or switch (instance_of). It would be nice if we also check if the requested item is an actual existing switch, link, or interface in the topology.

The use case for that is: when the administrator creates a MW with a wrong switch id, for instance, it has no means to know that it was wrong (look at what was happening with the end-to-end tests: https://github.com/amlight/kytos-end-to-end-tests/pull/40/files#diff-cf70db90507ca6705079eaa8362c1b100d07ec22e3b188f8d69c56ce7a4793eaR75)

There may be cases where the administrator can create a MW for future equipment, so it would be nice to allow skip the validation with an option like force (which could also ignore the validations for start/end time - if you will)

Ktmi commented 1 year ago

Closed with #78