REST Client¶
The REST client provides low-level access to non-GraphQL endpoints used by the GPP client.
It manages authenticated HTTP sessions and provides the underlying transport layer for REST-based operations.
Warning
This is considered advanced functionality and is rarely needed directly.
Most users should prefer using the domain interfaces exposed through
GPPClient.
API Reference¶
- class gpp_client.rest.RESTClient(base_url: str, gpp_token: str, timeout: float = 30.0)[source]¶
Bases:
objectREST API client to non-GraphQL requests that help with the function of managers and coordinators.
- Parameters:
- async get_atom_digests(observation_ids: list[str], accept_gzip: bool = True) str[source]¶
Request atom digests for the given observation IDs.
- Parameters:
- Returns:
TSV data as string, one row per line.
- Return type:
- Raises:
aiohttp.ClientResponseError – For HTTP error responses.
aiohttp.ClientError – For connection or timeout failures.
- async get_session() ClientSession[source]¶
Get or create an
aiohttp.ClientSessionfor making REST API requests.- Returns:
The aiohttp ClientSession instance.
- Return type:
aiohttp.ClientSession
- async get_visibility_changes(since: datetime) str[source]¶
Request observations and targets with visibility changes since a time.
- Parameters:
since (datetime) – Return entities whose visibility-relevant inputs changed at or after this time. Naive datetimes are assumed to be UTC.
- Returns:
TSV data as string, one
<gid>\t<iso8601-timestamp>per line.- Return type:
- Raises:
aiohttp.ClientResponseError – For HTTP error responses.
aiohttp.ClientError – For connection or timeout failures.