kytos-ng / sdntrace_cp

MIT License
1 stars 6 forks source link

feature: Add v1 routes #93

Closed gretelliz closed 1 year ago

gretelliz commented 1 year ago

Closes #64

Summary

Add v1 on /trace and /traces.

Local Tests

I made sure that GET /traces and GET /trace work well:

curl -H 'Content-type: application/json' -X PUT http://127.0.0.1:8181/api/amlight/sdntrace_cp/v1/trace -d '{"trace": {"switch": {"dpid": "00:00:00:00:00:00:00:01","in_port": 1}}}'
{"result":[{"dpid":"00:00:00:00:00:00:00:01","port":1,"time":"2023-04-11 19:16:42.264349","type":"starting"},{"dpid":"00:00:00:00:00:00:00:02","out":null,"port":2,"time":"2023-04-11 19:16:42.264406","type":"incomplete"}]}
curl -H 'Content-type: application/json' -X PUT http://127.0.0.1:8181/api/amlight/sdntrace_cp/v1/traces -d '[{"trace": {"switch": {"dpid": "00:00:00:00:00:00:00:01","in_port": 1}}}]'
{"result":[[{"dpid":"00:00:00:00:00:00:00:01","port":1,"time":"2023-04-11 19:17:02.650791","type":"starting"},{"dpid":"00:00:00:00:00:00:00:02","out":null,"port":2,"time":"2023-04-11 19:17:02.650848","type":"incomplete"}]]}

End-to-End Tests

Refactoring ...

gretelliz commented 1 year ago

@viniarck, Thank you.