esgf_core_utils.models.kafka.events

Models relating to Kakfa payloads for the ESGF Core architecture.

Classes

_Payload

Base model for payloads in a Kafka message,

CreatePayload

Model describing a CREATE payload.

PatchPayload

Model describing a PARTIAL_UPDATE payload.

UpdatePayload

Model describing a UPDATE payload.

ResultPayload

Model describing a result payload.

Data

Model describing the DATA component of a Kafka message.

ResultData

Model describing the DATA component of a result Kafka message.

RequesterData

Model describing Requests Data for the Auth component of a Kafka

Auth

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

Publisher

Model describing the PUBLISHER component of a Kafka message.

Metadata

Multiple metadata attributes required for ESGF but not part of

Error

Error following RFC9457: Problem Details for HTTP APIs.

OriginalEvent

Metadata associated with the original event.

KafkaEvent

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

KafkaSuccessEvent

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

KafkaErrorEvent

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

Module Contents

class esgf_core_utils.models.kafka.events._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.events.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.events.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.transaction.request.PartialItem | list[stac_fastapi.extensions.transaction.request.PatchOperation]
item_id: str
class esgf_core_utils.models.kafka.events.UpdatePayload(/, **data: Any)

Bases: _Payload

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

method: Literal['PUT']
item: stac_pydantic.item.Item
item_id: str
class esgf_core_utils.models.kafka.events.ResultPayload(/, **data: Any)

Bases: _Payload

Model describing a result payload.

method: Literal['POST', 'PATCH', 'PUT']
item_id: str
class esgf_core_utils.models.kafka.events.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.events.ResultData(/, **data: Any)

Bases: pydantic.BaseModel

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

Note

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

type: Literal['STAC']
payload: ResultPayload
class esgf_core_utils.models.kafka.events.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.events.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 simply an indication of the institute providing the message.

auth_policy_id: str | None = None
requester_data: RequesterData
class esgf_core_utils.models.kafka.events.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.events.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: Literal['1.0.0']
class esgf_core_utils.models.kafka.events.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.events.OriginalEvent(/, **data: Any)

Bases: pydantic.BaseModel

Metadata associated with the original event.

event_id: str
offset: int
partition: int
class esgf_core_utils.models.kafka.events.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.events.KafkaSuccessEvent(/, **data: Any)

Bases: pydantic.BaseModel

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

data: ResultData
metadata: Metadata
original_event: OriginalEvent
class esgf_core_utils.models.kafka.events.KafkaErrorEvent(/, **data: Any)

Bases: KafkaSuccessEvent

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

error: Error