rs_server_cadip.api package
Submodules
rs_server_cadip.api.cadip_download module
Module used to download CADU files from CADIP stations.
- class rs_server_cadip.api.cadip_download.CadipDownloadResponse(*, started: bool)
Bases:
BaseModel
Endpoint response
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'started': FieldInfo(annotation=bool, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- started: bool
- rs_server_cadip.api.cadip_download.download_products(request: Request, name: str, station: str = Path(PydanticUndefined), local: str | None = None, obs: str | None = None, db: Session = Depends(get_db))
Initiate an asynchronous download process for a CADU product using EODAG.
This endpoint triggers the download of a CADU product identified by the given name of the file. It starts the download process in a separate thread using the start_eodag_download function and updates the product’s status in the database.
- Parameters:
db (Database) – The database connection object.
- rs_server_cadip.api.cadip_download.start_eodag_download(argument: EoDAGDownloadHandler)
Start the eodag download process.
This function initiates the eodag download process using the provided arguments. It sets up the temporary directory where the files are to be downloaded and gets the database handler
- Parameters:
argument (EoDAGDownloadHandler) – An instance of EoDAGDownloadHandler containing the arguments used in the downloading process
- Returns:
None
rs_server_cadip.api.cadip_search module
Module for interacting with CADU system through a FastAPI APIRouter.
This module provides functionality to retrieve a list of products from the CADU system for a specified station. It includes an API endpoint, utility functions, and initialization for accessing EODataAccessGateway.
- rs_server_cadip.api.cadip_search.search_products(request: Request, datetime: str, station: str = Path(PydanticUndefined), limit: int = 1000, sortby: str = '-datetime') list[dict] | dict
Endpoint to retrieve a list of products from the CADU system for a specified station.
Notes
The ‘interval’ parameter should be in ISO 8601 format.
The response includes a JSON representation of the list of products for the specified station.
In case of an invalid station identifier, a 400 Bad Request response is returned.
- Parameters:
db (Database) – The database connection object.
- Returns:
A list of (or a single) STAC Feature Collection or an error message. If the station identifier is invalid, a 400 Bad Request response is returned. If no products were found in the mentioned time range, output is an empty list.
- rs_server_cadip.api.cadip_search.search_session(request: Request, station: str = Path(PydanticUndefined), id: str | None = None, platform: str | None = None, start_date: str | None = None, stop_date: str | None = None)
Endpoint to retrieve list of sessions from any CADIP station.
A valid session search request must contain at least a value for either id or platform or time interval (start_date and stop_date correctly defined).
rs_server_cadip.api.cadip_status module
HTTP endpoints to get the downloading status from CADIP stations.
- rs_server_cadip.api.cadip_status.get_download_status(request: Request, name: str, db: Session = Depends(get_db), station: str = Path(PydanticUndefined))
Get a product download status from its ID or name.
- Parameters:
db (Session) – database session
Module contents
HTTP endpoints.