feature/9128_change_radio_endpoints #3

Open
john.sitarski wants to merge 2 commits from feature/9128_change_radio_endpoints into main
Collaborator

Added censored routes
Refactored the youtube streams into the main api calls with params being optional

Added censored routes Refactored the youtube streams into the main api calls with params being optional
john.sitarski added 2 commits 2023-06-29 12:47:20 +09:30
jono was assigned by john.sitarski 2023-06-29 12:47:33 +09:30
phillip.tibbits was assigned by john.sitarski 2023-06-29 12:47:33 +09:30
jono requested changes 2023-06-29 13:28:35 +09:30
jono left a comment
Owner

This covers some but not all of the ticket requirements I think. This works for a direct swap of the paths as they are, but to align with the paths used by the rest of the system some of these will need to be POST requests, the parameters will need to come from the POST params instead of path vars. Here are some links that might provide some helpful info:

https://stackoverflow.com/questions/24892035/how-can-i-get-the-named-parameters-from-a-url-using-flask
https://swagger.io/docs/specification/describing-parameters/
https://swagger.io/docs/specification/describing-request-body/

This covers some but not all of the ticket requirements I think. This works for a direct swap of the paths as they are, but to align with the paths used by the rest of the system some of these will need to be POST requests, the parameters will need to come from the POST params instead of path vars. Here are some links that might provide some helpful info: https://stackoverflow.com/questions/24892035/how-can-i-get-the-named-parameters-from-a-url-using-flask https://swagger.io/docs/specification/describing-parameters/ https://swagger.io/docs/specification/describing-request-body/
@ -53,7 +54,6 @@ def radio_report():
return jsonify(devices)
@app.route("/radio/<radio>/connect")
Owner

Don't remove this endpoint until the rest of the code handles connecting automatically to connected USB devices. We can add that feature and then remove this route in the same PR (different from this one).

Don't remove this endpoint until the rest of the code handles connecting automatically to connected USB devices. We can add that feature and then remove this route in the same PR (different from this one).
@ -0,0 +1,10 @@
endpoint_routes = {
Owner

Expand this to have default routes so that the program can function without the data being supplied. I think the correct way to do this is:

  • Give these useful paths, even if it dummy data. So route 'a' would be route_path_a instead of the empty string
  • However, if a file <filename>.[json|yml|whatever] exists in the current directory, then:
    • Load the contents of that file
    • Overwrite the paths with the specified paths

That way we can actually use the microservice outside of the SDE, but if we are inside the SDE with the actual path details (supplied with the config file) then we can interact with the rest of the system.

Expand this to have default routes so that the program can function without the data being supplied. I think the correct way to do this is: - Give these useful paths, even if it dummy data. So route 'a' would be `route_path_a` instead of the empty string - However, if a file `<filename>.[json|yml|whatever]` exists in the current directory, then: - Load the contents of that file - Overwrite the paths with the specified paths That way we can actually use the microservice outside of the SDE, but if we are inside the SDE with the actual path details (supplied with the config file) then we can interact with the rest of the system.
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/9128_change_radio_endpoints:feature/9128_change_radio_endpoints
git checkout feature/9128_change_radio_endpoints
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: jono/sdrplay-fm-radio#3
No description provided.