kytos-ng / pathfinder

Kytos main path finder Network Application (NApp)
https://kytos-ng.github.io/api/pathfinder.html
MIT License
0 stars 7 forks source link

chore: `@rest` endpoints are now run by `starlette/uvicorn` instead of `flask/werkzeug` #45

Closed viniarck closed 1 year ago

viniarck commented 1 year ago

Closes #42 Closes #40

This PR depends on https://github.com/kytos-ng/kytos/pull/375

(I'll revert the pinned branch feat/starlette on requirements/dev.in later on, it's need for tests to pass)

Summary

Notice that requirements/dev.in is being used directly now instead of requirements/dev.txt to simplify code maintenance and house keeping, for more information check out the linked issue, in summary, we're making a trade-off to trust kytos-ng dev upstream transitive dependencies.

Local Tests

POST /api/kytos/pathfinder/v2/ (with a ring topology)

{
    "paths": [
        {
            "hops": [
                "00:00:00:00:00:00:00:01:1",
                "00:00:00:00:00:00:00:01",
                "00:00:00:00:00:00:00:01:4",
                "00:00:00:00:00:00:00:03:3",
                "00:00:00:00:00:00:00:03",
                "00:00:00:00:00:00:00:03:1"
            ],
            "cost": 5
        },
        {
            "hops": [
                "00:00:00:00:00:00:00:01:1",
                "00:00:00:00:00:00:00:01",
                "00:00:00:00:00:00:00:01:3",
                "00:00:00:00:00:00:00:02:2",
                "00:00:00:00:00:00:00:02",
                "00:00:00:00:00:00:00:02:3",
                "00:00:00:00:00:00:00:03:2",
                "00:00:00:00:00:00:00:03",
                "00:00:00:00:00:00:00:03:1"
            ],
            "cost": 8
        }
    ]
}

End-to-End Tests

e2e tests with this PR and related starlette PRs can be found here, they're passing