simple test DAG
This commit is contained in:
parent
d6bfc955a3
commit
2c81ded53c
|
@ -54,7 +54,7 @@ def bulk_load():
|
|||
session = requests.Session()
|
||||
session.auth = ("admin", "admin")
|
||||
|
||||
session.put("https://opensearch-cluster.lot1-opensearch-cluster.svc.local/organization_index",
|
||||
session.put("https://opensearch-cluster.lot1-opensearch-cluster.svc.cluster.local/organization_index",
|
||||
data=json.dumps({
|
||||
"settings": {
|
||||
"number_of_shards": 1,
|
||||
|
@ -68,7 +68,7 @@ def bulk_load():
|
|||
s3_obj = hook.get_key(key, bucket_name=S3_BUCKET_NAME)
|
||||
with gzip.GzipFile(fileobj=s3_obj.get()["Body"]) as gzipfile:
|
||||
for line in gzipfile:
|
||||
session.post("https://opensearch-cluster.lot1-opensearch-cluster.svc.local/organization_index/_doc",
|
||||
session.post("https://opensearch-cluster.lot1-opensearch-cluster.svc.cluster.local/organization_index/_doc",
|
||||
data=line,
|
||||
headers={"Content-Type": "application/json"},
|
||||
verify=False)
|
||||
|
@ -80,6 +80,6 @@ with DAG(
|
|||
start_date=datetime(2021, 1, 1),
|
||||
catchup=False,
|
||||
) as dag:
|
||||
bulk_load_data = bulk_load()
|
||||
bulk_load_data = bulk_load("")
|
||||
chain(bulk_load_data)
|
||||
|
||||
|
|
Loading…
Reference in New Issue