rest_api package
rest module
Flask application.
Provides a simple api for interacting with the user’s database. This api lets the user search in the database within the range they insert.
- rfserver.rest_api.rest.search(min_power, max_power, min_frequency, max_frequency) list[tuple[int, float, float, str]]
Search API endpoint.
Search the database within a specific range. It creates an api route that uses the search_power_frequency() method from the DetailDataBaseManager class. This route can then be used by the user to provide the variables and get the result.
- Parameters:
min_power (float) – The minimum power in the range.
max_power (float) – The maximum power in the range.
min_frequency (float) – The minimum frequency in the range.
max_frequency (float) – The maximum frequency in the range.
- Returns:
- A list of tuples, were each tuple contains:
int: Record ID.
float: Power value.
float: Frequency value.
str: Timestamp of the reading.
- Return type:
list
Example
- Request:
GET /search/20.12/20.54/103.7/105.1
- Response:
- [
(90, 103.7, 20.54, ‘06-06-2025 12:16:18’), (91, 104.3, 20.18, ‘06-06-2025 12:16:18’)
]