rs_server_adgs/api/adgs_search.md¶
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.
MockPgstacAdgs
¶
Bases: MockPgstac
Adgs implementation of MockPgstac
Source code in docs/rs-server/services/adgs/rs_server_adgs/api/adgs_search.py
__init__(request=None, readwrite=None)
¶
Constructor
Source code in docs/rs-server/services/adgs/rs_server_adgs/api/adgs_search.py
process_search(station, odata_params, collection_provider, limit, page)
¶
Search adgs products for the given station and OData parameters.
Source code in docs/rs-server/services/adgs/rs_server_adgs/api/adgs_search.py
auth_validation(request, collection_id, access_type)
¶
Check if the user KeyCloak roles contain the right for this specific AUXIP collection and access type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
Request
|
The incoming HTTP request used for authentication checks. |
required |
collection_id
|
str
|
Used to find the AUXIP station ("ADGS1, ADGS2") from the RSPY_ADGS_SEARCH_CONFIG config yaml file. |
required |
access_type
|
str
|
The type of access, such as "download" or "read". |
required |
Source code in docs/rs-server/services/adgs/rs_server_adgs/api/adgs_search.py
get_adgs_collection(request, collection_id)
async
¶
Return a specific ADGS collection.
Source code in docs/rs-server/services/adgs/rs_server_adgs/api/adgs_search.py
get_adgs_collection_items(request, collection_id, bbox=None, datetime=None, filter_=None, filter_lang='cql2-text', sortby=None, limit=None, page=None)
async
¶
Retrieve a list of items from a specified AUXIP collection.
This endpoint returns a collection of items associated with the given AUXIP collection ID. It utilizes the collection ID to validate access and fetches the items based on defined query parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
Request
|
The incoming HTTP request used for authentication and routing. |
required |
collection_id
|
str
|
AUXIP collection ID. Must be a valid collection identifier (e.g., 'ins_s1'). |
required |
bbox
|
BBoxType
|
Bounding box spatial filter, as [west, south, east, north] coordinates. |
None
|
datetime
|
DateTimeType
|
Temporal filter as an RFC 3339 timestamp or interval. |
None
|
filter_
|
FilterType
|
CQL2 filter expression to further restrict results. |
None
|
filter_lang
|
FilterLangType
|
Language for the CQL2 filter, either "cql2-text" or "cql2-json". |
'cql2-text'
|
sortby
|
SortByType
|
Field and direction to sort results by. |
None
|
limit
|
LimitType
|
Maximum number of items to return per page. |
None
|
page
|
PageType
|
1-based page index for pagination. |
None
|
Returns:
| Type | Description |
|---|---|
list[dict] | dict
|
list[dict]: A FeatureCollection of items belonging to the specified collection, or an error message if the collection is not found. |
Raises:
| Type | Description |
|---|---|
HTTPException
|
If the authentication fails, or if there are issues with the collection ID provided. |
Source code in docs/rs-server/services/adgs/rs_server_adgs/api/adgs_search.py
get_adgs_collection_specific_item(request, collection_id, item_id)
async
¶
Retrieve a specific item from a specified AUXIP collection.
This endpoint fetches details of a specific item within the given AUXIP collection by its unique item ID. It utilizes the provided collection ID and item ID to validate access and return item information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
Request
|
The incoming HTTP request used for authentication and routing. |
required |
collection_id
|
str
|
AUXIP collection ID. Must be a valid collection identifier (e.g., 'ins_s1'). |
required |
item_id
|
str
|
AUXIP item ID. Must be a valid item identifier (e.g., 'S1A_OPER_MPL_ORBPRE_20210214T021411_20210221T021411_0001.EOF'). |
required |
- dict: A JSON object containing details of the specified item, or an error message if the item is not found.
- HTTPException: If the authentication fails, or if the specified item is not found in the collection.
Example: A successful response will return:
{
"id": "S1A_OPER_MPL_ORBPRE_20210214T021411_20210221T021411_0001.EOF",
"type": "Feature",
"properties": {
... # Detailed properties of the item
},
"geometry": {
... # Geometry details of the item
},
"links": [
... # Links associated with the item
]
}
Source code in docs/rs-server/services/adgs/rs_server_adgs/api/adgs_search.py
get_allowed_adgs_collections(request)
async
¶
Return the ADGS collections to which the user has access to.
Source code in docs/rs-server/services/adgs/rs_server_adgs/api/adgs_search.py
get_conformance(request)
async
¶
Return the STAC/OGC conformance classes implemented by this server.
Source code in docs/rs-server/services/adgs/rs_server_adgs/api/adgs_search.py
get_root_catalog(request)
async
¶
Retrieve the RSPY ADGS Search catalog landing page.
This endpoint generates a STAC (SpatioTemporal Asset Catalog) Catalog object that serves as the landing page for the RSPY ADGS service. The catalog includes basic metadata about the service and links to available collections.
The resulting catalog contains:
- id: A unique identifier for the catalog, generated as a UUID.
- description: A brief description of the catalog.
- title: The title of the catalog.
- stac_version: The version of the STAC specification to which the catalog conforms.
- conformsTo: A list of STAC and OGC API specifications that the catalog conforms to.
- links: A link to the /adgs/collections endpoint where users can find available collections.
The stac_version is set to "1.1.0", and the conformsTo field lists the relevant STAC and OGC API
specifications that the catalog adheres to. A link to the collections endpoint is added to the catalog's
links field, allowing users to discover available collections in the ADGS service.
Parameters: - request: The HTTP request object which includes details about the incoming request.
Returns: - dict: A dictionary representation of the STAC catalog, including metadata and links.
Source code in docs/rs-server/services/adgs/rs_server_adgs/api/adgs_search.py
home_endpoint()
async
¶
process_product_search(station, queryables, collection_provider, limit, sortby, page=1, **kwargs)
¶
Performs a search for products using the ADGS provider and generates a STAC Feature Collection from the products.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
station
|
str
|
Auxip station identifier. |
required |
queryables
|
dict
|
Query parameters for filtering results. |
required |
collection_provider
|
Callable[[dict], str | None]
|
Function that determines STAC collection for a given OData entity |
required |
limit
|
int
|
Maximum number of products to return. |
required |
sortby
|
str
|
Sorting field with +/- prefix for ascending/descending order. |
required |
page
|
int
|
Page number for pagination. Defaults to 1. |
1
|
**kwargs
|
Additional search parameters. |
{}
|
Returns:
| Type | Description |
|---|---|
ItemCollection
|
stac_pydantic.ItemCollection: A STAC-compliant Feature Collection containing the search results. |
Raises:
| Type | Description |
|---|---|
HTTPException
|
If the pagination limit is less than 1. |
HTTPException
|
If an invalid station identifier is provided ( |
HTTPException
|
If there is a connection error with the station ( |
HTTPException
|
If there is a general failure during the process. |
Exception
|
Re-raised directly if the caught exception is already an HTTPException; all other exceptions are wrapped in a new HTTPException(503). |
Source code in docs/rs-server/services/adgs/rs_server_adgs/api/adgs_search.py
validate(queryables)
¶
Function used to verify / update ADGS-specific queryables before being sent to eodag.