-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy path301-http-pipeline.py
27 lines (24 loc) · 1002 Bytes
/
301-http-pipeline.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from argo_dataflow import pipeline, cron, http
if __name__ == '__main__':
(pipeline("301-http")
.owner('argoproj-labs')
.describe("""This example uses a HTTP sources and sinks.
HTTP has the advantage that it is stateless and therefore cheap. You not need to set-up any storage for your
messages between steps.
* A HTTP sink may return and error code, clients will need to re-send messages.
* Adding replicas will nearly linearly increase throughput.
* Due to the lack of state, do not use HTTP sources and sinks to connect steps.
""")
.annotate("dataflow.argoproj.io/needs", "dataflow-103-http-main-source-default-secret.yaml")
.step(
(http(serviceName='http-main')
.cat()
.log()
))
.step(
(cron('*/3 * * * * *')
.cat('cron')
.http('https://http-main/sources/default', insecureSkipVerify=True,
headers=[{'name': "Authorization", "value": "Bearer my-bearer-token"}])
))
.save())