esgf_core_utils.models.kafka

Models relating to Kakfa payloads for the ESGF Core architecture.

Classes

_Payload

Base model for payloads in a Kafka message, provides the required collection_id attribute.

CreatePayload

Model describing a CREATE payload. This must be sent as a POST request.

PatchPayload

Model describing a PARTIAL_UPDATE payload. This must be sent as a PATCH request.

UpdatePayload

Model describing a UPDATE payload. This must be sent as a PUT request.

Data

Model describing the DATA component of a Kafka message. This contains the payload itself.

RequesterData

Model describing Requests Data for the Auth component of a Kafka message in more detail.

Auth

Model describing Auth component of a Kafka message in more detail.

Publisher

Model describing the PUBLISHER component of a Kafka message. This is the name and version of the software used

Metadata

Multiple metadata attributes required for ESGF but not part of the STAC payload.

Error

Error following RFC9457: Problem Details for HTTP APIs.

KafkaEvent

The full content of a Kafka message, containing both the STAC payload, the request description

KafkaErrorEvent

The full content of a Kafka error message, containing the STAC payload, the request description,

Module Contents

class esgf_core_utils.models.kafka._Payload(/, **data: Any)

Bases: pydantic.BaseModel

Base model for payloads in a Kafka message, provides the required collection_id attribute.

Warning

This model should not be used directly.

collection_id: str
class esgf_core_utils.models.kafka.CreatePayload(/, **data: Any)

Bases: _Payload

Model describing a CREATE payload. This must be sent as a POST request.

method: Literal['POST']
item: stac_pydantic.item.Item
class esgf_core_utils.models.kafka.PatchPayload(/, **data: Any)

Bases: _Payload

Model describing a PARTIAL_UPDATE payload. This must be sent as a PATCH request.

method: Literal['PATCH']
patch: stac_fastapi.extensions.core.transaction.request.PartialItem | list[stac_fastapi.extensions.core.transaction.request.PatchOperation]
item_id: str
class esgf_core_utils.models.kafka.UpdatePayload(/, **data: Any)

Bases: _Payload

Model describing a UPDATE payload. This must be sent as a PUT request.

method: Literal['PUT']
item: stac_fastapi.extensions.core.transaction.request.PartialItem
item_id: str
class esgf_core_utils.models.kafka.Data(/, **data: Any)

Bases: pydantic.BaseModel

Model describing the DATA component of a Kafka message. This contains the payload itself.

Note

Whilst the type and version attributes are available, it is not expected that these will change for a significant length of time.

type: Literal['STAC']
payload: CreatePayload | UpdatePayload | PatchPayload
class esgf_core_utils.models.kafka.RequesterData(/, **data: Any)

Bases: pydantic.BaseModel

Model describing Requests Data for the Auth component of a Kafka message in more detail.

client_id: str
iss: str
sub: str
class esgf_core_utils.models.kafka.Auth(/, **data: Any)

Bases: pydantic.BaseModel

Model describing Auth component of a Kafka message in more detail.

Note

This is not an authorisation token or other verified identity. It is the simply an indication of the institute providing the message.

auth_policy_id: str | None = None
requester_data: RequesterData
class esgf_core_utils.models.kafka.Publisher(/, **data: Any)

Bases: pydantic.BaseModel

Model describing the PUBLISHER component of a Kafka message. This is the name and version of the software used to publish the Kafka message.

package: str
version: str
class esgf_core_utils.models.kafka.Metadata(/, **data: Any)

Bases: pydantic.BaseModel

Multiple metadata attributes required for ESGF but not part of the STAC payload.

auth: Auth
event_id: str
publisher: Publisher
request_id: str
time: datetime.datetime
schema_version: str
class esgf_core_utils.models.kafka.Error(/, **data: Any)

Bases: pydantic.BaseModel

Error following RFC9457: Problem Details for HTTP APIs.

detail: str
instance: str
status: int
title: str
type: str
class esgf_core_utils.models.kafka.KafkaEvent(/, **data: Any)

Bases: pydantic.BaseModel

The full content of a Kafka message, containing both the STAC payload, the request description and the ESGF mandated metadata.

data: Data
metadata: Metadata
class esgf_core_utils.models.kafka.KafkaErrorEvent(/, **data: Any)

Bases: KafkaEvent

The full content of a Kafka error message, containing the STAC payload, the request description, ESGF mandated metadata, and error.

error: Error