rs_server_common package
Subpackages
- rs_server_common.data_retrieval package
- rs_server_common.db package
- Subpackages
- Submodules
- rs_server_common.db.database module
DatabaseSessionManager
DatabaseSessionManager.close()
DatabaseSessionManager.connect()
DatabaseSessionManager.create_all()
DatabaseSessionManager.drop_all()
DatabaseSessionManager.lock
DatabaseSessionManager.multiprocessing_lock
DatabaseSessionManager.open_session()
DatabaseSessionManager.reraise_http_exception()
DatabaseSessionManager.session()
DatabaseSessionManager.url()
get_db()
- Module contents
- rs_server_common.s3_storage_handler package
- Submodules
- rs_server_common.s3_storage_handler.s3_storage_handler module
GetKeysFromS3Config
GetKeysFromS3Config.s3_files
GetKeysFromS3Config.bucket
GetKeysFromS3Config.local_prefix
GetKeysFromS3Config.overwrite
GetKeysFromS3Config.max_retries
GetKeysFromS3Config.bucket
GetKeysFromS3Config.local_prefix
GetKeysFromS3Config.max_retries
GetKeysFromS3Config.overwrite
GetKeysFromS3Config.s3_files
PutFilesToS3Config
S3StorageHandler
S3StorageHandler.access_key_id
S3StorageHandler.secret_access_key
S3StorageHandler.endpoint_url
S3StorageHandler.region_name
S3StorageHandler.s3_client
S3StorageHandler.check_bucket_access()
S3StorageHandler.check_file_overwriting()
S3StorageHandler.connect_s3()
S3StorageHandler.delete_file_from_s3()
S3StorageHandler.disconnect_s3()
S3StorageHandler.files_to_be_downloaded()
S3StorageHandler.files_to_be_uploaded()
S3StorageHandler.get_basename()
S3StorageHandler.get_keys_from_s3()
S3StorageHandler.get_secrets_from_file()
S3StorageHandler.list_s3_files_obj()
S3StorageHandler.put_files_to_s3()
S3StorageHandler.s3_path_parser()
S3StorageHandler.transfer_from_s3_to_s3()
S3StorageHandler.wait_timeout()
TransferFromS3ToS3Config
TransferFromS3ToS3Config.s3_files
TransferFromS3ToS3Config.bucket_src
TransferFromS3ToS3Config.bucket_dst
TransferFromS3ToS3Config.max_retries
TransferFromS3ToS3Config.bucket_dst
TransferFromS3ToS3Config.bucket_src
TransferFromS3ToS3Config.copy_only
TransferFromS3ToS3Config.max_retries
TransferFromS3ToS3Config.s3_files
- Module contents
- rs_server_common.schemas package
- rs_server_common.utils package
- Submodules
- rs_server_common.utils.logging module
- rs_server_common.utils.opentelemetry module
- rs_server_common.utils.utils module
EoDAGDownloadHandler
EoDAGDownloadHandler.db_handler
EoDAGDownloadHandler.thread_started
EoDAGDownloadHandler.station
EoDAGDownloadHandler.product_id
EoDAGDownloadHandler.name
EoDAGDownloadHandler.local
EoDAGDownloadHandler.obs
EoDAGDownloadHandler.db_handler
EoDAGDownloadHandler.local
EoDAGDownloadHandler.name
EoDAGDownloadHandler.obs
EoDAGDownloadHandler.product_id
EoDAGDownloadHandler.station
EoDAGDownloadHandler.thread_started
create_stac_collection()
eodag_download()
extract_eo_product()
is_valid_date_format()
odata_to_stac()
sort_feature_collection()
update_db()
validate_inputs_format()
write_search_products_to_db()
- Module contents
Submodules
rs_server_common.authentication module
Authentication functions implementation.
Note: calls https://gitlab.si.c-s.fr/space_applications/eoservices/apikey-manager
- async rs_server_common.authentication.apikey_security(request: Request, apikey_header: str) tuple[list, dict, str]
FastAPI Security dependency for the cluster mode. Check the api key validity, passed as an HTTP header.
- Parameters:
apikey_header (Security) – API key passed in HTTP header
- Returns:
Tuple of (IAM roles, config) information from the keycloak server, associated with the api key.
- rs_server_common.authentication.apikey_validator(station, access_type)
Decorator to validate API key access.
- Parameters:
station (str) – The station name = adgs or cadip
access_type (str) – The type of access.
- Raises:
HTTPException – If the authorization key does not include the right role to access the specified station.
- Returns:
Decorator function.
- Return type:
function
rs_server_common.fastapi_app module
Init the FastAPI application.
- async rs_server_common.fastapi_app.health() HealthSchema
Always return a flag set to ‘true’ when the service is up and running.
Otherwise this code won’t be run anyway and the caller will have other sorts of errors.
- async rs_server_common.fastapi_app.home()
Home endpoint.
- rs_server_common.fastapi_app.init_app(api_version: str, routers: list[APIRouter], init_db: bool = True, pause: int = 3, timeout: int = None, startup_events: list[Callable] = None, shutdown_events: list[Callable] = None)
Init the FastAPI application. See: https://praciano.com.br/fastapi-and-async-sqlalchemy-20-with-pytest-done-right.html
- Parameters:
api_version (str) – version of our application (not the version of the OpenAPI specification
used) (nor the version of FastAPI being)
routers (list[APIRouter]) – list of FastAPI routers to add to the application.
init_db (bool) – should we init the database session ?
timeout (int) – timeout in seconds to wait for the database connection.
pause (int) – pause in seconds to wait for the database connection.
startup_events (list[Callable]) – list of functions that should be run before the application starts
shutdown_events (list[Callable]) – list of functions that should be run when the application is shutting down
rs_server_common.settings module
Store diverse objects and values used throughout the application.
- async rs_server_common.settings.del_http_client()
Close and delete HTTP client.
- rs_server_common.settings.env_bool(var: str, default: bool) bool
Return True if an environemnt variable is set to 1, true or yes (case insensitive). Return False if set to 0, false or no (case insensitive). Return the default value if not set or set to a different value.
- rs_server_common.settings.http_client()
Get HTTP client
- rs_server_common.settings.set_http_client(value)
Set HTTP client
Module contents
Main package of commons of rs-server services.