kytos-ng / sdntrace_cp

MIT License
1 stars 6 forks source link

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

Closed viniarck closed 1 year ago

viniarck commented 1 year ago

Closes #87 Closes #83

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

PUT /api/amlight/sdntrace_cp/v1/trace
{
    "trace": {
        "switch": {
            "dpid": "{{dpid}}",
            "in_port": 1
        },
        "eth": {
            "dl_vlan": 4095
        }
    }
}

{
    "result": [
        {
            "dpid": "00:00:00:00:00:00:00:01",
            "port": 1,
            "time": "2023-04-25 10:48:15.090907",
            "type": "starting",
            "vlan": 4095
        },
        {
            "dpid": "00:00:00:00:00:00:00:03",
            "port": 3,
            "time": "2023-04-25 10:48:15.090944",
            "type": "last",
            "vlan": 2,
            "out": {
                "port": 1,
                "vlan": 4095
            }
        }
    ]
}

End-to-End Tests

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