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: object

REST API client to non-GraphQL requests that help with the function of managers and coordinators.

Parameters:
  • base_url (str) – Base URL of the REST API. Derived from GPPClient base_url.

  • gpp_token (str) – GPP token to authenticate against the REST API. Same as GPPClient.

  • timeout (float) – Timeout for REST API requests in seconds.

async close() None[source]

Close the session if it exists and is not already closed.

async get_session() ClientSession[source]

Get or create an aiohttp.ClientSession for making REST API requests.

Returns:

The aiohttp ClientSession instance.

Return type:

aiohttp.ClientSession