hook
hook
__all__ = ['GooglePubsubHook']
module-attribute
GooglePubsubHook
Bases: QueueHook
Hook for interacting with Google Pub/Sub.
__init__() -> None
Initializes the GooglePubsubHook.
publish(project: str, topic: str, data: Any) -> str
Publishes a message to a specified Pub/Sub topic.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project
|
str
|
The GCP project ID. |
required |
topic
|
str
|
The Pub/Sub topic name. |
required |
data
|
Any
|
The data to publish. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A confirmation message. |