esgf_core_utils.models.kafka ============================ .. py:module:: esgf_core_utils.models.kafka .. autoapi-nested-parse:: Models relating to Kakfa payloads for the ESGF Core architecture. Classes ------- .. autoapisummary:: esgf_core_utils.models.kafka._Payload esgf_core_utils.models.kafka.CreatePayload esgf_core_utils.models.kafka.PatchPayload esgf_core_utils.models.kafka.UpdatePayload esgf_core_utils.models.kafka.Data esgf_core_utils.models.kafka.RequesterData esgf_core_utils.models.kafka.Auth esgf_core_utils.models.kafka.Publisher esgf_core_utils.models.kafka.Metadata esgf_core_utils.models.kafka.Error esgf_core_utils.models.kafka.KafkaEvent esgf_core_utils.models.kafka.KafkaErrorEvent Module Contents --------------- .. py:class:: _Payload(/, **data: Any) Bases: :py:obj:`pydantic.BaseModel` Base model for payloads in a Kafka message, provides the required ``collection_id`` attribute. .. warning:: This model should not be used directly. .. py:attribute:: collection_id :type: str .. py:class:: CreatePayload(/, **data: Any) Bases: :py:obj:`_Payload` Model describing a ``CREATE`` payload. This must be sent as a ``POST`` request. .. py:attribute:: method :type: Literal['POST'] .. py:attribute:: item :type: stac_pydantic.item.Item .. py:class:: PatchPayload(/, **data: Any) Bases: :py:obj:`_Payload` Model describing a ``PARTIAL_UPDATE`` payload. This must be sent as a ``PATCH`` request. .. py:attribute:: method :type: Literal['PATCH'] .. py:attribute:: patch :type: stac_fastapi.extensions.core.transaction.request.PartialItem | list[stac_fastapi.extensions.core.transaction.request.PatchOperation] .. py:attribute:: item_id :type: str .. py:class:: UpdatePayload(/, **data: Any) Bases: :py:obj:`_Payload` Model describing a ``UPDATE`` payload. This must be sent as a ``PUT`` request. .. py:attribute:: method :type: Literal['PUT'] .. py:attribute:: item :type: stac_fastapi.extensions.core.transaction.request.PartialItem .. py:attribute:: item_id :type: str .. py:class:: Data(/, **data: Any) Bases: :py:obj:`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. .. py:attribute:: type :type: Literal['STAC'] .. py:attribute:: payload :type: Union[CreatePayload, UpdatePayload, PatchPayload] .. py:class:: RequesterData(/, **data: Any) Bases: :py:obj:`pydantic.BaseModel` Model describing ``Requests Data`` for the ``Auth`` component of a Kafka message in more detail. .. py:attribute:: client_id :type: str .. py:attribute:: iss :type: str .. py:attribute:: sub :type: str .. py:class:: Auth(/, **data: Any) Bases: :py:obj:`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. .. py:attribute:: auth_policy_id :type: Optional[str] :value: None .. py:attribute:: requester_data :type: RequesterData .. py:class:: Publisher(/, **data: Any) Bases: :py:obj:`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. .. py:attribute:: package :type: str .. py:attribute:: version :type: str .. py:class:: Metadata(/, **data: Any) Bases: :py:obj:`pydantic.BaseModel` Multiple metadata attributes required for ESGF but not part of the STAC payload. .. py:attribute:: auth :type: Auth .. py:attribute:: event_id :type: str .. py:attribute:: publisher :type: Publisher .. py:attribute:: request_id :type: str .. py:attribute:: time :type: datetime.datetime .. py:attribute:: schema_version :type: str .. py:class:: Error(/, **data: Any) Bases: :py:obj:`pydantic.BaseModel` Error following `RFC9457: Problem Details for HTTP APIs`. .. py:attribute:: detail :type: str .. py:attribute:: instance :type: str .. py:attribute:: status :type: int .. py:attribute:: title :type: str .. py:attribute:: type :type: str .. py:class:: KafkaEvent(/, **data: Any) Bases: :py:obj:`pydantic.BaseModel` The full content of a Kafka message, containing both the STAC payload, the request description and the ESGF mandated metadata. .. py:attribute:: data :type: Data .. py:attribute:: metadata :type: Metadata .. py:class:: KafkaErrorEvent(/, **data: Any) Bases: :py:obj:`KafkaEvent` The full content of a Kafka error message, containing the STAC payload, the request description, ESGF mandated metadata, and error. .. py:attribute:: error :type: Error