We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12d372f commit e2e4b44Copy full SHA for e2e4b44
elasticcheck.py
@@ -2,6 +2,7 @@
2
import json
3
import argparse
4
import sys
5
+import os
6
7
parser = argparse.ArgumentParser(description='Check Elasticsearch Pipelines against testcases')
8
parser.add_argument('--prepare', action='store_true', help='send specified pipelines to elasticsearch')
@@ -14,8 +15,8 @@
14
15
16
if cmdline.prepare:
17
# input file should have been a pipeline -> send it to elasticsearch
- pipeName = jsonInput["name"]
18
- pipelineDefinition = jsonInput["pipeline"]
+ pipeName, _ = os.path.splitext(os.path.basename(cmdline.pipefile))
19
+ pipelineDefinition = jsonInput
20
url = f'{cmdline.elasticurl}/_ingest/pipeline/{pipeName}'
21
r = requests.put(url, json=pipelineDefinition)
22
if r.status_code >= 200 and r.status_code < 300:
0 commit comments