thoth.messaging package

Submodules

thoth.messaging.admin_client module

Helper functions for using confluent kafka admin client with thoth.messaging.

thoth.messaging.admin_client.check_connection(timeout: int = 10, config: Optional[Dict[str, str]] = None)[source]

Check connection to Kafka with either provided config or config gathered from env.

thoth.messaging.admin_client.create_admin_client(config: Optional[Dict[str, str]] = None) → confluent_kafka.admin.AdminClient[source]

Create admin client.

thoth.messaging.admin_client.create_all_topics(admin: confluent_kafka.admin.AdminClient, partitions: int = 1, replication_factor: int = 1)[source]

Create admin client for all topics in thoth messaging with equal replication and partitions.

thoth.messaging.admin_client.create_topic(admin: confluent_kafka.admin.AdminClient, message: thoth.messaging.message_base.MessageBase, partitions: int = 1, replication_factor: int = 1)[source]

Create single topic.

thoth.messaging.advise_justification module

This is Thoth Messaging module for AdviseJustificationMessage.

class thoth.messaging.advise_justification.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent contents of advise justification message Kafka topic.

thoth.messaging.adviser_trigger module

This is Thoth Messaging module for AdviseTriggerMessage.

class thoth.messaging.adviser_trigger.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent contents of a message Kafka topic.

class Config[source]

Bases: object

Config for pydantic.

arbitrary_types_allowed = True

thoth.messaging.build_analysis_trigger module

This is Thoth Messaging module for BuildAnalysisTriggerMessage.

class thoth.messaging.build_analysis_trigger.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent contents of a message Kafka topic.

thoth.messaging.config module

Helper functions for generating confluent kafka configuration.

thoth.messaging.config.kafka_config_from_env()[source]

Generate Kafka configuration from environment variables.

thoth.messaging.config.topic_config_from_env()[source]

Generate topic config from environment variables.

thoth.messaging.consumer module

Helper functions for using confluent kafka consumer with thoth.messaging.

thoth.messaging.consumer.create_consumer(config: Optional[Dict[str, str]] = None) → cimpl.Consumer[source]

Initialize consumer.

thoth.messaging.consumer.subscribe_to_all(consumer: cimpl.Consumer)[source]

Subscribe to all topics defined in messaging.

thoth.messaging.consumer.subscribe_to_message(consumer: cimpl.Consumer, message_type: thoth.messaging.message_base.MessageBase)[source]

Subscribe to specific message by passing message class.

thoth.messaging.cve_provided module

This is Thoth Messaging module for CVEProvidedMessage.

class thoth.messaging.cve_provided.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent contents of a cve-provided message Kafka topic.

thoth.messaging.hash_mismatch module

This is Thoth Messaging module for HashMismatchMessage.

class thoth.messaging.hash_mismatch.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent a contents of a hash-mismatch message Kafka topic.

thoth.messaging.inspection_complete module

This is Thoth Messaging module for InspectionCompleteMessage.

class thoth.messaging.inspection_complete.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent contents of a inspection-completed message Kafka topic.

thoth.messaging.kebechet_run_url module

This is Thoth Messaging module for KebechetRunUrlTriggerMessage.

class thoth.messaging.kebechet_run_url.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent contents of a message Kafka topic.

class thoth.messaging.kebechet_run_url.Metadata[source]

Bases: pydantic.main.BaseModel

Metadata for kebechet-run-url message type.

thoth.messaging.kebechet_trigger module

This is Thoth Messaging module for KebechetTriggerMessage.

class thoth.messaging.kebechet_trigger.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent contents of a message Kafka topic.

class Config[source]

Bases: object

Config for pydantic.

arbitrary_types_allowed = True

thoth.messaging.message_base module

This is Thoth Messaging module.

class thoth.messaging.message_base.BaseMessageContents[source]

Bases: pydantic.main.BaseModel

Default params for message contents.

class thoth.messaging.message_base.MessageBase(*, base_name: Optional[str] = None, model: Optional[Type[thoth.messaging.message_base.BaseMessageContents]] = None)[source]

