Move templates to files

This commit is contained in:
Honza Král
2019-12-22 16:32:49 +01:00
committed by Honza Král
parent 219a8bb12f
commit 77f084dc0d
21 changed files with 129 additions and 133 deletions
@@ -0,0 +1,12 @@
{% extends "base" %}
{% block request %}
if scroll_id in SKIP_IN_PATH and body in SKIP_IN_PATH:
raise ValueError("You need to supply scroll_id or body.")
elif scroll_id and not body:
body = {"scroll_id": [scroll_id]}
elif scroll_id:
params["scroll_id"] = scroll_id
return self.transport.perform_request("{{ api.method }}", "/_search/scroll", params=params, body=body)
{% endblock %}
+1
View File
@@ -0,0 +1 @@
single_doc_op
+1
View File
@@ -0,0 +1 @@
single_doc_op
+1
View File
@@ -0,0 +1 @@
single_doc_op
+1
View File
@@ -0,0 +1 @@
single_doc_op
+1
View File
@@ -0,0 +1 @@
single_doc_op
+1
View File
@@ -0,0 +1 @@
single_doc_op
+9
View File
@@ -0,0 +1,9 @@
{% extends "base" %}
{% block request %}
if doc_type is None:
doc_type = "_doc"
return self.transport.perform_request("POST" if id in SKIP_IN_PATH else "PUT", {% include "url" %}, params=params, body=body)
{% endblock %}
+8
View File
@@ -0,0 +1,8 @@
{% extends "base" %}
{% block request %}
try:
{{ super()|trim }}
except TransportError:
return False
{% endblock %}
+12
View File
@@ -0,0 +1,12 @@
{% extends "base" %}
{% block request %}
if scroll_id in SKIP_IN_PATH and body in SKIP_IN_PATH:
raise ValueError("You need to supply scroll_id or body.")
elif scroll_id and not body:
body = {"scroll_id": scroll_id}
elif scroll_id:
params["scroll_id"] = scroll_id
return self.transport.perform_request("{{ api.method }}", "/_search/scroll", params=params, body=body)
{% endblock %}
@@ -0,0 +1,8 @@
{% extends "base" %}
{% block request %}
if doc_type in SKIP_IN_PATH:
doc_type = "_doc"
{{ super()|trim }}
{% endblock %}
+1
View File
@@ -0,0 +1 @@
single_doc_op
+1
View File
@@ -0,0 +1 @@
single_doc_op
+5
View File
@@ -0,0 +1,5 @@
{% extends "base" %}
{% block request %}
return self.transport.perform_request("{{ api.method }}", "/_cluster/stats" if node_id in SKIP_IN_PATH else _make_path("_cluster", "stats", "nodes", node_id), params=params)
{% endblock%}
@@ -0,0 +1,8 @@
{% extends "base" %}
{% block request %}
if doc_type not in SKIP_IN_PATH and index in SKIP_IN_PATH:
index = "_all"
{{ super()|trim }}
{% endblock %}