Fixed generator, passing tests
This commit is contained in:
@@ -341,6 +341,9 @@ class Elasticsearch(object):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
|
if doc_type in SKIP_IN_PATH:
|
||||||
|
doc_type = "_doc"
|
||||||
|
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"PUT", _make_path(index, doc_type, id, "_create"), params=params, body=body
|
"PUT", _make_path(index, doc_type, id, "_create"), params=params, body=body
|
||||||
)
|
)
|
||||||
@@ -410,7 +413,6 @@ class Elasticsearch(object):
|
|||||||
"_source",
|
"_source",
|
||||||
"_source_excludes",
|
"_source_excludes",
|
||||||
"_source_includes",
|
"_source_includes",
|
||||||
"doc_type",
|
|
||||||
"pipeline",
|
"pipeline",
|
||||||
"refresh",
|
"refresh",
|
||||||
"routing",
|
"routing",
|
||||||
@@ -581,7 +583,7 @@ class Elasticsearch(object):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
if doc_type is None:
|
if doc_type in SKIP_IN_PATH:
|
||||||
doc_type = "_doc"
|
doc_type = "_doc"
|
||||||
|
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
@@ -795,7 +797,7 @@ class Elasticsearch(object):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
if doc_type is None:
|
if doc_type in SKIP_IN_PATH:
|
||||||
doc_type = "_doc"
|
doc_type = "_doc"
|
||||||
|
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
@@ -896,6 +898,9 @@ class Elasticsearch(object):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
|
if doc_type in SKIP_IN_PATH:
|
||||||
|
doc_type = "_doc"
|
||||||
|
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"GET", _make_path(index, doc_type, id, "_explain"), params=params, body=body
|
"GET", _make_path(index, doc_type, id, "_explain"), params=params, body=body
|
||||||
)
|
)
|
||||||
@@ -975,7 +980,7 @@ class Elasticsearch(object):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
if doc_type is None:
|
if doc_type in SKIP_IN_PATH:
|
||||||
doc_type = "_doc"
|
doc_type = "_doc"
|
||||||
|
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
@@ -1039,6 +1044,9 @@ class Elasticsearch(object):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
|
if doc_type in SKIP_IN_PATH:
|
||||||
|
doc_type = "_doc"
|
||||||
|
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"GET", _make_path(index, doc_type, id, "_source"), params=params
|
"GET", _make_path(index, doc_type, id, "_source"), params=params
|
||||||
)
|
)
|
||||||
@@ -1236,7 +1244,7 @@ class Elasticsearch(object):
|
|||||||
body=body,
|
body=body,
|
||||||
)
|
)
|
||||||
|
|
||||||
@query_params("context", "master_timeout", "timeout")
|
@query_params("master_timeout", "timeout")
|
||||||
def put_script(self, id, body, context=None, params=None):
|
def put_script(self, id, body, context=None, params=None):
|
||||||
"""
|
"""
|
||||||
Creates or updates a script.
|
Creates or updates a script.
|
||||||
@@ -1372,7 +1380,7 @@ class Elasticsearch(object):
|
|||||||
"GET", "/_scripts/painless/_execute", params=params, body=body
|
"GET", "/_scripts/painless/_execute", params=params, body=body
|
||||||
)
|
)
|
||||||
|
|
||||||
@query_params("rest_total_hits_as_int", "scroll", "scroll_id")
|
@query_params("rest_total_hits_as_int", "scroll")
|
||||||
def scroll(self, body=None, scroll_id=None, params=None):
|
def scroll(self, body=None, scroll_id=None, params=None):
|
||||||
"""
|
"""
|
||||||
Allows to retrieve a large numbers of results from a single search request.
|
Allows to retrieve a large numbers of results from a single search request.
|
||||||
@@ -1694,6 +1702,9 @@ class Elasticsearch(object):
|
|||||||
if index in SKIP_IN_PATH:
|
if index in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'index'.")
|
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||||
|
|
||||||
|
if doc_type in SKIP_IN_PATH:
|
||||||
|
doc_type = "_doc"
|
||||||
|
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"GET",
|
"GET",
|
||||||
_make_path(index, doc_type, id, "_termvectors"),
|
_make_path(index, doc_type, id, "_termvectors"),
|
||||||
@@ -1755,6 +1766,9 @@ class Elasticsearch(object):
|
|||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument.")
|
raise ValueError("Empty value passed for a required argument.")
|
||||||
|
|
||||||
|
if doc_type in SKIP_IN_PATH:
|
||||||
|
doc_type = "_doc"
|
||||||
|
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"POST", _make_path(index, doc_type, id, "_update"), params=params, body=body
|
"POST", _make_path(index, doc_type, id, "_update"), params=params, body=body
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -213,16 +213,7 @@ class CatClient(NamespacedClient):
|
|||||||
return self.transport.perform_request("GET", "/_cat/nodes", params=params)
|
return self.transport.perform_request("GET", "/_cat/nodes", params=params)
|
||||||
|
|
||||||
@query_params(
|
@query_params(
|
||||||
"active_only",
|
"active_only", "bytes", "detailed", "format", "h", "help", "s", "time", "v"
|
||||||
"bytes",
|
|
||||||
"detailed",
|
|
||||||
"format",
|
|
||||||
"h",
|
|
||||||
"help",
|
|
||||||
"index",
|
|
||||||
"s",
|
|
||||||
"time",
|
|
||||||
"v",
|
|
||||||
)
|
)
|
||||||
def recovery(self, index=None, params=None):
|
def recovery(self, index=None, params=None):
|
||||||
"""
|
"""
|
||||||
@@ -361,7 +352,7 @@ class CatClient(NamespacedClient):
|
|||||||
params=params,
|
params=params,
|
||||||
)
|
)
|
||||||
|
|
||||||
@query_params("bytes", "fields", "format", "h", "help", "s", "v")
|
@query_params("bytes", "format", "h", "help", "s", "v")
|
||||||
def fielddata(self, fields=None, params=None):
|
def fielddata(self, fields=None, params=None):
|
||||||
"""
|
"""
|
||||||
Shows how much heap memory is currently being used by fielddata on every data
|
Shows how much heap memory is currently being used by fielddata on every data
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from .utils import NamespacedClient, query_params, _make_path
|
from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
|
||||||
|
|
||||||
|
|
||||||
class ClusterClient(NamespacedClient):
|
class ClusterClient(NamespacedClient):
|
||||||
@@ -121,7 +121,11 @@ class ClusterClient(NamespacedClient):
|
|||||||
:arg timeout: Explicit operation timeout
|
:arg timeout: Explicit operation timeout
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"GET", _make_path("_cluster", "stats", "nodes", node_id), params=params
|
"GET",
|
||||||
|
"/_cluster/stats"
|
||||||
|
if node_id in SKIP_IN_PATH
|
||||||
|
else _make_path("_cluster", "stats", "nodes", node_id),
|
||||||
|
params=params,
|
||||||
)
|
)
|
||||||
|
|
||||||
@query_params(
|
@query_params(
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
|
|||||||
|
|
||||||
|
|
||||||
class IndicesClient(NamespacedClient):
|
class IndicesClient(NamespacedClient):
|
||||||
@query_params("index")
|
@query_params()
|
||||||
def analyze(self, body=None, index=None, params=None):
|
def analyze(self, body=None, index=None, params=None):
|
||||||
"""
|
"""
|
||||||
Performs the analysis process on a text and return the tokens breakdown of the
|
Performs the analysis process on a text and return the tokens breakdown of the
|
||||||
@@ -356,6 +356,9 @@ class IndicesClient(NamespacedClient):
|
|||||||
if body in SKIP_IN_PATH:
|
if body in SKIP_IN_PATH:
|
||||||
raise ValueError("Empty value passed for a required argument 'body'.")
|
raise ValueError("Empty value passed for a required argument 'body'.")
|
||||||
|
|
||||||
|
if doc_type not in SKIP_IN_PATH and index in SKIP_IN_PATH:
|
||||||
|
index = "_all"
|
||||||
|
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"PUT", _make_path(index, doc_type, "_mapping"), params=params, body=body
|
"PUT", _make_path(index, doc_type, "_mapping"), params=params, body=body
|
||||||
)
|
)
|
||||||
@@ -854,7 +857,6 @@ class IndicesClient(NamespacedClient):
|
|||||||
"fielddata",
|
"fielddata",
|
||||||
"fields",
|
"fields",
|
||||||
"ignore_unavailable",
|
"ignore_unavailable",
|
||||||
"index",
|
|
||||||
"query",
|
"query",
|
||||||
"request",
|
"request",
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -29,10 +29,6 @@ class MlClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def delete_calendar(self, calendar_id, params=None):
|
def delete_calendar(self, calendar_id, params=None):
|
||||||
"""
|
"""
|
||||||
:arg calendar_id: The ID of the calendar to delete :arg calendar_id:
|
|
||||||
The ID of the calendar to delete :arg calendar_id: The ID of the
|
|
||||||
calendar to delete :arg calendar_id: The ID of the calendar to delete
|
|
||||||
:arg calendar_id: The ID of the calendar to delete
|
|
||||||
|
|
||||||
:arg calendar_id: The ID of the calendar to delete
|
:arg calendar_id: The ID of the calendar to delete
|
||||||
"""
|
"""
|
||||||
@@ -48,15 +44,6 @@ class MlClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def delete_calendar_event(self, calendar_id, event_id, params=None):
|
def delete_calendar_event(self, calendar_id, event_id, params=None):
|
||||||
"""
|
"""
|
||||||
:arg calendar_id: The ID of the calendar to modify :arg event_id: The
|
|
||||||
ID of the event to remove from the calendar :arg calendar_id: The ID
|
|
||||||
of the calendar to modify :arg event_id: The ID of the event to remove
|
|
||||||
from the calendar :arg calendar_id: The ID of the calendar to modify
|
|
||||||
:arg event_id: The ID of the event to remove from the calendar :arg
|
|
||||||
calendar_id: The ID of the calendar to modify :arg event_id: The ID of
|
|
||||||
the event to remove from the calendar :arg calendar_id: The ID of the
|
|
||||||
calendar to modify :arg event_id: The ID of the event to remove from
|
|
||||||
the calendar
|
|
||||||
|
|
||||||
:arg calendar_id: The ID of the calendar to modify
|
:arg calendar_id: The ID of the calendar to modify
|
||||||
:arg event_id: The ID of the event to remove from the calendar
|
:arg event_id: The ID of the event to remove from the calendar
|
||||||
@@ -74,15 +61,6 @@ class MlClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def delete_calendar_job(self, calendar_id, job_id, params=None):
|
def delete_calendar_job(self, calendar_id, job_id, params=None):
|
||||||
"""
|
"""
|
||||||
:arg calendar_id: The ID of the calendar to modify :arg job_id: The ID
|
|
||||||
of the job to remove from the calendar :arg calendar_id: The ID of the
|
|
||||||
calendar to modify :arg job_id: The ID of the job to remove from the
|
|
||||||
calendar :arg calendar_id: The ID of the calendar to modify
|
|
||||||
:arg job_id: The ID of the job to remove from the calendar :arg
|
|
||||||
calendar_id: The ID of the calendar to modify :arg job_id: The ID of
|
|
||||||
the job to remove from the calendar :arg calendar_id: The ID of the
|
|
||||||
calendar to modify :arg job_id: The ID of the job to remove from the
|
|
||||||
calendar
|
|
||||||
|
|
||||||
:arg calendar_id: The ID of the calendar to modify
|
:arg calendar_id: The ID of the calendar to modify
|
||||||
:arg job_id: The ID of the job to remove from the calendar
|
:arg job_id: The ID of the job to remove from the calendar
|
||||||
@@ -126,10 +104,6 @@ class MlClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def delete_filter(self, filter_id, params=None):
|
def delete_filter(self, filter_id, params=None):
|
||||||
"""
|
"""
|
||||||
:arg filter_id: The ID of the filter to delete :arg filter_id: The ID
|
|
||||||
of the filter to delete :arg filter_id: The ID of the filter to delete
|
|
||||||
:arg filter_id: The ID of the filter to delete :arg filter_id: The ID
|
|
||||||
of the filter to delete
|
|
||||||
|
|
||||||
:arg filter_id: The ID of the filter to delete
|
:arg filter_id: The ID of the filter to delete
|
||||||
"""
|
"""
|
||||||
@@ -291,23 +265,6 @@ class MlClient(NamespacedClient):
|
|||||||
@query_params("duration", "expires_in")
|
@query_params("duration", "expires_in")
|
||||||
def forecast(self, job_id, params=None):
|
def forecast(self, job_id, params=None):
|
||||||
"""
|
"""
|
||||||
:arg job_id: The ID of the job to forecast for :arg duration: The
|
|
||||||
duration of the forecast :arg expires_in: The time interval after which
|
|
||||||
the forecast expires. Expired forecasts will be deleted at the
|
|
||||||
first opportunity. :arg job_id: The ID of the job to forecast for
|
|
||||||
:arg duration: The duration of the forecast :arg expires_in: The time
|
|
||||||
interval after which the forecast expires. Expired forecasts will
|
|
||||||
be deleted at the first opportunity. :arg job_id: The ID of the job to
|
|
||||||
forecast for :arg duration: The duration of the forecast :arg
|
|
||||||
expires_in: The time interval after which the forecast expires.
|
|
||||||
Expired forecasts will be deleted at the first opportunity. :arg
|
|
||||||
job_id: The ID of the job to forecast for :arg duration: The duration
|
|
||||||
of the forecast :arg expires_in: The time interval after which the
|
|
||||||
forecast expires. Expired forecasts will be deleted at the first
|
|
||||||
opportunity. :arg job_id: The ID of the job to forecast for
|
|
||||||
:arg duration: The duration of the forecast :arg expires_in: The time
|
|
||||||
interval after which the forecast expires. Expired forecasts will
|
|
||||||
be deleted at the first opportunity.
|
|
||||||
|
|
||||||
:arg job_id: The ID of the job to forecast for
|
:arg job_id: The ID of the job to forecast for
|
||||||
:arg duration: The duration of the forecast
|
:arg duration: The duration of the forecast
|
||||||
@@ -371,31 +328,6 @@ class MlClient(NamespacedClient):
|
|||||||
@query_params("end", "from_", "job_id", "size", "start")
|
@query_params("end", "from_", "job_id", "size", "start")
|
||||||
def get_calendar_events(self, calendar_id, params=None):
|
def get_calendar_events(self, calendar_id, params=None):
|
||||||
"""
|
"""
|
||||||
:arg calendar_id: The ID of the calendar containing the events :arg
|
|
||||||
end: Get events before this time :arg from_: Skips a number of events
|
|
||||||
:arg job_id: Get events for the job. When this option is used
|
|
||||||
calendar_id must be '_all' :arg size: Specifies a max number of events
|
|
||||||
to get :arg start: Get events after this time :arg
|
|
||||||
calendar_id: The ID of the calendar containing the events :arg end: Get
|
|
||||||
events before this time :arg from_: Skips a number of events
|
|
||||||
:arg job_id: Get events for the job. When this option is used
|
|
||||||
calendar_id must be '_all' :arg size: Specifies a max number of events
|
|
||||||
to get :arg start: Get events after this time :arg
|
|
||||||
calendar_id: The ID of the calendar containing the events :arg end: Get
|
|
||||||
events before this time :arg from_: Skips a number of events
|
|
||||||
:arg job_id: Get events for the job. When this option is used
|
|
||||||
calendar_id must be '_all' :arg size: Specifies a max number of events
|
|
||||||
to get :arg start: Get events after this time :arg
|
|
||||||
calendar_id: The ID of the calendar containing the events :arg end: Get
|
|
||||||
events before this time :arg from_: Skips a number of events
|
|
||||||
:arg job_id: Get events for the job. When this option is used
|
|
||||||
calendar_id must be '_all' :arg size: Specifies a max number of events
|
|
||||||
to get :arg start: Get events after this time :arg
|
|
||||||
calendar_id: The ID of the calendar containing the events :arg end: Get
|
|
||||||
events before this time :arg from_: Skips a number of events
|
|
||||||
:arg job_id: Get events for the job. When this option is used
|
|
||||||
calendar_id must be '_all' :arg size: Specifies a max number of events
|
|
||||||
to get :arg start: Get events after this time
|
|
||||||
|
|
||||||
:arg calendar_id: The ID of the calendar containing the events
|
:arg calendar_id: The ID of the calendar containing the events
|
||||||
:arg end: Get events before this time
|
:arg end: Get events before this time
|
||||||
@@ -421,23 +353,6 @@ class MlClient(NamespacedClient):
|
|||||||
@query_params("from_", "size")
|
@query_params("from_", "size")
|
||||||
def get_calendars(self, body=None, calendar_id=None, params=None):
|
def get_calendars(self, body=None, calendar_id=None, params=None):
|
||||||
"""
|
"""
|
||||||
:arg body: The from and size parameters optionally sent in the body
|
|
||||||
:arg calendar_id: The ID of the calendar to fetch :arg from_: skips a
|
|
||||||
number of calendars :arg size: specifies a max number of calendars to
|
|
||||||
get :arg body: The from and size parameters optionally sent in the
|
|
||||||
body :arg calendar_id: The ID of the calendar to fetch :arg
|
|
||||||
from_: skips a number of calendars :arg size: specifies a max number of
|
|
||||||
calendars to get :arg body: The from and size parameters optionally
|
|
||||||
sent in the body :arg calendar_id: The ID of the calendar
|
|
||||||
to fetch :arg from_: skips a number of calendars :arg size:
|
|
||||||
specifies a max number of calendars to get :arg body: The from and
|
|
||||||
size parameters optionally sent in the body :arg
|
|
||||||
calendar_id: The ID of the calendar to fetch :arg from_: skips a number
|
|
||||||
of calendars :arg size: specifies a max number of calendars to get
|
|
||||||
:arg body: The from and size parameters optionally sent in the body
|
|
||||||
:arg calendar_id: The ID of the calendar to fetch :arg from_: skips a
|
|
||||||
number of calendars :arg size: specifies a max number of calendars to
|
|
||||||
get
|
|
||||||
|
|
||||||
:arg body: The from and size parameters optionally sent in the
|
:arg body: The from and size parameters optionally sent in the
|
||||||
body
|
body
|
||||||
@@ -512,16 +427,6 @@ class MlClient(NamespacedClient):
|
|||||||
@query_params("from_", "size")
|
@query_params("from_", "size")
|
||||||
def get_filters(self, filter_id=None, params=None):
|
def get_filters(self, filter_id=None, params=None):
|
||||||
"""
|
"""
|
||||||
:arg filter_id: The ID of the filter to fetch :arg from_: skips a
|
|
||||||
number of filters :arg size: specifies a max number of filters to get
|
|
||||||
:arg filter_id: The ID of the filter to fetch :arg from_: skips a
|
|
||||||
number of filters :arg size: specifies a max number of filters to get
|
|
||||||
:arg filter_id: The ID of the filter to fetch :arg from_: skips a
|
|
||||||
number of filters :arg size: specifies a max number of filters to get
|
|
||||||
:arg filter_id: The ID of the filter to fetch :arg from_: skips a
|
|
||||||
number of filters :arg size: specifies a max number of filters to get
|
|
||||||
:arg filter_id: The ID of the filter to fetch :arg from_: skips a
|
|
||||||
number of filters :arg size: specifies a max number of filters to get
|
|
||||||
|
|
||||||
:arg filter_id: The ID of the filter to fetch
|
:arg filter_id: The ID of the filter to fetch
|
||||||
:arg from_: skips a number of filters
|
:arg from_: skips a number of filters
|
||||||
@@ -749,13 +654,6 @@ class MlClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def post_calendar_events(self, calendar_id, body, params=None):
|
def post_calendar_events(self, calendar_id, body, params=None):
|
||||||
"""
|
"""
|
||||||
:arg calendar_id: The ID of the calendar to modify :arg body: A list of
|
|
||||||
events :arg calendar_id: The ID of the calendar to modify :arg
|
|
||||||
body: A list of events :arg calendar_id: The ID of the calendar to
|
|
||||||
modify :arg body: A list of events :arg calendar_id: The ID of
|
|
||||||
the calendar to modify :arg body: A list of events :arg
|
|
||||||
calendar_id: The ID of the calendar to modify :arg body: A list of
|
|
||||||
events
|
|
||||||
|
|
||||||
:arg calendar_id: The ID of the calendar to modify
|
:arg calendar_id: The ID of the calendar to modify
|
||||||
:arg body: A list of events
|
:arg body: A list of events
|
||||||
@@ -816,13 +714,6 @@ class MlClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def put_calendar(self, calendar_id, body=None, params=None):
|
def put_calendar(self, calendar_id, body=None, params=None):
|
||||||
"""
|
"""
|
||||||
:arg calendar_id: The ID of the calendar to create :arg body: The
|
|
||||||
calendar details :arg calendar_id: The ID of the calendar to create
|
|
||||||
:arg body: The calendar details :arg calendar_id: The ID of the
|
|
||||||
calendar to create :arg body: The calendar details :arg
|
|
||||||
calendar_id: The ID of the calendar to create :arg body: The calendar
|
|
||||||
details :arg calendar_id: The ID of the calendar to create
|
|
||||||
:arg body: The calendar details
|
|
||||||
|
|
||||||
:arg calendar_id: The ID of the calendar to create
|
:arg calendar_id: The ID of the calendar to create
|
||||||
:arg body: The calendar details
|
:arg body: The calendar details
|
||||||
@@ -839,15 +730,6 @@ class MlClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def put_calendar_job(self, calendar_id, job_id, params=None):
|
def put_calendar_job(self, calendar_id, job_id, params=None):
|
||||||
"""
|
"""
|
||||||
:arg calendar_id: The ID of the calendar to modify :arg job_id: The ID
|
|
||||||
of the job to add to the calendar :arg calendar_id: The ID of the
|
|
||||||
calendar to modify :arg job_id: The ID of the job to add to the
|
|
||||||
calendar :arg calendar_id: The ID of the calendar to modify
|
|
||||||
:arg job_id: The ID of the job to add to the calendar :arg
|
|
||||||
calendar_id: The ID of the calendar to modify :arg job_id: The ID of
|
|
||||||
the job to add to the calendar :arg calendar_id: The ID of the
|
|
||||||
calendar to modify :arg job_id: The ID of the job to add to the
|
|
||||||
calendar
|
|
||||||
|
|
||||||
:arg calendar_id: The ID of the calendar to modify
|
:arg calendar_id: The ID of the calendar to modify
|
||||||
:arg job_id: The ID of the job to add to the calendar
|
:arg job_id: The ID of the job to add to the calendar
|
||||||
@@ -881,12 +763,6 @@ class MlClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def put_filter(self, filter_id, body, params=None):
|
def put_filter(self, filter_id, body, params=None):
|
||||||
"""
|
"""
|
||||||
:arg filter_id: The ID of the filter to create :arg body: The filter
|
|
||||||
details :arg filter_id: The ID of the filter to create :arg
|
|
||||||
body: The filter details :arg filter_id: The ID of the filter to
|
|
||||||
create :arg body: The filter details :arg filter_id: The ID of
|
|
||||||
the filter to create :arg body: The filter details :arg
|
|
||||||
filter_id: The ID of the filter to create :arg body: The filter details
|
|
||||||
|
|
||||||
:arg filter_id: The ID of the filter to create
|
:arg filter_id: The ID of the filter to create
|
||||||
:arg body: The filter details
|
:arg body: The filter details
|
||||||
@@ -1030,12 +906,6 @@ class MlClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def update_filter(self, filter_id, body, params=None):
|
def update_filter(self, filter_id, body, params=None):
|
||||||
"""
|
"""
|
||||||
:arg filter_id: The ID of the filter to update :arg body: The filter
|
|
||||||
update :arg filter_id: The ID of the filter to update :arg
|
|
||||||
body: The filter update :arg filter_id: The ID of the filter to update
|
|
||||||
:arg body: The filter update :arg filter_id: The ID of the filter to
|
|
||||||
update :arg body: The filter update :arg filter_id: The ID of
|
|
||||||
the filter to update :arg body: The filter update
|
|
||||||
|
|
||||||
:arg filter_id: The ID of the filter to update
|
:arg filter_id: The ID of the filter to update
|
||||||
:arg body: The filter update
|
:arg body: The filter update
|
||||||
@@ -1100,9 +970,6 @@ class MlClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def validate(self, body, params=None):
|
def validate(self, body, params=None):
|
||||||
"""
|
"""
|
||||||
:arg body: The job config :arg body: The job config :arg
|
|
||||||
body: The job config :arg body: The job config :arg body: The
|
|
||||||
job config
|
|
||||||
|
|
||||||
:arg body: The job config
|
:arg body: The job config
|
||||||
"""
|
"""
|
||||||
@@ -1116,8 +983,6 @@ class MlClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def validate_detector(self, body, params=None):
|
def validate_detector(self, body, params=None):
|
||||||
"""
|
"""
|
||||||
:arg body: The detector :arg body: The detector :arg body:
|
|
||||||
The detector :arg body: The detector :arg body: The detector
|
|
||||||
|
|
||||||
:arg body: The detector
|
:arg body: The detector
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -5,9 +5,6 @@ class RollupClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def delete_job(self, id, params=None):
|
def delete_job(self, id, params=None):
|
||||||
"""
|
"""
|
||||||
:arg id: The ID of the job to delete :arg id: The ID of the job to
|
|
||||||
delete :arg id: The ID of the job to delete :arg id: The ID
|
|
||||||
of the job to delete :arg id: The ID of the job to delete
|
|
||||||
|
|
||||||
:arg id: The ID of the job to delete
|
:arg id: The ID of the job to delete
|
||||||
"""
|
"""
|
||||||
@@ -21,14 +18,6 @@ class RollupClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def get_jobs(self, id=None, params=None):
|
def get_jobs(self, id=None, params=None):
|
||||||
"""
|
"""
|
||||||
:arg id: The ID of the job(s) to fetch. Accepts glob patterns, or
|
|
||||||
left blank for all jobs :arg id: The ID of the job(s) to fetch.
|
|
||||||
Accepts glob patterns, or left blank for all jobs :arg id:
|
|
||||||
The ID of the job(s) to fetch. Accepts glob patterns, or left blank
|
|
||||||
for all jobs :arg id: The ID of the job(s) to fetch. Accepts glob
|
|
||||||
patterns, or left blank for all jobs :arg id: The ID of
|
|
||||||
the job(s) to fetch. Accepts glob patterns, or left blank for all
|
|
||||||
jobs
|
|
||||||
|
|
||||||
:arg id: The ID of the job(s) to fetch. Accepts glob patterns,
|
:arg id: The ID of the job(s) to fetch. Accepts glob patterns,
|
||||||
or left blank for all jobs
|
or left blank for all jobs
|
||||||
@@ -40,13 +29,6 @@ class RollupClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def get_rollup_caps(self, id=None, params=None):
|
def get_rollup_caps(self, id=None, params=None):
|
||||||
"""
|
"""
|
||||||
:arg id: The ID of the index to check rollup capabilities on, or left
|
|
||||||
blank for all jobs :arg id: The ID of the index to check rollup
|
|
||||||
capabilities on, or left blank for all jobs :arg id: The
|
|
||||||
ID of the index to check rollup capabilities on, or left blank for
|
|
||||||
all jobs :arg id: The ID of the index to check rollup capabilities on,
|
|
||||||
or left blank for all jobs :arg id: The ID of the index to
|
|
||||||
check rollup capabilities on, or left blank for all jobs
|
|
||||||
|
|
||||||
:arg id: The ID of the index to check rollup capabilities on, or
|
:arg id: The ID of the index to check rollup capabilities on, or
|
||||||
left blank for all jobs
|
left blank for all jobs
|
||||||
@@ -58,13 +40,6 @@ class RollupClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def get_rollup_index_caps(self, index, params=None):
|
def get_rollup_index_caps(self, index, params=None):
|
||||||
"""
|
"""
|
||||||
:arg index: The rollup index or index pattern to obtain rollup
|
|
||||||
capabilities from. :arg index: The rollup index or index pattern to
|
|
||||||
obtain rollup capabilities from. :arg index: The rollup
|
|
||||||
index or index pattern to obtain rollup capabilities from.
|
|
||||||
:arg index: The rollup index or index pattern to obtain rollup
|
|
||||||
capabilities from. :arg index: The rollup index or index pattern to
|
|
||||||
obtain rollup capabilities from.
|
|
||||||
|
|
||||||
:arg index: The rollup index or index pattern to obtain rollup
|
:arg index: The rollup index or index pattern to obtain rollup
|
||||||
capabilities from.
|
capabilities from.
|
||||||
@@ -79,11 +54,6 @@ class RollupClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def put_job(self, id, body, params=None):
|
def put_job(self, id, body, params=None):
|
||||||
"""
|
"""
|
||||||
:arg id: The ID of the job to create :arg body: The job configuration
|
|
||||||
:arg id: The ID of the job to create :arg body: The job configuration
|
|
||||||
:arg id: The ID of the job to create :arg body: The job configuration
|
|
||||||
:arg id: The ID of the job to create :arg body: The job configuration
|
|
||||||
:arg id: The ID of the job to create :arg body: The job configuration
|
|
||||||
|
|
||||||
:arg id: The ID of the job to create
|
:arg id: The ID of the job to create
|
||||||
:arg body: The job configuration
|
:arg body: The job configuration
|
||||||
@@ -99,40 +69,6 @@ class RollupClient(NamespacedClient):
|
|||||||
@query_params("rest_total_hits_as_int", "typed_keys")
|
@query_params("rest_total_hits_as_int", "typed_keys")
|
||||||
def rollup_search(self, index, body, doc_type=None, params=None):
|
def rollup_search(self, index, body, doc_type=None, params=None):
|
||||||
"""
|
"""
|
||||||
:arg index: The indices or index-pattern(s) (containing rollup or
|
|
||||||
regular data) that should be searched :arg body: The search request
|
|
||||||
body :arg doc_type: The doc type inside the index :arg
|
|
||||||
rest_total_hits_as_int: Indicates whether hits.total should be
|
|
||||||
rendered as an integer or an object in the rest search response :arg
|
|
||||||
typed_keys: Specify whether aggregation and suggester names should
|
|
||||||
be prefixed by their respective types in the response :arg index: The
|
|
||||||
indices or index-pattern(s) (containing rollup or regular data)
|
|
||||||
that should be searched :arg body: The search request body :arg
|
|
||||||
doc_type: The doc type inside the index :arg rest_total_hits_as_int:
|
|
||||||
Indicates whether hits.total should be rendered as an integer or an
|
|
||||||
object in the rest search response :arg typed_keys: Specify whether
|
|
||||||
aggregation and suggester names should be prefixed by their
|
|
||||||
respective types in the response :arg index: The indices or index-
|
|
||||||
pattern(s) (containing rollup or regular data) that should be
|
|
||||||
searched :arg body: The search request body :arg doc_type: The
|
|
||||||
doc type inside the index :arg rest_total_hits_as_int: Indicates
|
|
||||||
whether hits.total should be rendered as an integer or an object in
|
|
||||||
the rest search response :arg typed_keys: Specify whether aggregation
|
|
||||||
and suggester names should be prefixed by their respective types in
|
|
||||||
the response :arg index: The indices or index-pattern(s) (containing
|
|
||||||
rollup or regular data) that should be searched :arg body:
|
|
||||||
The search request body :arg doc_type: The doc type inside the index
|
|
||||||
:arg rest_total_hits_as_int: Indicates whether hits.total should be
|
|
||||||
rendered as an integer or an object in the rest search response :arg
|
|
||||||
typed_keys: Specify whether aggregation and suggester names should
|
|
||||||
be prefixed by their respective types in the response :arg index: The
|
|
||||||
indices or index-pattern(s) (containing rollup or regular data)
|
|
||||||
that should be searched :arg body: The search request body :arg
|
|
||||||
doc_type: The doc type inside the index :arg rest_total_hits_as_int:
|
|
||||||
Indicates whether hits.total should be rendered as an integer or an
|
|
||||||
object in the rest search response :arg typed_keys: Specify whether
|
|
||||||
aggregation and suggester names should be prefixed by their
|
|
||||||
respective types in the response
|
|
||||||
|
|
||||||
:arg index: The indices or index-pattern(s) (containing rollup
|
:arg index: The indices or index-pattern(s) (containing rollup
|
||||||
or regular data) that should be searched
|
or regular data) that should be searched
|
||||||
@@ -157,9 +93,6 @@ class RollupClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def start_job(self, id, params=None):
|
def start_job(self, id, params=None):
|
||||||
"""
|
"""
|
||||||
:arg id: The ID of the job to start :arg id: The ID of the job to
|
|
||||||
start :arg id: The ID of the job to start :arg id: The ID of
|
|
||||||
the job to start :arg id: The ID of the job to start
|
|
||||||
|
|
||||||
:arg id: The ID of the job to start
|
:arg id: The ID of the job to start
|
||||||
"""
|
"""
|
||||||
@@ -173,29 +106,6 @@ class RollupClient(NamespacedClient):
|
|||||||
@query_params("timeout", "wait_for_completion")
|
@query_params("timeout", "wait_for_completion")
|
||||||
def stop_job(self, id, params=None):
|
def stop_job(self, id, params=None):
|
||||||
"""
|
"""
|
||||||
:arg id: The ID of the job to stop :arg timeout: Block for (at maximum)
|
|
||||||
the specified duration while waiting for the job to stop. Defaults
|
|
||||||
to 30s. :arg wait_for_completion: True if the API should block until
|
|
||||||
the job has fully stopped, false if should be executed async.
|
|
||||||
Defaults to false. :arg id: The ID of the job to stop
|
|
||||||
:arg timeout: Block for (at maximum) the specified duration while
|
|
||||||
waiting for the job to stop. Defaults to 30s. :arg
|
|
||||||
wait_for_completion: True if the API should block until the job has
|
|
||||||
fully stopped, false if should be executed async. Defaults to false.
|
|
||||||
:arg id: The ID of the job to stop :arg timeout: Block for (at maximum)
|
|
||||||
the specified duration while waiting for the job to stop. Defaults
|
|
||||||
to 30s. :arg wait_for_completion: True if the API should block until
|
|
||||||
the job has fully stopped, false if should be executed async.
|
|
||||||
Defaults to false. :arg id: The ID of the job to stop
|
|
||||||
:arg timeout: Block for (at maximum) the specified duration while
|
|
||||||
waiting for the job to stop. Defaults to 30s. :arg
|
|
||||||
wait_for_completion: True if the API should block until the job has
|
|
||||||
fully stopped, false if should be executed async. Defaults to false.
|
|
||||||
:arg id: The ID of the job to stop :arg timeout: Block for (at maximum)
|
|
||||||
the specified duration while waiting for the job to stop. Defaults
|
|
||||||
to 30s. :arg wait_for_completion: True if the API should block until
|
|
||||||
the job has fully stopped, false if should be executed async.
|
|
||||||
Defaults to false.
|
|
||||||
|
|
||||||
:arg id: The ID of the job to stop
|
:arg id: The ID of the job to stop
|
||||||
:arg timeout: Block for (at maximum) the specified duration
|
:arg timeout: Block for (at maximum) the specified duration
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ class WatcherClient(NamespacedClient):
|
|||||||
"""
|
"""
|
||||||
return self.transport.perform_request("POST", "/_watcher/_start", params=params)
|
return self.transport.perform_request("POST", "/_watcher/_start", params=params)
|
||||||
|
|
||||||
@query_params("emit_stacktraces", "metric")
|
@query_params("emit_stacktraces")
|
||||||
def stats(self, metric=None, params=None):
|
def stats(self, metric=None, params=None):
|
||||||
"""
|
"""
|
||||||
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html>`_
|
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html>`_
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ class XPackClient(NamespacedClient):
|
|||||||
@query_params("categories")
|
@query_params("categories")
|
||||||
def info(self, params=None):
|
def info(self, params=None):
|
||||||
"""
|
"""
|
||||||
Retrieve information about xpack, including build number/timestamp and license
|
|
||||||
status
|
|
||||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html>`_
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html>`_
|
||||||
|
|
||||||
:arg categories: Comma-separated list of info categories. Can be
|
:arg categories: Comma-separated list of info categories. Can be
|
||||||
@@ -21,8 +19,6 @@ class XPackClient(NamespacedClient):
|
|||||||
@query_params("master_timeout")
|
@query_params("master_timeout")
|
||||||
def usage(self, params=None):
|
def usage(self, params=None):
|
||||||
"""
|
"""
|
||||||
Retrieve information about xpack features usage :arg master_timeout:
|
|
||||||
Specify timeout for watch write operation
|
|
||||||
`<Retrieve information about xpack features usage>`_
|
`<Retrieve information about xpack features usage>`_
|
||||||
|
|
||||||
:arg master_timeout: Specify timeout for watch write operation
|
:arg master_timeout: Specify timeout for watch write operation
|
||||||
|
|||||||
+19
-9
@@ -93,6 +93,12 @@ BASE_TEMPLATES = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
OVERRIDE_TEMPLATES = {
|
OVERRIDE_TEMPLATES = {
|
||||||
|
"cluster.stats": """
|
||||||
|
{% 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%}
|
||||||
|
""",
|
||||||
"__init__.ping": """
|
"__init__.ping": """
|
||||||
{% extends "base" %}
|
{% extends "base" %}
|
||||||
{% block request %}
|
{% block request %}
|
||||||
@@ -138,13 +144,23 @@ OVERRIDE_TEMPLATES = {
|
|||||||
return self.transport.perform_request("{{ api.method }}", "/_search/scroll", params=params, body=body)
|
return self.transport.perform_request("{{ api.method }}", "/_search/scroll", params=params, body=body)
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
""",
|
""",
|
||||||
|
"indices.put_mapping": """
|
||||||
|
{% extends "base" %}
|
||||||
|
{% block request %}
|
||||||
|
if doc_type not in SKIP_IN_PATH and index in SKIP_IN_PATH:
|
||||||
|
index = "_all"
|
||||||
|
|
||||||
|
{{ super()|trim }}
|
||||||
|
{% endblock %}
|
||||||
|
"""
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for op in ("get", "delete", "exists"):
|
for op in ("get", "delete", "exists", "update", "create", "explain", "get_source", "termvectors"):
|
||||||
OVERRIDE_TEMPLATES[f"__init__.{op}"] = """
|
OVERRIDE_TEMPLATES[f"__init__.{op}"] = """
|
||||||
{% extends "base" %}
|
{% extends "base" %}
|
||||||
{% block request %}
|
{% block request %}
|
||||||
if doc_type is None:
|
if doc_type in SKIP_IN_PATH:
|
||||||
doc_type = "_doc"
|
doc_type = "_doc"
|
||||||
|
|
||||||
{{ super()|trim }}
|
{{ super()|trim }}
|
||||||
@@ -172,11 +188,8 @@ class Module:
|
|||||||
|
|
||||||
def add(self, api):
|
def add(self, api):
|
||||||
self._apis.append(api)
|
self._apis.append(api)
|
||||||
if api.name in self.descriptions and not api.description:
|
|
||||||
api.description = self.descriptions[api.name]
|
|
||||||
|
|
||||||
def parse_orig(self):
|
def parse_orig(self):
|
||||||
self.descriptions = {}
|
|
||||||
self.orders = []
|
self.orders = []
|
||||||
self.header = "class C:"
|
self.header = "class C:"
|
||||||
fname = CODE_ROOT / "elasticsearch" / "client" / f"{self.namespace}.py"
|
fname = CODE_ROOT / "elasticsearch" / "client" / f"{self.namespace}.py"
|
||||||
@@ -201,9 +214,6 @@ class Module:
|
|||||||
content,
|
content,
|
||||||
re.MULTILINE,
|
re.MULTILINE,
|
||||||
)
|
)
|
||||||
self.descriptions = dict(
|
|
||||||
map(lambda i: (i[0], i[1].strip()), defined_apis)
|
|
||||||
)
|
|
||||||
self.orders = list(map(lambda x: x[0], defined_apis))
|
self.orders = list(map(lambda x: x[0], defined_apis))
|
||||||
|
|
||||||
def _position(self, api):
|
def _position(self, api):
|
||||||
@@ -289,7 +299,7 @@ class API:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def query_params(self):
|
def query_params(self):
|
||||||
return sorted(self._def.get("params", {}).keys())
|
return (k for k in sorted(self._def.get("params", {}).keys()) if k not in self._all_parts())
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def path(self):
|
def path(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user