Bases: object

Class used for Package Release events on Kafka topic.

property topic_name

Generate topic name.

thoth.messaging.message_factory module

This is Thoth Messaging module for message_factory.

thoth.messaging.message_factory.message_factory(b_name: str, message_model: Type[thoth.messaging.message_base.BaseMessageContents])[source]

Create new message types dynamically.

thoth.messaging.missing_package module

This is Thoth Messaging module for MissingPackageMessage.

class thoth.messaging.missing_package.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent a contents of a missing-package message Kafka topic.

thoth.messaging.missing_version module

This is Thoth Messaging module for MissingVersionMessage.

class thoth.messaging.missing_version.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent a contents of a missing-package version message Kafka topic.

thoth.messaging.package_extract_trigger module

This is Thoth Messaging module for PackageExtractTriggerMessage.

class thoth.messaging.package_extract_trigger.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent contents of a message Kafka topic.

thoth.messaging.package_releases module

This is Thoth Messaging module for PackageReleasedMessage.

class thoth.messaging.package_releases.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent contents of a package-released message Kafka topic.

thoth.messaging.producer module

Helper functions for using confluent kafka producer with thoth.messaging.

thoth.messaging.producer.create_producer(config: Optional[Dict[str, Any]] = None) → cimpl.Producer[source]

Create confluent kafka producer.

thoth.messaging.producer.publish_to_topic(producer: cimpl.Producer, message_type: thoth.messaging.message_base.MessageBase, message_contents: Union[thoth.messaging.message_base.BaseMessageContents, Dict[str, Any]], validate: bool = True)[source]

Publish to topic using message contents class.

producerProducer

Instance of confluent Kafka producer which handles sending the message to Kafka instance

message_typeMessageBase

Message type which determines the schema of the message as well as the topic name to produce to

message_contentsUnion[BaseMessageContents, Dict[str, Any]]

Message to be sent. A dict is parsed on messaging side to message_type.model.

None

ValidationError

When pydantic detects ill formed message

thoth.messaging.provenance_checker_trigger module

This is Thoth Messaging module for ProvenanceCheckerTriggerMessage.

class thoth.messaging.provenance_checker_trigger.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent contents of a message Kafka topic.

class Config[source]

Bases: object

Config for pydantic.

arbitrary_types_allowed = True

thoth.messaging.si_unanalyzed_package module

This is Thoth Messaging module for SIUnanalyzedPackageMessage.

class thoth.messaging.si_unanalyzed_package.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent contents of a SI unanalyzed package message Kafka topic.

thoth.messaging.solved_package module

This is Thoth Messaging module for SolvedPackageMessage.

class thoth.messaging.solved_package.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent contents of a solved package message Kafka topic.

thoth.messaging.unresolved_package module

This is Thoth Messaging module for UnresolvedPackageMessage.

class thoth.messaging.unresolved_package.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent contents of a unresolved package message Kafka topic.

thoth.messaging.unrevsolved_package module

This is Thoth Messaging module for UnrevsolvedPackageMessage.

class thoth.messaging.unrevsolved_package.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent contents of a unrevsolved package message Kafka topic.

thoth.messaging.update_provides_src_distro module

This is Thoth Messaging module for UpdateProvidesSourceDistroMessage.

class thoth.messaging.update_provides_src_distro.MessageContents[source]

Bases: thoth.messaging.message_base.BaseMessageContents

Class used to represent a contents of a update-provides-source-distro message.

Module contents

This is Thoth Messaging module.

class thoth.messaging.MessageBase(*, base_name: Optional[str] = None, model: Optional[Type[thoth.messaging.message_base.BaseMessageContents]] = None)[source]

Bases: object

Class used for Package Release events on Kafka topic.

property topic_name

Generate topic name.

thoth.messaging.message_factory(b_name: str, message_model: Type[thoth.messaging.message_base.BaseMessageContents])[source]

Create new message types dynamically.

class thoth.messaging.BaseMessageContents[source]

Bases: pydantic.main.BaseModel

Default params for message contents.