Skip to content

Webhook

Spout for Webhook

Bases: Spout

__init__(output, state, **kwargs)

Initialize the Webhook class.

Parameters:

Name Type Description Default
output StreamingOutput

An instance of the StreamingOutput class for saving the data.

required
state State

An instance of the State class for maintaining the state.

required
**kwargs

Additional keyword arguments.

{}

Using geniusrise to invoke via command line

genius Webhook rise \
    streaming \
        --output_kafka_topic webhook_test \
        --output_kafka_cluster_connection_string localhost:9094 \
    none \
    listen \
        --args endpoint=* port=3000

Using geniusrise to invoke via YAML file

version: "1"
spouts:
    my_webhook_spout:
        name: "Webhook"
        method: "listen"
        args:
            endpoint: "*"
            port: 3000
        output:
            type: "streaming"
            args:
                output_topic: "webhook_test"
                kafka_servers: "localhost:9094"

listen(endpoint='*', port=3000, username=None, password=None)

📖 Start listening for data from the webhook.

Parameters:

Name Type Description Default
endpoint str

The webhook endpoint to listen to. Defaults to "*".

'*'
port int

The port to listen on. Defaults to 3000.

3000
username Optional[str]

The username for basic authentication. Defaults to None.

None
password Optional[str]

The password for basic authentication. Defaults to None.

None

Raises:

Type Description
Exception

If unable to start the CherryPy server.