Python File Input
EXPERIMENTAL¶
Overview¶
This simple node can be used to catch data exposed throught a REST API end point. The resulting output of this node is a list of dictionnary where each element is a json document.
Runtime Compatibility¶
- PySpark : ✅
- Spark : ❌
Example¶
Here is a simple example:
---
type: punchline
version: '6.0'
runtime: pyspark
tenant: mytenant
dag:
- type: api_request_input
component: api_request_input
settings:
protocol: http
host: localhost
port: 9200
payload: "/"
publish:
- component: input
stream: data
- type: python_show
component: python_show
settings: {}
subscribe:
- component: api_request_input
stream: data
You can run this punchline using the following command
punchlinectl start -p punchline.yaml
Parameters¶
The following parameters can be used in the following curl command.
curl -XGET <protocol>://<host>:<port>/<payload>
Name | Type | mandatory | Default value | Description |
---|---|---|---|---|
protocol | String | true | http | HTTP protocol. |
host | String | true | localhost | Hostname where the end point REST API is deployed |
port | Integer | true | 9200 | REST API port |
payload | String | true | / | Uniform Resource Identifier of your request |