atlanticwave-sdx / sdx-controller

Central Controller for AtlanticWave SDX.
https://www.atlanticwave-sdx.net
MIT License
1 stars 3 forks source link

299 sdx controller must have new endpoints according to specification 20 #318

Closed YufengXin closed 3 weeks ago

YufengXin commented 3 weeks ago

spec v2:

  1. /connection -> /l2vpn
  2. adding the patch method
coveralls commented 3 weeks ago

Pull Request Test Coverage Report for Build 10464630503

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
sdx_controller/models/l2vpn_body.py 10 13 76.92%
sdx_controller/models/l2vpn_service_id_body.py 10 13 76.92%
sdx_controller/models/connection_v2_notifications.py 14 20 70.0%
sdx_controller/controllers/l2vpn_controller.py 9 18 50.0%
sdx_controller/models/connection_qos_unit.py 18 27 66.67%
sdx_controller/models/connection_scheduling.py 18 27 66.67%
sdx_controller/models/connection_v2_endpoints.py 18 27 66.67%
sdx_controller/models/connection_v2.py 107 133 80.45%
sdx_controller/models/connection_qos_metrics.py 47 77 61.04%
<!-- Total: 251 355 70.7% -->
Totals Coverage Status
Change from base Build 10351089160: 4.4%
Covered Lines: 1038
Relevant Lines: 1858

💛 - Coveralls
YufengXin commented 3 weeks ago

there are a few "unused" classes in models: for v2 and other future implementation

sajith commented 3 weeks ago

there are a few "unused" classes in models: for v2 and other future implementation

It probably might be better to not use the generated models at all? A better way might be to write the models using pydantic in datamodel, and use them in the handlers and tests. That way we will be using Swagger Studio (or other tools) only to design the OpenAPI spec. I wrote up an issue about this: https://github.com/atlanticwave-sdx/datamodel/issues/144.

From my quick testing, I think pydantic might work just fine for us. This might also solve https://github.com/atlanticwave-sdx/datamodel/issues/92 in an elegant way.

YufengXin commented 3 weeks ago

Right! I'll learn and do...Thx

sajith commented 3 weeks ago

I am only weakly proposing this for now, to see if there is anything that I am missing because I have no experience with the current workflow (of generating code and updating it in sdx-controller and elsewhere). I will try writing some code with pydantic and see how well things work, and then propose changes more strongly if my assumptions about how things might work turn out to be true. :-)

We have higher priority things to do for now anyway. So this might be after October or so.