ADGS
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.
search_products(request, datetime, limit=1000, sortby='-created')
Endpoint to handle the search for products in the AUX station within a specified time interval.
This function validates the input 'datetime' 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.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request |
Request
|
The request object (unused). |
required |
datetime |
str
|
Time interval in ISO 8601 format. |
required |
limit |
int
|
Maximum number of products to return. Defaults to 1000. |
1000
|
sortby |
str
|
Sort by +/-fieldName (ascending/descending). Defaults to "-datetime". |
'-created'
|
Returns:
Type | Description |
---|---|
list[dict] | dict
|
list[dict] | dict: A list of STAC Feature Collections or an error message. If no products are found in the specified time range, returns an empty list. |
Raises:
Type | Description |
---|---|
HTTPException(exceptions)
|
If the pagination limit is less than 1. |
HTTPException(exceptions)
|
If there is a bad station identifier (CreateProviderFailed). |
HTTPException(exceptions)
|
If there is a database connection error (sqlalchemy.exc.OperationalError). |
HTTPException(exceptions)
|
If there is a connection error to the station. |
HTTPException(exceptions)
|
If there is a general failure during the process. |
Source code in docs/rs-server/services/adgs/rs_server_adgs/api/adgs_search.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|
Module used to download AUX files from ADGS station.
AdgsDownloadResponse
Bases: BaseModel
Endpoint response
Source code in docs/rs-server/services/adgs/rs_server_adgs/api/adgs_download.py
69 70 71 72 |
|
download_products(request, name, local=None, obs=None, db=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:
Name | Type | Description | Default |
---|---|---|---|
request |
Request
|
The request object (unused). |
required |
name |
str
|
AUX product name. |
required |
local |
str
|
Local download directory. |
None
|
obs |
str
|
Object storage path (e.g., "s3://bucket-name/sub/dir"). |
None
|
db |
Session
|
The database connection object. |
Depends(get_db)
|
Returns:
Name | Type | Description |
---|---|---|
JSONResponse |
responses
|
A JSON response indicating whether the download process has started. |
Source code in docs/rs-server/services/adgs/rs_server_adgs/api/adgs_download.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
start_eodag_download(argument)
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:
Name | Type | Description | Default |
---|---|---|---|
argument |
EoDAGDownloadHandler
|
An instance of EoDAGDownloadHandler containing the arguments used in the |
required |
downloading process
Source code in docs/rs-server/services/adgs/rs_server_adgs/api/adgs_download.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
HTTP endpoints to get the downloading status from ADGS stations.
get_download_status(request, name, db=Depends(get_db))
Get a product download status from its ID or name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request |
Request
|
The request object (unused). |
required |
name |
str
|
The name of the AUX product. |
required |
db |
Session
|
The database connection object. |
Depends(get_db)
|
Returns:
Name | Type | Description |
---|---|---|
ReadDownloadStatus |
DownloadStatus
|
The download status of the specified AUX product. |
Raises:
Type | Description |
---|---|
HTTPException
|
If the product is not found in the database. |
Source code in docs/rs-server/services/adgs/rs_server_adgs/api/adgs_status.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|