rs_server_adgs.api package
Submodules
rs_server_adgs.api.adgs_download module
Module used to download AUX files from ADGS station.
- class rs_server_adgs.api.adgs_download.AdgsDownloadResponse(*, 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_adgs.api.adgs_download.download_products(request: Request, name: str, local: str | None = None, obs: str | None = None, db: Session = Depends(get_db))
Initiate an asynchronous download process for an ADGS product using EODAG.
This endpoint triggers the download of an ADGS 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.
- Returns:
A dictionary indicating whether the download process has started.
- Return type:
dict
- Raises:
None –
- rs_server_adgs.api.adgs_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_adgs.api.adgs_search module
Module for interacting with ADGS system through a FastAPI APIRouter.
This module provides functionality to retrieve a list of products from the ADGS stations. It includes an API endpoint, utility functions, and initialization for accessing EODataAccessGateway.
- rs_server_adgs.api.adgs_search.search_products(request: Request, datetime: str, limit: int = 1000, sortby: str = '-datetime') list[dict] | dict
Endpoint to handle the search for products in the AUX station within a specified time interval.
This function validates the input ‘interval’ format, performs a search for products using the ADGS provider, writes the search results to the database, and generates a STAC Feature Collection from the products.
Note
The ‘interval’ parameter should be in ISO 8601 format.
The function utilizes the ADGS provider for product search and EODAG for STAC Feature Collection creation.
Errors during the process will result in appropriate HTTP status codes and error messages.
- Parameters:
db (Database) – The database connection object.
- Returns:
A list of (or a single) STAC Feature Collection or an error message. If no products were found in the mentioned time range, output is an empty list.
rs_server_adgs.api.adgs_status module
HTTP endpoints to get the downloading status from ADGS stations.
- rs_server_adgs.api.adgs_status.get_download_status(request: Request, name: str, db: Session = Depends(get_db))
Get a product download status from its ID or name.
- Parameters:
db (Session) – database session
Module contents
ADGS endpoints package.