partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | run | Start to run a strategy | rqalpha/__main__.py | def run(**kwargs):
"""
Start to run a strategy
"""
config_path = kwargs.get('config_path', None)
if config_path is not None:
config_path = os.path.abspath(config_path)
kwargs.pop('config_path')
if not kwargs.get('base__securities', None):
kwargs.pop('base__securities', No... | def run(**kwargs):
"""
Start to run a strategy
"""
config_path = kwargs.get('config_path', None)
if config_path is not None:
config_path = os.path.abspath(config_path)
kwargs.pop('config_path')
if not kwargs.get('base__securities', None):
kwargs.pop('base__securities', No... | [
"Start",
"to",
"run",
"a",
"strategy"
] | ricequant/rqalpha | python | https://github.com/ricequant/rqalpha/blob/ac40a62d4e7eca9494b4d0a14f46facf5616820c/rqalpha/__main__.py#L112-L140 | [
"def",
"run",
"(",
"*",
"*",
"kwargs",
")",
":",
"config_path",
"=",
"kwargs",
".",
"get",
"(",
"'config_path'",
",",
"None",
")",
"if",
"config_path",
"is",
"not",
"None",
":",
"config_path",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"config_path",... | ac40a62d4e7eca9494b4d0a14f46facf5616820c |
train | examples | Generate example strategies to target folder | rqalpha/__main__.py | def examples(directory):
"""
Generate example strategies to target folder
"""
source_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "examples")
try:
shutil.copytree(source_dir, os.path.join(directory, "examples"))
except OSError as e:
if e.errno == errno.EEXIST:... | def examples(directory):
"""
Generate example strategies to target folder
"""
source_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "examples")
try:
shutil.copytree(source_dir, os.path.join(directory, "examples"))
except OSError as e:
if e.errno == errno.EEXIST:... | [
"Generate",
"example",
"strategies",
"to",
"target",
"folder"
] | ricequant/rqalpha | python | https://github.com/ricequant/rqalpha/blob/ac40a62d4e7eca9494b4d0a14f46facf5616820c/rqalpha/__main__.py#L145-L155 | [
"def",
"examples",
"(",
"directory",
")",
":",
"source_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"realpath",
"(",
"__file__",
")",
")",
",",
"\"examples\"",
")",
"try",
":",
"shu... | ac40a62d4e7eca9494b4d0a14f46facf5616820c |
train | generate_config | Generate default config file | rqalpha/__main__.py | def generate_config(directory):
"""
Generate default config file
"""
default_config = os.path.join(os.path.dirname(os.path.realpath(__file__)), "config.yml")
target_config_path = os.path.abspath(os.path.join(directory, 'config.yml'))
shutil.copy(default_config, target_config_path)
six.print_... | def generate_config(directory):
"""
Generate default config file
"""
default_config = os.path.join(os.path.dirname(os.path.realpath(__file__)), "config.yml")
target_config_path = os.path.abspath(os.path.join(directory, 'config.yml'))
shutil.copy(default_config, target_config_path)
six.print_... | [
"Generate",
"default",
"config",
"file"
] | ricequant/rqalpha | python | https://github.com/ricequant/rqalpha/blob/ac40a62d4e7eca9494b4d0a14f46facf5616820c/rqalpha/__main__.py#L170-L177 | [
"def",
"generate_config",
"(",
"directory",
")",
":",
"default_config",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"realpath",
"(",
"__file__",
")",
")",
",",
"\"config.yml\"",
")",
"target... | ac40a62d4e7eca9494b4d0a14f46facf5616820c |
train | mod | Mod management command
rqalpha mod list \n
rqalpha mod install xxx \n
rqalpha mod uninstall xxx \n
rqalpha mod enable xxx \n
rqalpha mod disable xxx \n | rqalpha/__main__.py | def mod(cmd, params):
"""
Mod management command
rqalpha mod list \n
rqalpha mod install xxx \n
rqalpha mod uninstall xxx \n
rqalpha mod enable xxx \n
rqalpha mod disable xxx \n
"""
def list(params):
"""
List all mod configuration
"""
from tabulate i... | def mod(cmd, params):
"""
Mod management command
rqalpha mod list \n
rqalpha mod install xxx \n
rqalpha mod uninstall xxx \n
rqalpha mod enable xxx \n
rqalpha mod disable xxx \n
"""
def list(params):
"""
List all mod configuration
"""
from tabulate i... | [
"Mod",
"management",
"command"
] | ricequant/rqalpha | python | https://github.com/ricequant/rqalpha/blob/ac40a62d4e7eca9494b4d0a14f46facf5616820c/rqalpha/__main__.py#L188-L379 | [
"def",
"mod",
"(",
"cmd",
",",
"params",
")",
":",
"def",
"list",
"(",
"params",
")",
":",
"\"\"\"\n List all mod configuration\n \"\"\"",
"from",
"tabulate",
"import",
"tabulate",
"from",
"rqalpha",
".",
"utils",
".",
"config",
"import",
"get_mod_co... | ac40a62d4e7eca9494b4d0a14f46facf5616820c |
train | plot | [sys_analyser] draw result DataFrame | rqalpha/mod/rqalpha_mod_sys_analyser/__init__.py | def plot(result_pickle_file_path, show, plot_save_file):
"""
[sys_analyser] draw result DataFrame
"""
import pandas as pd
from .plot import plot_result
result_dict = pd.read_pickle(result_pickle_file_path)
plot_result(result_dict, show, plot_save_file) | def plot(result_pickle_file_path, show, plot_save_file):
"""
[sys_analyser] draw result DataFrame
"""
import pandas as pd
from .plot import plot_result
result_dict = pd.read_pickle(result_pickle_file_path)
plot_result(result_dict, show, plot_save_file) | [
"[",
"sys_analyser",
"]",
"draw",
"result",
"DataFrame"
] | ricequant/rqalpha | python | https://github.com/ricequant/rqalpha/blob/ac40a62d4e7eca9494b4d0a14f46facf5616820c/rqalpha/mod/rqalpha_mod_sys_analyser/__init__.py#L78-L86 | [
"def",
"plot",
"(",
"result_pickle_file_path",
",",
"show",
",",
"plot_save_file",
")",
":",
"import",
"pandas",
"as",
"pd",
"from",
".",
"plot",
"import",
"plot_result",
"result_dict",
"=",
"pd",
".",
"read_pickle",
"(",
"result_pickle_file_path",
")",
"plot_re... | ac40a62d4e7eca9494b4d0a14f46facf5616820c |
train | report | [sys_analyser] Generate report from backtest output file | rqalpha/mod/rqalpha_mod_sys_analyser/__init__.py | def report(result_pickle_file_path, target_report_csv_path):
"""
[sys_analyser] Generate report from backtest output file
"""
import pandas as pd
result_dict = pd.read_pickle(result_pickle_file_path)
from .report import generate_report
generate_report(result_dict, target_report_csv_path) | def report(result_pickle_file_path, target_report_csv_path):
"""
[sys_analyser] Generate report from backtest output file
"""
import pandas as pd
result_dict = pd.read_pickle(result_pickle_file_path)
from .report import generate_report
generate_report(result_dict, target_report_csv_path) | [
"[",
"sys_analyser",
"]",
"Generate",
"report",
"from",
"backtest",
"output",
"file"
] | ricequant/rqalpha | python | https://github.com/ricequant/rqalpha/blob/ac40a62d4e7eca9494b4d0a14f46facf5616820c/rqalpha/mod/rqalpha_mod_sys_analyser/__init__.py#L92-L100 | [
"def",
"report",
"(",
"result_pickle_file_path",
",",
"target_report_csv_path",
")",
":",
"import",
"pandas",
"as",
"pd",
"result_dict",
"=",
"pd",
".",
"read_pickle",
"(",
"result_pickle_file_path",
")",
"from",
".",
"report",
"import",
"generate_report",
"generate... | ac40a62d4e7eca9494b4d0a14f46facf5616820c |
train | FutureAccount.margin | [float] 总保证金 | rqalpha/mod/rqalpha_mod_sys_accounts/account_model/future_account.py | def margin(self):
"""
[float] 总保证金
"""
return sum(position.margin for position in six.itervalues(self._positions)) | def margin(self):
"""
[float] 总保证金
"""
return sum(position.margin for position in six.itervalues(self._positions)) | [
"[",
"float",
"]",
"总保证金"
] | ricequant/rqalpha | python | https://github.com/ricequant/rqalpha/blob/ac40a62d4e7eca9494b4d0a14f46facf5616820c/rqalpha/mod/rqalpha_mod_sys_accounts/account_model/future_account.py#L177-L181 | [
"def",
"margin",
"(",
"self",
")",
":",
"return",
"sum",
"(",
"position",
".",
"margin",
"for",
"position",
"in",
"six",
".",
"itervalues",
"(",
"self",
".",
"_positions",
")",
")"
] | ac40a62d4e7eca9494b4d0a14f46facf5616820c |
train | FutureAccount.buy_margin | [float] 买方向保证金 | rqalpha/mod/rqalpha_mod_sys_accounts/account_model/future_account.py | def buy_margin(self):
"""
[float] 买方向保证金
"""
return sum(position.buy_margin for position in six.itervalues(self._positions)) | def buy_margin(self):
"""
[float] 买方向保证金
"""
return sum(position.buy_margin for position in six.itervalues(self._positions)) | [
"[",
"float",
"]",
"买方向保证金"
] | ricequant/rqalpha | python | https://github.com/ricequant/rqalpha/blob/ac40a62d4e7eca9494b4d0a14f46facf5616820c/rqalpha/mod/rqalpha_mod_sys_accounts/account_model/future_account.py#L184-L188 | [
"def",
"buy_margin",
"(",
"self",
")",
":",
"return",
"sum",
"(",
"position",
".",
"buy_margin",
"for",
"position",
"in",
"six",
".",
"itervalues",
"(",
"self",
".",
"_positions",
")",
")"
] | ac40a62d4e7eca9494b4d0a14f46facf5616820c |
train | FutureAccount.sell_margin | [float] 卖方向保证金 | rqalpha/mod/rqalpha_mod_sys_accounts/account_model/future_account.py | def sell_margin(self):
"""
[float] 卖方向保证金
"""
return sum(position.sell_margin for position in six.itervalues(self._positions)) | def sell_margin(self):
"""
[float] 卖方向保证金
"""
return sum(position.sell_margin for position in six.itervalues(self._positions)) | [
"[",
"float",
"]",
"卖方向保证金"
] | ricequant/rqalpha | python | https://github.com/ricequant/rqalpha/blob/ac40a62d4e7eca9494b4d0a14f46facf5616820c/rqalpha/mod/rqalpha_mod_sys_accounts/account_model/future_account.py#L191-L195 | [
"def",
"sell_margin",
"(",
"self",
")",
":",
"return",
"sum",
"(",
"position",
".",
"sell_margin",
"for",
"position",
"in",
"six",
".",
"itervalues",
"(",
"self",
".",
"_positions",
")",
")"
] | ac40a62d4e7eca9494b4d0a14f46facf5616820c |
train | FutureAccount.holding_pnl | [float] 浮动盈亏 | rqalpha/mod/rqalpha_mod_sys_accounts/account_model/future_account.py | def holding_pnl(self):
"""
[float] 浮动盈亏
"""
return sum(position.holding_pnl for position in six.itervalues(self._positions)) | def holding_pnl(self):
"""
[float] 浮动盈亏
"""
return sum(position.holding_pnl for position in six.itervalues(self._positions)) | [
"[",
"float",
"]",
"浮动盈亏"
] | ricequant/rqalpha | python | https://github.com/ricequant/rqalpha/blob/ac40a62d4e7eca9494b4d0a14f46facf5616820c/rqalpha/mod/rqalpha_mod_sys_accounts/account_model/future_account.py#L206-L210 | [
"def",
"holding_pnl",
"(",
"self",
")",
":",
"return",
"sum",
"(",
"position",
".",
"holding_pnl",
"for",
"position",
"in",
"six",
".",
"itervalues",
"(",
"self",
".",
"_positions",
")",
")"
] | ac40a62d4e7eca9494b4d0a14f46facf5616820c |
train | FutureAccount.realized_pnl | [float] 平仓盈亏 | rqalpha/mod/rqalpha_mod_sys_accounts/account_model/future_account.py | def realized_pnl(self):
"""
[float] 平仓盈亏
"""
return sum(position.realized_pnl for position in six.itervalues(self._positions)) | def realized_pnl(self):
"""
[float] 平仓盈亏
"""
return sum(position.realized_pnl for position in six.itervalues(self._positions)) | [
"[",
"float",
"]",
"平仓盈亏"
] | ricequant/rqalpha | python | https://github.com/ricequant/rqalpha/blob/ac40a62d4e7eca9494b4d0a14f46facf5616820c/rqalpha/mod/rqalpha_mod_sys_accounts/account_model/future_account.py#L213-L217 | [
"def",
"realized_pnl",
"(",
"self",
")",
":",
"return",
"sum",
"(",
"position",
".",
"realized_pnl",
"for",
"position",
"in",
"six",
".",
"itervalues",
"(",
"self",
".",
"_positions",
")",
")"
] | ac40a62d4e7eca9494b4d0a14f46facf5616820c |
train | order | 全品种通用智能调仓函数
如果不指定 price, 则相当于下 MarketOrder
如果 order_book_id 是股票,等同于调用 order_shares
如果 order_book_id 是期货,则进行智能下单:
* quantity 表示调仓量
* 如果 quantity 为正数,则先平 Sell 方向仓位,再开 Buy 方向仓位
* 如果 quantity 为负数,则先平 Buy 反向仓位,再开 Sell 方向仓位
:param order_book_id: 下单标的物
:type order_book_id... | rqalpha/api/api_extension.py | def order(order_book_id, quantity, price=None, style=None):
"""
全品种通用智能调仓函数
如果不指定 price, 则相当于下 MarketOrder
如果 order_book_id 是股票,等同于调用 order_shares
如果 order_book_id 是期货,则进行智能下单:
* quantity 表示调仓量
* 如果 quantity 为正数,则先平 Sell 方向仓位,再开 Buy 方向仓位
* 如果 quantity 为负数,则先平 Buy 反向... | def order(order_book_id, quantity, price=None, style=None):
"""
全品种通用智能调仓函数
如果不指定 price, 则相当于下 MarketOrder
如果 order_book_id 是股票,等同于调用 order_shares
如果 order_book_id 是期货,则进行智能下单:
* quantity 表示调仓量
* 如果 quantity 为正数,则先平 Sell 方向仓位,再开 Buy 方向仓位
* 如果 quantity 为负数,则先平 Buy 反向... | [
"全品种通用智能调仓函数"
] | ricequant/rqalpha | python | https://github.com/ricequant/rqalpha/blob/ac40a62d4e7eca9494b4d0a14f46facf5616820c/rqalpha/api/api_extension.py#L52-L96 | [
"def",
"order",
"(",
"order_book_id",
",",
"quantity",
",",
"price",
"=",
"None",
",",
"style",
"=",
"None",
")",
":",
"style",
"=",
"cal_style",
"(",
"price",
",",
"style",
")",
"orders",
"=",
"Environment",
".",
"get_instance",
"(",
")",
".",
"portfo... | ac40a62d4e7eca9494b4d0a14f46facf5616820c |
train | SqlClient.clear_cursor | `<Clear SQL cursor>`_
:arg body: Specify the cursor value in the `cursor` element to clean the
cursor. | elasticsearch/client/xpack/sql.py | def clear_cursor(self, body, params=None):
"""
`<Clear SQL cursor>`_
:arg body: Specify the cursor value in the `cursor` element to clean the
cursor.
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
... | def clear_cursor(self, body, params=None):
"""
`<Clear SQL cursor>`_
:arg body: Specify the cursor value in the `cursor` element to clean the
cursor.
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
... | [
"<Clear",
"SQL",
"cursor",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/sql.py#L6-L17 | [
"def",
"clear_cursor",
"(",
"self",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self",
".",
"transport",
".",
"p... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SqlClient.query | `<Execute SQL>`_
:arg body: Use the `query` element to start a query. Use the `cursor`
element to continue a query.
:arg format: a short version of the Accept header, e.g. json, yaml | elasticsearch/client/xpack/sql.py | def query(self, body, params=None):
"""
`<Execute SQL>`_
:arg body: Use the `query` element to start a query. Use the `cursor`
element to continue a query.
:arg format: a short version of the Accept header, e.g. json, yaml
"""
if body in SKIP_IN_PATH:
... | def query(self, body, params=None):
"""
`<Execute SQL>`_
:arg body: Use the `query` element to start a query. Use the `cursor`
element to continue a query.
:arg format: a short version of the Accept header, e.g. json, yaml
"""
if body in SKIP_IN_PATH:
... | [
"<Execute",
"SQL",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/sql.py#L20-L30 | [
"def",
"query",
"(",
"self",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SqlClient.translate | `<Translate SQL into Elasticsearch queries>`_
:arg body: Specify the query in the `query` element. | elasticsearch/client/xpack/sql.py | def translate(self, body, params=None):
"""
`<Translate SQL into Elasticsearch queries>`_
:arg body: Specify the query in the `query` element.
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
return self.tran... | def translate(self, body, params=None):
"""
`<Translate SQL into Elasticsearch queries>`_
:arg body: Specify the query in the `query` element.
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
return self.tran... | [
"<Translate",
"SQL",
"into",
"Elasticsearch",
"queries",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/sql.py#L33-L43 | [
"def",
"translate",
"(",
"self",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perf... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Connection.log_request_success | Log a successful API call. | elasticsearch/connection/base.py | def log_request_success(self, method, full_url, path, body, status_code, response, duration):
""" Log a successful API call. """
# TODO: optionally pass in params instead of full_url and do urlencode only when needed
# body has already been serialized to utf-8, deserialize it for logging
... | def log_request_success(self, method, full_url, path, body, status_code, response, duration):
""" Log a successful API call. """
# TODO: optionally pass in params instead of full_url and do urlencode only when needed
# body has already been serialized to utf-8, deserialize it for logging
... | [
"Log",
"a",
"successful",
"API",
"call",
"."
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/connection/base.py#L72-L91 | [
"def",
"log_request_success",
"(",
"self",
",",
"method",
",",
"full_url",
",",
"path",
",",
"body",
",",
"status_code",
",",
"response",
",",
"duration",
")",
":",
"# TODO: optionally pass in params instead of full_url and do urlencode only when needed",
"# body has alrea... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Connection.log_request_fail | Log an unsuccessful API call. | elasticsearch/connection/base.py | def log_request_fail(self, method, full_url, path, body, duration, status_code=None, response=None, exception=None):
""" Log an unsuccessful API call. """
# do not log 404s on HEAD requests
if method == 'HEAD' and status_code == 404:
return
logger.warning(
'%s %s... | def log_request_fail(self, method, full_url, path, body, duration, status_code=None, response=None, exception=None):
""" Log an unsuccessful API call. """
# do not log 404s on HEAD requests
if method == 'HEAD' and status_code == 404:
return
logger.warning(
'%s %s... | [
"Log",
"an",
"unsuccessful",
"API",
"call",
"."
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/connection/base.py#L93-L116 | [
"def",
"log_request_fail",
"(",
"self",
",",
"method",
",",
"full_url",
",",
"path",
",",
"body",
",",
"duration",
",",
"status_code",
"=",
"None",
",",
"response",
"=",
"None",
",",
"exception",
"=",
"None",
")",
":",
"# do not log 404s on HEAD requests",
"... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Connection._raise_error | Locate appropriate exception and raise it. | elasticsearch/connection/base.py | def _raise_error(self, status_code, raw_data):
""" Locate appropriate exception and raise it. """
error_message = raw_data
additional_info = None
try:
if raw_data:
additional_info = json.loads(raw_data)
error_message = additional_info.get('erro... | def _raise_error(self, status_code, raw_data):
""" Locate appropriate exception and raise it. """
error_message = raw_data
additional_info = None
try:
if raw_data:
additional_info = json.loads(raw_data)
error_message = additional_info.get('erro... | [
"Locate",
"appropriate",
"exception",
"and",
"raise",
"it",
"."
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/connection/base.py#L118-L131 | [
"def",
"_raise_error",
"(",
"self",
",",
"status_code",
",",
"raw_data",
")",
":",
"error_message",
"=",
"raw_data",
"additional_info",
"=",
"None",
"try",
":",
"if",
"raw_data",
":",
"additional_info",
"=",
"json",
".",
"loads",
"(",
"raw_data",
")",
"error... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | _normalize_hosts | Helper function to transform hosts argument to
:class:`~elasticsearch.Elasticsearch` to a list of dicts. | elasticsearch/client/__init__.py | def _normalize_hosts(hosts):
"""
Helper function to transform hosts argument to
:class:`~elasticsearch.Elasticsearch` to a list of dicts.
"""
# if hosts are empty, just defer to defaults down the line
if hosts is None:
return [{}]
# passed in just one string
if isinstance(hosts,... | def _normalize_hosts(hosts):
"""
Helper function to transform hosts argument to
:class:`~elasticsearch.Elasticsearch` to a list of dicts.
"""
# if hosts are empty, just defer to defaults down the line
if hosts is None:
return [{}]
# passed in just one string
if isinstance(hosts,... | [
"Helper",
"function",
"to",
"transform",
"hosts",
"argument",
"to",
":",
"class",
":",
"~elasticsearch",
".",
"Elasticsearch",
"to",
"a",
"list",
"of",
"dicts",
"."
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/__init__.py#L21-L63 | [
"def",
"_normalize_hosts",
"(",
"hosts",
")",
":",
"# if hosts are empty, just defer to defaults down the line",
"if",
"hosts",
"is",
"None",
":",
"return",
"[",
"{",
"}",
"]",
"# passed in just one string",
"if",
"isinstance",
"(",
"hosts",
",",
"string_types",
")",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Elasticsearch.ping | Returns True if the cluster is up, False otherwise.
`<http://www.elastic.co/guide/>`_ | elasticsearch/client/__init__.py | def ping(self, params=None):
"""
Returns True if the cluster is up, False otherwise.
`<http://www.elastic.co/guide/>`_
"""
try:
return self.transport.perform_request("HEAD", "/", params=params)
except TransportError:
return False | def ping(self, params=None):
"""
Returns True if the cluster is up, False otherwise.
`<http://www.elastic.co/guide/>`_
"""
try:
return self.transport.perform_request("HEAD", "/", params=params)
except TransportError:
return False | [
"Returns",
"True",
"if",
"the",
"cluster",
"is",
"up",
"False",
"otherwise",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/__init__.py#L243-L251 | [
"def",
"ping",
"(",
"self",
",",
"params",
"=",
"None",
")",
":",
"try",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"HEAD\"",
",",
"\"/\"",
",",
"params",
"=",
"params",
")",
"except",
"TransportError",
":",
"return",
"False"... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Elasticsearch.mget | Get multiple documents based on an index, type (optional) and ids.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html>`_
:arg body: Document identifiers; can be either `docs` (containing full
document information) or `ids` (when index and type is provided i... | elasticsearch/client/__init__.py | def mget(self, body, doc_type=None, index=None, params=None):
"""
Get multiple documents based on an index, type (optional) and ids.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html>`_
:arg body: Document identifiers; can be either `docs` (containing ... | def mget(self, body, doc_type=None, index=None, params=None):
"""
Get multiple documents based on an index, type (optional) and ids.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html>`_
:arg body: Document identifiers; can be either `docs` (containing ... | [
"Get",
"multiple",
"documents",
"based",
"on",
"an",
"index",
"type",
"(",
"optional",
")",
"and",
"ids",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/__init__.py#L566-L595 | [
"def",
"mget",
"(",
"self",
",",
"body",
",",
"doc_type",
"=",
"None",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Elasticsearch.update | Update a document based on a script or partial data provided.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html>`_
:arg index: The name of the index
:arg id: Document ID
:arg body: The request definition using either `script` or partial `doc`
:arg... | elasticsearch/client/__init__.py | def update(self, index, id, doc_type="_doc", body=None, params=None):
"""
Update a document based on a script or partial data provided.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html>`_
:arg index: The name of the index
:arg id: Document ID
... | def update(self, index, id, doc_type="_doc", body=None, params=None):
"""
Update a document based on a script or partial data provided.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html>`_
:arg index: The name of the index
:arg id: Document ID
... | [
"Update",
"a",
"document",
"based",
"on",
"a",
"script",
"or",
"partial",
"data",
"provided",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"docs",
"-",
... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/__init__.py#L618-L662 | [
"def",
"update",
"(",
"self",
",",
"index",
",",
"id",
",",
"doc_type",
"=",
"\"_doc\"",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"index",
",",
"id",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Elasticsearch.search | Execute a search query and get back search hits that match the query.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html>`_
:arg index: A list of index names to search, or a string containing a
comma-separated list of index names to search; use `_all`
... | elasticsearch/client/__init__.py | def search(self, index=None, body=None, params=None):
"""
Execute a search query and get back search hits that match the query.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html>`_
:arg index: A list of index names to search, or a string containing a
... | def search(self, index=None, body=None, params=None):
"""
Execute a search query and get back search hits that match the query.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html>`_
:arg index: A list of index names to search, or a string containing a
... | [
"Execute",
"a",
"search",
"query",
"and",
"get",
"back",
"search",
"hits",
"that",
"match",
"the",
"query",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/__init__.py#L709-L813 | [
"def",
"search",
"(",
"self",
",",
"index",
"=",
"None",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"# from is a reserved word so it cannot be used, use from_ instead",
"if",
"\"from_\"",
"in",
"params",
":",
"params",
"[",
"\"from\"",
"]",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Elasticsearch.reindex | Reindex all documents from one index to another.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html>`_
:arg body: The search definition using the Query DSL and the prototype
for the index request.
:arg refresh: Should the effected indexes be refreshe... | elasticsearch/client/__init__.py | def reindex(self, body, params=None):
"""
Reindex all documents from one index to another.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html>`_
:arg body: The search definition using the Query DSL and the prototype
for the index request.
... | def reindex(self, body, params=None):
"""
Reindex all documents from one index to another.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html>`_
:arg body: The search definition using the Query DSL and the prototype
for the index request.
... | [
"Reindex",
"all",
"documents",
"from",
"one",
"index",
"to",
"another",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"docs",
"-",
"reindex",
".",
"html... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/__init__.py#L946-L973 | [
"def",
"reindex",
"(",
"self",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perfor... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Elasticsearch.reindex_rethrottle | Change the value of ``requests_per_second`` of a running ``reindex`` task.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html>`_
:arg task_id: The task id to rethrottle
:arg requests_per_second: The throttle to set on this request in
floating sub-req... | elasticsearch/client/__init__.py | def reindex_rethrottle(self, task_id=None, params=None):
"""
Change the value of ``requests_per_second`` of a running ``reindex`` task.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html>`_
:arg task_id: The task id to rethrottle
:arg requests_pe... | def reindex_rethrottle(self, task_id=None, params=None):
"""
Change the value of ``requests_per_second`` of a running ``reindex`` task.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html>`_
:arg task_id: The task id to rethrottle
:arg requests_pe... | [
"Change",
"the",
"value",
"of",
"requests_per_second",
"of",
"a",
"running",
"reindex",
"task",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"docs",
"-",... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/__init__.py#L976-L987 | [
"def",
"reindex_rethrottle",
"(",
"self",
",",
"task_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"\"_reindex\"",
",",
"task_id",
",",
"\"_rethrot... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Elasticsearch.search_shards | The search shards api returns the indices and shards that a search
request would be executed against. This can give useful feedback for working
out issues or planning optimizations with routing and shard preferences.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-shards.... | elasticsearch/client/__init__.py | def search_shards(self, index=None, params=None):
"""
The search shards api returns the indices and shards that a search
request would be executed against. This can give useful feedback for working
out issues or planning optimizations with routing and shard preferences.
`<http://... | def search_shards(self, index=None, params=None):
"""
The search shards api returns the indices and shards that a search
request would be executed against. This can give useful feedback for working
out issues or planning optimizations with routing and shard preferences.
`<http://... | [
"The",
"search",
"shards",
"api",
"returns",
"the",
"indices",
"and",
"shards",
"that",
"a",
"search",
"request",
"would",
"be",
"executed",
"against",
".",
"This",
"can",
"give",
"useful",
"feedback",
"for",
"working",
"out",
"issues",
"or",
"planning",
"op... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/__init__.py#L1115-L1141 | [
"def",
"search_shards",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"\"_search_shards\"",
")",
",",
"params"... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Elasticsearch.search_template | A query that accepts a query template and a map of key/value pairs to
fill in template parameters.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html>`_
:arg index: A list of index names to search, or a string containing a
comma-separated list of i... | elasticsearch/client/__init__.py | def search_template(self, index=None, body=None, params=None):
"""
A query that accepts a query template and a map of key/value pairs to
fill in template parameters.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html>`_
:arg index: A list of in... | def search_template(self, index=None, body=None, params=None):
"""
A query that accepts a query template and a map of key/value pairs to
fill in template parameters.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html>`_
:arg index: A list of in... | [
"A",
"query",
"that",
"accepts",
"a",
"query",
"template",
"and",
"a",
"map",
"of",
"key",
"/",
"value",
"pairs",
"to",
"fill",
"in",
"template",
"parameters",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/__init__.py#L1155-L1189 | [
"def",
"search_template",
"(",
"self",
",",
"index",
"=",
"None",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"\"_search... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Elasticsearch.scroll | Scroll a search request created by specifying the scroll parameter.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html>`_
:arg scroll_id: The scroll ID
:arg body: The scroll ID if not passed by URL or query parameter.
:arg scroll: Specify how lon... | elasticsearch/client/__init__.py | def scroll(self, scroll_id=None, body=None, params=None):
"""
Scroll a search request created by specifying the scroll parameter.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html>`_
:arg scroll_id: The scroll ID
:arg body: The scroll ID... | def scroll(self, scroll_id=None, body=None, params=None):
"""
Scroll a search request created by specifying the scroll parameter.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html>`_
:arg scroll_id: The scroll ID
:arg body: The scroll ID... | [
"Scroll",
"a",
"search",
"request",
"created",
"by",
"specifying",
"the",
"scroll",
"parameter",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"search",
"-... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/__init__.py#L1248-L1270 | [
"def",
"scroll",
"(",
"self",
",",
"scroll_id",
"=",
"None",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"scroll_id",
"in",
"SKIP_IN_PATH",
"and",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"You need to suppl... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Elasticsearch.mtermvectors | Multi termvectors API allows to get multiple termvectors based on an
index, type and id.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-termvectors.html>`_
:arg index: The index in which the document resides.
:arg body: Define ids, documents, parameters or a... | elasticsearch/client/__init__.py | def mtermvectors(self, doc_type=None, index=None, body=None, params=None):
"""
Multi termvectors API allows to get multiple termvectors based on an
index, type and id.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-termvectors.html>`_
:arg index: The... | def mtermvectors(self, doc_type=None, index=None, body=None, params=None):
"""
Multi termvectors API allows to get multiple termvectors based on an
index, type and id.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-termvectors.html>`_
:arg index: The... | [
"Multi",
"termvectors",
"API",
"allows",
"to",
"get",
"multiple",
"termvectors",
"based",
"on",
"an",
"index",
"type",
"and",
"id",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference"... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/__init__.py#L1565-L1615 | [
"def",
"mtermvectors",
"(",
"self",
",",
"doc_type",
"=",
"None",
",",
"index",
"=",
"None",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Elasticsearch.put_script | Create a script in given language with specified ID.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html>`_
:arg id: Script ID
:arg body: The document | elasticsearch/client/__init__.py | def put_script(self, id, body, context=None, params=None):
"""
Create a script in given language with specified ID.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html>`_
:arg id: Script ID
:arg body: The document
"""
for param... | def put_script(self, id, body, context=None, params=None):
"""
Create a script in given language with specified ID.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html>`_
:arg id: Script ID
:arg body: The document
"""
for param... | [
"Create",
"a",
"script",
"in",
"given",
"language",
"with",
"specified",
"ID",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"modules",
"-",
"scripting",
... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/__init__.py#L1618-L1631 | [
"def",
"put_script",
"(",
"self",
",",
"id",
",",
"body",
",",
"context",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"id",
",",
"body",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Elasticsearch.render_search_template | `<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-template.html>`_
:arg id: The id of the stored search template
:arg body: The search definition template and its params | elasticsearch/client/__init__.py | def render_search_template(self, id=None, body=None, params=None):
"""
`<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-template.html>`_
:arg id: The id of the stored search template
:arg body: The search definition template and its params
"""
... | def render_search_template(self, id=None, body=None, params=None):
"""
`<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-template.html>`_
:arg id: The id of the stored search template
:arg body: The search definition template and its params
"""
... | [
"<http",
":",
"//",
"www",
".",
"elasticsearch",
".",
"org",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"search",
"-",
"template",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/__init__.py#L1662-L1671 | [
"def",
"render_search_template",
"(",
"self",
",",
"id",
"=",
"None",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_render\"",
",",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Elasticsearch.msearch_template | The /_search/template endpoint allows to use the mustache language to
pre render search requests, before they are executed and fill existing
templates with template parameters.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html>`_
:arg body: The reques... | elasticsearch/client/__init__.py | def msearch_template(self, body, index=None, params=None):
"""
The /_search/template endpoint allows to use the mustache language to
pre render search requests, before they are executed and fill existing
templates with template parameters.
`<http://www.elastic.co/guide/en/elastic... | def msearch_template(self, body, index=None, params=None):
"""
The /_search/template endpoint allows to use the mustache language to
pre render search requests, before they are executed and fill existing
templates with template parameters.
`<http://www.elastic.co/guide/en/elastic... | [
"The",
"/",
"_search",
"/",
"template",
"endpoint",
"allows",
"to",
"use",
"the",
"mustache",
"language",
"to",
"pre",
"render",
"search",
"requests",
"before",
"they",
"are",
"executed",
"and",
"fill",
"existing",
"templates",
"with",
"template",
"parameters",
... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/__init__.py#L1674-L1701 | [
"def",
"msearch_template",
"(",
"self",
",",
"body",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"s... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Elasticsearch.field_caps | The field capabilities API allows to retrieve the capabilities of fields among multiple indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html>`_
:arg index: A list of index names, or a string containing a
comma-separated list of index names; use `_... | elasticsearch/client/__init__.py | def field_caps(self, index=None, body=None, params=None):
"""
The field capabilities API allows to retrieve the capabilities of fields among multiple indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html>`_
:arg index: A list of index names, or... | def field_caps(self, index=None, body=None, params=None):
"""
The field capabilities API allows to retrieve the capabilities of fields among multiple indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html>`_
:arg index: A list of index names, or... | [
"The",
"field",
"capabilities",
"API",
"allows",
"to",
"retrieve",
"the",
"capabilities",
"of",
"fields",
"among",
"multiple",
"indices",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"refere... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/__init__.py#L1706-L1727 | [
"def",
"field_caps",
"(",
"self",
",",
"index",
"=",
"None",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"\"_field_caps\... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | MonitoringClient.bulk | `<http://www.elastic.co/guide/en/monitoring/current/appendix-api-bulk.html>`_
:arg body: The operation definition and data (action-data pairs),
separated by newlines
:arg doc_type: Default document type for items which don't provide one
:arg interval: Collection interval (e.g., '10s... | elasticsearch/client/xpack/monitoring.py | def bulk(self, body, doc_type=None, params=None):
"""
`<http://www.elastic.co/guide/en/monitoring/current/appendix-api-bulk.html>`_
:arg body: The operation definition and data (action-data pairs),
separated by newlines
:arg doc_type: Default document type for items which do... | def bulk(self, body, doc_type=None, params=None):
"""
`<http://www.elastic.co/guide/en/monitoring/current/appendix-api-bulk.html>`_
:arg body: The operation definition and data (action-data pairs),
separated by newlines
:arg doc_type: Default document type for items which do... | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"monitoring",
"/",
"current",
"/",
"appendix",
"-",
"api",
"-",
"bulk",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/monitoring.py#L6-L25 | [
"def",
"bulk",
"(",
"self",
",",
"body",
",",
"doc_type",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self",
"... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Transport.add_connection | Create a new :class:`~elasticsearch.Connection` instance and add it to the pool.
:arg host: kwargs that will be used to create the instance | elasticsearch/transport.py | def add_connection(self, host):
"""
Create a new :class:`~elasticsearch.Connection` instance and add it to the pool.
:arg host: kwargs that will be used to create the instance
"""
self.hosts.append(host)
self.set_connections(self.hosts) | def add_connection(self, host):
"""
Create a new :class:`~elasticsearch.Connection` instance and add it to the pool.
:arg host: kwargs that will be used to create the instance
"""
self.hosts.append(host)
self.set_connections(self.hosts) | [
"Create",
"a",
"new",
":",
"class",
":",
"~elasticsearch",
".",
"Connection",
"instance",
"and",
"add",
"it",
"to",
"the",
"pool",
"."
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/transport.py#L124-L131 | [
"def",
"add_connection",
"(",
"self",
",",
"host",
")",
":",
"self",
".",
"hosts",
".",
"append",
"(",
"host",
")",
"self",
".",
"set_connections",
"(",
"self",
".",
"hosts",
")"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Transport.get_connection | Retreive a :class:`~elasticsearch.Connection` instance from the
:class:`~elasticsearch.ConnectionPool` instance. | elasticsearch/transport.py | def get_connection(self):
"""
Retreive a :class:`~elasticsearch.Connection` instance from the
:class:`~elasticsearch.ConnectionPool` instance.
"""
if self.sniffer_timeout:
if time.time() >= self.last_sniff + self.sniffer_timeout:
self.sniff_hosts()
... | def get_connection(self):
"""
Retreive a :class:`~elasticsearch.Connection` instance from the
:class:`~elasticsearch.ConnectionPool` instance.
"""
if self.sniffer_timeout:
if time.time() >= self.last_sniff + self.sniffer_timeout:
self.sniff_hosts()
... | [
"Retreive",
"a",
":",
"class",
":",
"~elasticsearch",
".",
"Connection",
"instance",
"from",
"the",
":",
"class",
":",
"~elasticsearch",
".",
"ConnectionPool",
"instance",
"."
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/transport.py#L164-L172 | [
"def",
"get_connection",
"(",
"self",
")",
":",
"if",
"self",
".",
"sniffer_timeout",
":",
"if",
"time",
".",
"time",
"(",
")",
">=",
"self",
".",
"last_sniff",
"+",
"self",
".",
"sniffer_timeout",
":",
"self",
".",
"sniff_hosts",
"(",
")",
"return",
"... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Transport.sniff_hosts | Obtain a list of nodes from the cluster and create a new connection
pool using the information retrieved.
To extract the node connection parameters use the ``nodes_to_host_callback``.
:arg initial: flag indicating if this is during startup
(``sniff_on_start``), ignore the ``sniff_t... | elasticsearch/transport.py | def sniff_hosts(self, initial=False):
"""
Obtain a list of nodes from the cluster and create a new connection
pool using the information retrieved.
To extract the node connection parameters use the ``nodes_to_host_callback``.
:arg initial: flag indicating if this is during star... | def sniff_hosts(self, initial=False):
"""
Obtain a list of nodes from the cluster and create a new connection
pool using the information retrieved.
To extract the node connection parameters use the ``nodes_to_host_callback``.
:arg initial: flag indicating if this is during star... | [
"Obtain",
"a",
"list",
"of",
"nodes",
"from",
"the",
"cluster",
"and",
"create",
"a",
"new",
"connection",
"pool",
"using",
"the",
"information",
"retrieved",
"."
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/transport.py#L225-L244 | [
"def",
"sniff_hosts",
"(",
"self",
",",
"initial",
"=",
"False",
")",
":",
"node_info",
"=",
"self",
".",
"_get_sniff_data",
"(",
"initial",
")",
"hosts",
"=",
"list",
"(",
"filter",
"(",
"None",
",",
"(",
"self",
".",
"_get_host_info",
"(",
"n",
")",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Transport.mark_dead | Mark a connection as dead (failed) in the connection pool. If sniffing
on failure is enabled this will initiate the sniffing process.
:arg connection: instance of :class:`~elasticsearch.Connection` that failed | elasticsearch/transport.py | def mark_dead(self, connection):
"""
Mark a connection as dead (failed) in the connection pool. If sniffing
on failure is enabled this will initiate the sniffing process.
:arg connection: instance of :class:`~elasticsearch.Connection` that failed
"""
# mark as dead even ... | def mark_dead(self, connection):
"""
Mark a connection as dead (failed) in the connection pool. If sniffing
on failure is enabled this will initiate the sniffing process.
:arg connection: instance of :class:`~elasticsearch.Connection` that failed
"""
# mark as dead even ... | [
"Mark",
"a",
"connection",
"as",
"dead",
"(",
"failed",
")",
"in",
"the",
"connection",
"pool",
".",
"If",
"sniffing",
"on",
"failure",
"is",
"enabled",
"this",
"will",
"initiate",
"the",
"sniffing",
"process",
"."
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/transport.py#L246-L256 | [
"def",
"mark_dead",
"(",
"self",
",",
"connection",
")",
":",
"# mark as dead even when sniffing to avoid hitting this host during the sniff process",
"self",
".",
"connection_pool",
".",
"mark_dead",
"(",
"connection",
")",
"if",
"self",
".",
"sniff_on_connection_fail",
":... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Transport.perform_request | Perform the actual request. Retrieve a connection from the connection
pool, pass all the information to it's perform_request method and
return the data.
If an exception was raised, mark the connection as failed and retry (up
to `max_retries` times).
If the operation was succesf... | elasticsearch/transport.py | def perform_request(self, method, url, headers=None, params=None, body=None):
"""
Perform the actual request. Retrieve a connection from the connection
pool, pass all the information to it's perform_request method and
return the data.
If an exception was raised, mark the connect... | def perform_request(self, method, url, headers=None, params=None, body=None):
"""
Perform the actual request. Retrieve a connection from the connection
pool, pass all the information to it's perform_request method and
return the data.
If an exception was raised, mark the connect... | [
"Perform",
"the",
"actual",
"request",
".",
"Retrieve",
"a",
"connection",
"from",
"the",
"connection",
"pool",
"pass",
"all",
"the",
"information",
"to",
"it",
"s",
"perform_request",
"method",
"and",
"return",
"the",
"data",
"."
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/transport.py#L258-L350 | [
"def",
"perform_request",
"(",
"self",
",",
"method",
",",
"url",
",",
"headers",
"=",
"None",
",",
"params",
"=",
"None",
",",
"body",
"=",
"None",
")",
":",
"if",
"body",
"is",
"not",
"None",
":",
"body",
"=",
"self",
".",
"serializer",
".",
"dum... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SecurityClient.change_password | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html>`_
:arg body: the new password for the user
:arg username: The username of the user to change the password for
:arg refresh: If `true` (the default) then refresh the affected shards
t... | elasticsearch/client/xpack/security.py | def change_password(self, body, username=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html>`_
:arg body: the new password for the user
:arg username: The username of the user to change the password for
:ar... | def change_password(self, body, username=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html>`_
:arg body: the new password for the user
:arg username: The username of the user to change the password for
:ar... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"security",
"-",
"api",
"-",
"change",
"-",
"password",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/security.py#L15-L34 | [
"def",
"change_password",
"(",
"self",
",",
"body",
",",
"username",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SecurityClient.clear_cached_realms | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html>`_
:arg realms: Comma-separated list of realms to clear
:arg usernames: Comma-separated list of usernames to clear from the
cache | elasticsearch/client/xpack/security.py | def clear_cached_realms(self, realms, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html>`_
:arg realms: Comma-separated list of realms to clear
:arg usernames: Comma-separated list of usernames to clear from the
... | def clear_cached_realms(self, realms, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html>`_
:arg realms: Comma-separated list of realms to clear
:arg usernames: Comma-separated list of usernames to clear from the
... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"security",
"-",
"api",
"-",
"clear",
"-",
"cache",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/security.py#L37-L51 | [
"def",
"clear_cached_realms",
"(",
"self",
",",
"realms",
",",
"params",
"=",
"None",
")",
":",
"if",
"realms",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'realms'.\"",
")",
"return",
"self",
".",
"transport"... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SecurityClient.clear_cached_roles | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html>`_
:arg name: Role name | elasticsearch/client/xpack/security.py | def clear_cached_roles(self, name, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html>`_
:arg name: Role name
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument... | def clear_cached_roles(self, name, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html>`_
:arg name: Role name
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"security",
"-",
"api",
"-",
"clear",
"-",
"role",
"-",
"cache",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/security.py#L54-L64 | [
"def",
"clear_cached_roles",
"(",
"self",
",",
"name",
",",
"params",
"=",
"None",
")",
":",
"if",
"name",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'name'.\"",
")",
"return",
"self",
".",
"transport",
"."... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SecurityClient.create_api_key | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html>`_
:arg body: The api key request to create an API key
:arg refresh: If `true` (the default) then refresh the affected shards
to make this operation visible to search, if `wait_for` then wait
... | elasticsearch/client/xpack/security.py | def create_api_key(self, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html>`_
:arg body: The api key request to create an API key
:arg refresh: If `true` (the default) then refresh the affected shards
t... | def create_api_key(self, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html>`_
:arg body: The api key request to create an API key
:arg refresh: If `true` (the default) then refresh the affected shards
t... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"security",
"-",
"api",
"-",
"create",
"-",
"api",
"-",
"key",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/security.py#L67-L82 | [
"def",
"create_api_key",
"(",
"self",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self",
".",
"transport",
".",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SecurityClient.delete_privileges | `<TODO>`_
:arg application: Application name
:arg name: Privilege name
:arg refresh: If `true` (the default) then refresh the affected shards
to make this operation visible to search, if `wait_for` then wait
for a refresh to make this operation visible to search, if `fal... | elasticsearch/client/xpack/security.py | def delete_privileges(self, application, name, params=None):
"""
`<TODO>`_
:arg application: Application name
:arg name: Privilege name
:arg refresh: If `true` (the default) then refresh the affected shards
to make this operation visible to search, if `wait_for` then... | def delete_privileges(self, application, name, params=None):
"""
`<TODO>`_
:arg application: Application name
:arg name: Privilege name
:arg refresh: If `true` (the default) then refresh the affected shards
to make this operation visible to search, if `wait_for` then... | [
"<TODO",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/security.py#L85-L104 | [
"def",
"delete_privileges",
"(",
"self",
",",
"application",
",",
"name",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"application",
",",
"name",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empt... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SecurityClient.delete_user | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html>`_
:arg username: username
:arg refresh: If `true` (the default) then refresh the affected shards
to make this operation visible to search, if `wait_for` then wait
for a refresh to ma... | elasticsearch/client/xpack/security.py | def delete_user(self, username, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html>`_
:arg username: username
:arg refresh: If `true` (the default) then refresh the affected shards
to make this operation visible ... | def delete_user(self, username, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html>`_
:arg username: username
:arg refresh: If `true` (the default) then refresh the affected shards
to make this operation visible ... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"security",
"-",
"api",
"-",
"delete",
"-",
"user",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/security.py#L143-L158 | [
"def",
"delete_user",
"(",
"self",
",",
"username",
",",
"params",
"=",
"None",
")",
":",
"if",
"username",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'username'.\"",
")",
"return",
"self",
".",
"transport",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SecurityClient.get_privileges | `<TODO>`_
:arg application: Application name
:arg name: Privilege name | elasticsearch/client/xpack/security.py | def get_privileges(self, application=None, name=None, params=None):
"""
`<TODO>`_
:arg application: Application name
:arg name: Privilege name
"""
return self.transport.perform_request(
"GET",
_make_path("_security", "privilege", application, name... | def get_privileges(self, application=None, name=None, params=None):
"""
`<TODO>`_
:arg application: Application name
:arg name: Privilege name
"""
return self.transport.perform_request(
"GET",
_make_path("_security", "privilege", application, name... | [
"<TODO",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/security.py#L213-L224 | [
"def",
"get_privileges",
"(",
"self",
",",
"application",
"=",
"None",
",",
"name",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_security\"",
",",... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SecurityClient.get_role | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html>`_
:arg name: Role name | elasticsearch/client/xpack/security.py | def get_role(self, name=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html>`_
:arg name: Role name
"""
return self.transport.perform_request(
"GET", _make_path("_security", "role", name), params=params... | def get_role(self, name=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html>`_
:arg name: Role name
"""
return self.transport.perform_request(
"GET", _make_path("_security", "role", name), params=params... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"security",
"-",
"api",
"-",
"get",
"-",
"role",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/security.py#L227-L235 | [
"def",
"get_role",
"(",
"self",
",",
"name",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_security\"",
",",
"\"role\"",
",",
"name",
")",
",",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SecurityClient.get_role_mapping | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html>`_
:arg name: Role-Mapping name | elasticsearch/client/xpack/security.py | def get_role_mapping(self, name=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html>`_
:arg name: Role-Mapping name
"""
return self.transport.perform_request(
"GET", _make_path("_security", "rol... | def get_role_mapping(self, name=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html>`_
:arg name: Role-Mapping name
"""
return self.transport.perform_request(
"GET", _make_path("_security", "rol... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"security",
"-",
"api",
"-",
"get",
"-",
"role",
"-",
"mapping",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/security.py#L238-L246 | [
"def",
"get_role_mapping",
"(",
"self",
",",
"name",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_security\"",
",",
"\"role_mapping\"",
",",
"name",... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SecurityClient.get_token | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html>`_
:arg body: The token request to get | elasticsearch/client/xpack/security.py | def get_token(self, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html>`_
:arg body: The token request to get
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument ... | def get_token(self, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html>`_
:arg body: The token request to get
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument ... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"security",
"-",
"api",
"-",
"get",
"-",
"token",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/security.py#L249-L259 | [
"def",
"get_token",
"(",
"self",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perf... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SecurityClient.get_user | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html>`_
:arg username: A comma-separated list of usernames | elasticsearch/client/xpack/security.py | def get_user(self, username=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html>`_
:arg username: A comma-separated list of usernames
"""
return self.transport.perform_request(
"GET", _make_path("_secur... | def get_user(self, username=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html>`_
:arg username: A comma-separated list of usernames
"""
return self.transport.perform_request(
"GET", _make_path("_secur... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"security",
"-",
"api",
"-",
"get",
"-",
"user",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/security.py#L262-L270 | [
"def",
"get_user",
"(",
"self",
",",
"username",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_security\"",
",",
"\"user\"",
",",
"username",
")",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SecurityClient.has_privileges | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html>`_
:arg body: The privileges to test
:arg user: Username | elasticsearch/client/xpack/security.py | def has_privileges(self, body, user=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html>`_
:arg body: The privileges to test
:arg user: Username
"""
if body in SKIP_IN_PATH:
raise ValueErr... | def has_privileges(self, body, user=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html>`_
:arg body: The privileges to test
:arg user: Username
"""
if body in SKIP_IN_PATH:
raise ValueErr... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"security",
"-",
"api",
"-",
"has",
"-",
"privileges",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/security.py#L282-L296 | [
"def",
"has_privileges",
"(",
"self",
",",
"body",
",",
"user",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SecurityClient.invalidate_api_key | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html>`_
:arg body: The api key request to invalidate API key(s) | elasticsearch/client/xpack/security.py | def invalidate_api_key(self, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html>`_
:arg body: The api key request to invalidate API key(s)
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty... | def invalidate_api_key(self, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html>`_
:arg body: The api key request to invalidate API key(s)
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"security",
"-",
"api",
"-",
"invalidate",
"-",
"api",
"-",
"key",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/security.py#L299-L309 | [
"def",
"invalidate_api_key",
"(",
"self",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self",
".",
"transport",
"."... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SecurityClient.invalidate_token | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html>`_
:arg body: The token to invalidate | elasticsearch/client/xpack/security.py | def invalidate_token(self, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html>`_
:arg body: The token to invalidate
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a requi... | def invalidate_token(self, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html>`_
:arg body: The token to invalidate
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a requi... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"security",
"-",
"api",
"-",
"invalidate",
"-",
"token",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/security.py#L312-L322 | [
"def",
"invalidate_token",
"(",
"self",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self",
".",
"transport",
".",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SecurityClient.put_privileges | `<TODO>`_
:arg body: The privilege(s) to add
:arg refresh: If `true` (the default) then refresh the affected shards
to make this operation visible to search, if `wait_for` then wait
for a refresh to make this operation visible to search, if `false`
then do nothing wi... | elasticsearch/client/xpack/security.py | def put_privileges(self, body, params=None):
"""
`<TODO>`_
:arg body: The privilege(s) to add
:arg refresh: If `true` (the default) then refresh the affected shards
to make this operation visible to search, if `wait_for` then wait
for a refresh to make this opera... | def put_privileges(self, body, params=None):
"""
`<TODO>`_
:arg body: The privilege(s) to add
:arg refresh: If `true` (the default) then refresh the affected shards
to make this operation visible to search, if `wait_for` then wait
for a refresh to make this opera... | [
"<TODO",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/security.py#L325-L340 | [
"def",
"put_privileges",
"(",
"self",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self",
".",
"transport",
".",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | SecurityClient.put_user | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html>`_
:arg username: The username of the User
:arg body: The user to add
:arg refresh: If `true` (the default) then refresh the affected shards
to make this operation visible to search, if `wai... | elasticsearch/client/xpack/security.py | def put_user(self, username, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html>`_
:arg username: The username of the User
:arg body: The user to add
:arg refresh: If `true` (the default) then refresh the affected... | def put_user(self, username, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html>`_
:arg username: The username of the User
:arg body: The user to add
:arg refresh: If `true` (the default) then refresh the affected... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"security",
"-",
"api",
"-",
"put",
"-",
"user",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/security.py#L386-L403 | [
"def",
"put_user",
"(",
"self",
",",
"username",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"username",
",",
"body",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed ... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | IlmClient.delete_lifecycle | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html>`_
:arg policy: The name of the index lifecycle policy | elasticsearch/client/xpack/ilm.py | def delete_lifecycle(self, policy=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html>`_
:arg policy: The name of the index lifecycle policy
"""
return self.transport.perform_request(
"DELETE", _make_pat... | def delete_lifecycle(self, policy=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html>`_
:arg policy: The name of the index lifecycle policy
"""
return self.transport.perform_request(
"DELETE", _make_pat... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ilm",
"-",
"delete",
"-",
"lifecycle",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ilm.py#L6-L14 | [
"def",
"delete_lifecycle",
"(",
"self",
",",
"policy",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"DELETE\"",
",",
"_make_path",
"(",
"\"_ilm\"",
",",
"\"policy\"",
",",
"policy",
"... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | IlmClient.explain_lifecycle | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html>`_
:arg index: The name of the index to explain | elasticsearch/client/xpack/ilm.py | def explain_lifecycle(self, index=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html>`_
:arg index: The name of the index to explain
"""
return self.transport.perform_request(
"GET", _make_path(index, ... | def explain_lifecycle(self, index=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html>`_
:arg index: The name of the index to explain
"""
return self.transport.perform_request(
"GET", _make_path(index, ... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ilm",
"-",
"explain",
"-",
"lifecycle",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ilm.py#L17-L25 | [
"def",
"explain_lifecycle",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"\"_ilm\"",
",",
"\"explain\"",
")",... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | IlmClient.get_lifecycle | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html>`_
:arg policy: The name of the index lifecycle policy | elasticsearch/client/xpack/ilm.py | def get_lifecycle(self, policy=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html>`_
:arg policy: The name of the index lifecycle policy
"""
return self.transport.perform_request(
"GET", _make_path("_ilm",... | def get_lifecycle(self, policy=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html>`_
:arg policy: The name of the index lifecycle policy
"""
return self.transport.perform_request(
"GET", _make_path("_ilm",... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ilm",
"-",
"get",
"-",
"lifecycle",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ilm.py#L28-L36 | [
"def",
"get_lifecycle",
"(",
"self",
",",
"policy",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_ilm\"",
",",
"\"policy\"",
",",
"policy",
")",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | IlmClient.move_to_step | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html>`_
:arg index: The name of the index whose lifecycle step is to change
:arg body: The new lifecycle step to move to | elasticsearch/client/xpack/ilm.py | def move_to_step(self, index=None, body=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html>`_
:arg index: The name of the index whose lifecycle step is to change
:arg body: The new lifecycle step to move to
"""
... | def move_to_step(self, index=None, body=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html>`_
:arg index: The name of the index whose lifecycle step is to change
:arg body: The new lifecycle step to move to
"""
... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ilm",
"-",
"move",
"-",
"to",
"-",
"step",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ilm.py#L46-L55 | [
"def",
"move_to_step",
"(",
"self",
",",
"index",
"=",
"None",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"\"_ilm\"",
",",
"\"move\"... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | IlmClient.put_lifecycle | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html>`_
:arg policy: The name of the index lifecycle policy
:arg body: The lifecycle policy definition to register | elasticsearch/client/xpack/ilm.py | def put_lifecycle(self, policy=None, body=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html>`_
:arg policy: The name of the index lifecycle policy
:arg body: The lifecycle policy definition to register
"""
re... | def put_lifecycle(self, policy=None, body=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html>`_
:arg policy: The name of the index lifecycle policy
:arg body: The lifecycle policy definition to register
"""
re... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ilm",
"-",
"put",
"-",
"lifecycle",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ilm.py#L58-L67 | [
"def",
"put_lifecycle",
"(",
"self",
",",
"policy",
"=",
"None",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"PUT\"",
",",
"_make_path",
"(",
"\"_ilm\"",
",",
"\"polic... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | IlmClient.remove_policy | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html>`_
:arg index: The name of the index to remove policy on | elasticsearch/client/xpack/ilm.py | def remove_policy(self, index=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html>`_
:arg index: The name of the index to remove policy on
"""
return self.transport.perform_request(
"POST", _make_path(index... | def remove_policy(self, index=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html>`_
:arg index: The name of the index to remove policy on
"""
return self.transport.perform_request(
"POST", _make_path(index... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ilm",
"-",
"remove",
"-",
"policy",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ilm.py#L70-L78 | [
"def",
"remove_policy",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"index",
",",
"\"_ilm\"",
",",
"\"remove\"",
")",
"... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | IlmClient.retry | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html>`_
:arg index: The name of the indices (comma-separated) whose failed
lifecycle step is to be retry | elasticsearch/client/xpack/ilm.py | def retry(self, index=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html>`_
:arg index: The name of the indices (comma-separated) whose failed
lifecycle step is to be retry
"""
return self.transport.perform... | def retry(self, index=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html>`_
:arg index: The name of the indices (comma-separated) whose failed
lifecycle step is to be retry
"""
return self.transport.perform... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ilm",
"-",
"retry",
"-",
"policy",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ilm.py#L81-L90 | [
"def",
"retry",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"index",
",",
"\"_ilm\"",
",",
"\"retry\"",
")",
",",
"pa... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | LicenseClient.post | `<https://www.elastic.co/guide/en/x-pack/current/license-management.html>`_
:arg body: licenses to be installed
:arg acknowledge: whether the user has acknowledged acknowledge messages
(default: false) | elasticsearch/client/xpack/license.py | def post(self, body=None, params=None):
"""
`<https://www.elastic.co/guide/en/x-pack/current/license-management.html>`_
:arg body: licenses to be installed
:arg acknowledge: whether the user has acknowledged acknowledge messages
(default: false)
"""
return se... | def post(self, body=None, params=None):
"""
`<https://www.elastic.co/guide/en/x-pack/current/license-management.html>`_
:arg body: licenses to be installed
:arg acknowledge: whether the user has acknowledged acknowledge messages
(default: false)
"""
return se... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"x",
"-",
"pack",
"/",
"current",
"/",
"license",
"-",
"management",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/license.py#L41-L51 | [
"def",
"post",
"(",
"self",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"PUT\"",
",",
"\"/_license\"",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | parse_commits | Go through the git repository log and generate a document per commit
containing all the metadata. | example/load.py | def parse_commits(head, name):
"""
Go through the git repository log and generate a document per commit
containing all the metadata.
"""
for commit in head.traverse():
yield {
'_id': commit.hexsha,
'repository': name,
'committed_date': datetime.fromtimesta... | def parse_commits(head, name):
"""
Go through the git repository log and generate a document per commit
containing all the metadata.
"""
for commit in head.traverse():
yield {
'_id': commit.hexsha,
'repository': name,
'committed_date': datetime.fromtimesta... | [
"Go",
"through",
"the",
"git",
"repository",
"log",
"and",
"generate",
"a",
"document",
"per",
"commit",
"containing",
"all",
"the",
"metadata",
"."
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/example/load.py#L76-L100 | [
"def",
"parse_commits",
"(",
"head",
",",
"name",
")",
":",
"for",
"commit",
"in",
"head",
".",
"traverse",
"(",
")",
":",
"yield",
"{",
"'_id'",
":",
"commit",
".",
"hexsha",
",",
"'repository'",
":",
"name",
",",
"'committed_date'",
":",
"datetime",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | load_repo | Parse a git repository with all it's commits and load it into elasticsearch
using `client`. If the index doesn't exist it will be created. | example/load.py | def load_repo(client, path=None, index='git'):
"""
Parse a git repository with all it's commits and load it into elasticsearch
using `client`. If the index doesn't exist it will be created.
"""
path = dirname(dirname(abspath(__file__))) if path is None else path
repo_name = basename(path)
re... | def load_repo(client, path=None, index='git'):
"""
Parse a git repository with all it's commits and load it into elasticsearch
using `client`. If the index doesn't exist it will be created.
"""
path = dirname(dirname(abspath(__file__))) if path is None else path
repo_name = basename(path)
re... | [
"Parse",
"a",
"git",
"repository",
"with",
"all",
"it",
"s",
"commits",
"and",
"load",
"it",
"into",
"elasticsearch",
"using",
"client",
".",
"If",
"the",
"index",
"doesn",
"t",
"exist",
"it",
"will",
"be",
"created",
"."
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/example/load.py#L102-L130 | [
"def",
"load_repo",
"(",
"client",
",",
"path",
"=",
"None",
",",
"index",
"=",
"'git'",
")",
":",
"path",
"=",
"dirname",
"(",
"dirname",
"(",
"abspath",
"(",
"__file__",
")",
")",
")",
"if",
"path",
"is",
"None",
"else",
"path",
"repo_name",
"=",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | RollupClient.get_jobs | `<>`_
:arg id: The ID of the job(s) to fetch. Accepts glob patterns, or left
blank for all jobs | elasticsearch/client/xpack/rollup.py | 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
"""
return self.transport.perform_request(
"GET", _make_path("_rollup", "job", id), params=params
) | 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
"""
return self.transport.perform_request(
"GET", _make_path("_rollup", "job", id), params=params
) | [
"<",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/rollup.py#L19-L28 | [
"def",
"get_jobs",
"(",
"self",
",",
"id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_rollup\"",
",",
"\"job\"",
",",
"id",
")",
",",
"param... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | RollupClient.get_rollup_caps | `<>`_
:arg id: The ID of the index to check rollup capabilities on, or left
blank for all jobs | elasticsearch/client/xpack/rollup.py | 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
"""
return self.transport.perform_request(
"GET", _make_path("_rollup", "data", id), params=params
... | 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
"""
return self.transport.perform_request(
"GET", _make_path("_rollup", "data", id), params=params
... | [
"<",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/rollup.py#L31-L40 | [
"def",
"get_rollup_caps",
"(",
"self",
",",
"id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_rollup\"",
",",
"\"data\"",
",",
"id",
")",
",",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | RollupClient.put_job | `<>`_
:arg id: The ID of the job to create
:arg body: The job configuration | elasticsearch/client/xpack/rollup.py | def put_job(self, id, body, params=None):
"""
`<>`_
:arg id: The ID of the job to create
:arg body: The job configuration
"""
for param in (id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
... | def put_job(self, id, body, params=None):
"""
`<>`_
:arg id: The ID of the job to create
:arg body: The job configuration
"""
for param in (id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
... | [
"<",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/rollup.py#L57-L69 | [
"def",
"put_job",
"(",
"self",
",",
"id",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"id",
",",
"body",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a require... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | DeprecationClient.info | `<http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html>`_
:arg index: Index pattern | elasticsearch/client/xpack/deprecation.py | def info(self, index=None, params=None):
"""
`<http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html>`_
:arg index: Index pattern
"""
return self.transport.perform_request(
"GET",
_make_path(index, "_xpack", "migration", "depreca... | def info(self, index=None, params=None):
"""
`<http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html>`_
:arg index: Index pattern
"""
return self.transport.perform_request(
"GET",
_make_path(index, "_xpack", "migration", "depreca... | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"migration",
"/",
"current",
"/",
"migration",
"-",
"api",
"-",
"deprecation",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/deprecation.py#L6-L16 | [
"def",
"info",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"\"_xpack\"",
",",
"\"migration\"",
",",
"\"dep... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | NodesClient.info | The cluster nodes info API allows to retrieve one or more (or all) of
the cluster nodes information.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html>`_
:arg node_id: A comma-separated list of node IDs or names to limit the
returned informati... | elasticsearch/client/nodes.py | def info(self, node_id=None, metric=None, params=None):
"""
The cluster nodes info API allows to retrieve one or more (or all) of
the cluster nodes information.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html>`_
:arg node_id: A comma-sep... | def info(self, node_id=None, metric=None, params=None):
"""
The cluster nodes info API allows to retrieve one or more (or all) of
the cluster nodes information.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html>`_
:arg node_id: A comma-sep... | [
"The",
"cluster",
"nodes",
"info",
"API",
"allows",
"to",
"retrieve",
"one",
"or",
"more",
"(",
"or",
"all",
")",
"of",
"the",
"cluster",
"nodes",
"information",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/"... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/nodes.py#L17-L34 | [
"def",
"info",
"(",
"self",
",",
"node_id",
"=",
"None",
",",
"metric",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_nodes\"",
",",
"node_id",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | NodesClient.stats | The cluster nodes stats API allows to retrieve one or more (or all) of
the cluster nodes statistics.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html>`_
:arg node_id: A comma-separated list of node IDs or names to limit the
returned informat... | elasticsearch/client/nodes.py | def stats(self, node_id=None, metric=None, index_metric=None, params=None):
"""
The cluster nodes stats API allows to retrieve one or more (or all) of
the cluster nodes statistics.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html>`_
:arg... | def stats(self, node_id=None, metric=None, index_metric=None, params=None):
"""
The cluster nodes stats API allows to retrieve one or more (or all) of
the cluster nodes statistics.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html>`_
:arg... | [
"The",
"cluster",
"nodes",
"stats",
"API",
"allows",
"to",
"retrieve",
"one",
"or",
"more",
"(",
"or",
"all",
")",
"of",
"the",
"cluster",
"nodes",
"statistics",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/"... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/nodes.py#L46-L82 | [
"def",
"stats",
"(",
"self",
",",
"node_id",
"=",
"None",
",",
"metric",
"=",
"None",
",",
"index_metric",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | NodesClient.hot_threads | An API allowing to get the current hot threads on each node in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-hot-threads.html>`_
:arg node_id: A comma-separated list of node IDs or names to limit the
returned information; use `_local` to return... | elasticsearch/client/nodes.py | def hot_threads(self, node_id=None, params=None):
"""
An API allowing to get the current hot threads on each node in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-hot-threads.html>`_
:arg node_id: A comma-separated list of node IDs or names... | def hot_threads(self, node_id=None, params=None):
"""
An API allowing to get the current hot threads on each node in the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-hot-threads.html>`_
:arg node_id: A comma-separated list of node IDs or names... | [
"An",
"API",
"allowing",
"to",
"get",
"the",
"current",
"hot",
"threads",
"on",
"each",
"node",
"in",
"the",
"cluster",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/nodes.py#L87-L112 | [
"def",
"hot_threads",
"(",
"self",
",",
"node_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"# avoid python reserved words",
"if",
"params",
"and",
"\"type_\"",
"in",
"params",
":",
"params",
"[",
"\"type\"",
"]",
"=",
"params",
".",
"pop",
"(",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | NodesClient.usage | The cluster nodes usage API allows to retrieve information on the usage
of features for each node.
`<http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html>`_
:arg node_id: A comma-separated list of node IDs or names to limit the
returned information;... | elasticsearch/client/nodes.py | def usage(self, node_id=None, metric=None, params=None):
"""
The cluster nodes usage API allows to retrieve information on the usage
of features for each node.
`<http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html>`_
:arg node_id: A comma-separ... | def usage(self, node_id=None, metric=None, params=None):
"""
The cluster nodes usage API allows to retrieve information on the usage
of features for each node.
`<http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html>`_
:arg node_id: A comma-separ... | [
"The",
"cluster",
"nodes",
"usage",
"API",
"allows",
"to",
"retrieve",
"information",
"on",
"the",
"usage",
"of",
"features",
"for",
"each",
"node",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/nodes.py#L115-L132 | [
"def",
"usage",
"(",
"self",
",",
"node_id",
"=",
"None",
",",
"metric",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_nodes\"",
",",
"node_id",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | _chunk_actions | Split actions into chunks by number or size, serialize them into strings in
the process. | elasticsearch/helpers/actions.py | def _chunk_actions(actions, chunk_size, max_chunk_bytes, serializer):
"""
Split actions into chunks by number or size, serialize them into strings in
the process.
"""
bulk_actions, bulk_data = [], []
size, action_count = 0, 0
for action, data in actions:
raw_data, raw_action = data, ... | def _chunk_actions(actions, chunk_size, max_chunk_bytes, serializer):
"""
Split actions into chunks by number or size, serialize them into strings in
the process.
"""
bulk_actions, bulk_data = [], []
size, action_count = 0, 0
for action, data in actions:
raw_data, raw_action = data, ... | [
"Split",
"actions",
"into",
"chunks",
"by",
"number",
"or",
"size",
"serialize",
"them",
"into",
"strings",
"in",
"the",
"process",
"."
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/helpers/actions.py#L56-L92 | [
"def",
"_chunk_actions",
"(",
"actions",
",",
"chunk_size",
",",
"max_chunk_bytes",
",",
"serializer",
")",
":",
"bulk_actions",
",",
"bulk_data",
"=",
"[",
"]",
",",
"[",
"]",
"size",
",",
"action_count",
"=",
"0",
",",
"0",
"for",
"action",
",",
"data"... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | _process_bulk_chunk | Send a bulk request to elasticsearch and process the output. | elasticsearch/helpers/actions.py | def _process_bulk_chunk(
client,
bulk_actions,
bulk_data,
raise_on_exception=True,
raise_on_error=True,
*args,
**kwargs
):
"""
Send a bulk request to elasticsearch and process the output.
"""
# if raise on error is set, we need to collect errors per chunk before raising them
... | def _process_bulk_chunk(
client,
bulk_actions,
bulk_data,
raise_on_exception=True,
raise_on_error=True,
*args,
**kwargs
):
"""
Send a bulk request to elasticsearch and process the output.
"""
# if raise on error is set, we need to collect errors per chunk before raising them
... | [
"Send",
"a",
"bulk",
"request",
"to",
"elasticsearch",
"and",
"process",
"the",
"output",
"."
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/helpers/actions.py#L95-L158 | [
"def",
"_process_bulk_chunk",
"(",
"client",
",",
"bulk_actions",
",",
"bulk_data",
",",
"raise_on_exception",
"=",
"True",
",",
"raise_on_error",
"=",
"True",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# if raise on error is set, we need to collect error... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | streaming_bulk | Streaming bulk consumes actions from the iterable passed in and yields
results per action. For non-streaming usecases use
:func:`~elasticsearch.helpers.bulk` which is a wrapper around streaming
bulk that returns summary information about the bulk operation once the
entire input is consumed and sent.
... | elasticsearch/helpers/actions.py | def streaming_bulk(
client,
actions,
chunk_size=500,
max_chunk_bytes=100 * 1024 * 1024,
raise_on_error=True,
expand_action_callback=expand_action,
raise_on_exception=True,
max_retries=0,
initial_backoff=2,
max_backoff=600,
yield_ok=True,
*args,
**kwargs
):
"""
... | def streaming_bulk(
client,
actions,
chunk_size=500,
max_chunk_bytes=100 * 1024 * 1024,
raise_on_error=True,
expand_action_callback=expand_action,
raise_on_exception=True,
max_retries=0,
initial_backoff=2,
max_backoff=600,
yield_ok=True,
*args,
**kwargs
):
"""
... | [
"Streaming",
"bulk",
"consumes",
"actions",
"from",
"the",
"iterable",
"passed",
"in",
"and",
"yields",
"results",
"per",
"action",
".",
"For",
"non",
"-",
"streaming",
"usecases",
"use",
":",
"func",
":",
"~elasticsearch",
".",
"helpers",
".",
"bulk",
"whic... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/helpers/actions.py#L161-L262 | [
"def",
"streaming_bulk",
"(",
"client",
",",
"actions",
",",
"chunk_size",
"=",
"500",
",",
"max_chunk_bytes",
"=",
"100",
"*",
"1024",
"*",
"1024",
",",
"raise_on_error",
"=",
"True",
",",
"expand_action_callback",
"=",
"expand_action",
",",
"raise_on_exception... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | parallel_bulk | Parallel version of the bulk helper run in multiple threads at once.
:arg client: instance of :class:`~elasticsearch.Elasticsearch` to use
:arg actions: iterator containing the actions
:arg thread_count: size of the threadpool to use for the bulk requests
:arg chunk_size: number of docs in one chunk se... | elasticsearch/helpers/actions.py | def parallel_bulk(
client,
actions,
thread_count=4,
chunk_size=500,
max_chunk_bytes=100 * 1024 * 1024,
queue_size=4,
expand_action_callback=expand_action,
*args,
**kwargs
):
"""
Parallel version of the bulk helper run in multiple threads at once.
:arg client: instance of... | def parallel_bulk(
client,
actions,
thread_count=4,
chunk_size=500,
max_chunk_bytes=100 * 1024 * 1024,
queue_size=4,
expand_action_callback=expand_action,
*args,
**kwargs
):
"""
Parallel version of the bulk helper run in multiple threads at once.
:arg client: instance of... | [
"Parallel",
"version",
"of",
"the",
"bulk",
"helper",
"run",
"in",
"multiple",
"threads",
"at",
"once",
"."
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/helpers/actions.py#L312-L373 | [
"def",
"parallel_bulk",
"(",
"client",
",",
"actions",
",",
"thread_count",
"=",
"4",
",",
"chunk_size",
"=",
"500",
",",
"max_chunk_bytes",
"=",
"100",
"*",
"1024",
"*",
"1024",
",",
"queue_size",
"=",
"4",
",",
"expand_action_callback",
"=",
"expand_action... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | scan | Simple abstraction on top of the
:meth:`~elasticsearch.Elasticsearch.scroll` api - a simple iterator that
yields all hits as returned by underlining scroll requests.
By default scan does not return results in any pre-determined order. To
have a standard order in the returned documents (either by score ... | elasticsearch/helpers/actions.py | def scan(
client,
query=None,
scroll="5m",
raise_on_error=True,
preserve_order=False,
size=1000,
request_timeout=None,
clear_scroll=True,
scroll_kwargs=None,
**kwargs
):
"""
Simple abstraction on top of the
:meth:`~elasticsearch.Elasticsearch.scroll` api - a simple it... | def scan(
client,
query=None,
scroll="5m",
raise_on_error=True,
preserve_order=False,
size=1000,
request_timeout=None,
clear_scroll=True,
scroll_kwargs=None,
**kwargs
):
"""
Simple abstraction on top of the
:meth:`~elasticsearch.Elasticsearch.scroll` api - a simple it... | [
"Simple",
"abstraction",
"on",
"top",
"of",
"the",
":",
"meth",
":",
"~elasticsearch",
".",
"Elasticsearch",
".",
"scroll",
"api",
"-",
"a",
"simple",
"iterator",
"that",
"yields",
"all",
"hits",
"as",
"returned",
"by",
"underlining",
"scroll",
"requests",
"... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/helpers/actions.py#L376-L468 | [
"def",
"scan",
"(",
"client",
",",
"query",
"=",
"None",
",",
"scroll",
"=",
"\"5m\"",
",",
"raise_on_error",
"=",
"True",
",",
"preserve_order",
"=",
"False",
",",
"size",
"=",
"1000",
",",
"request_timeout",
"=",
"None",
",",
"clear_scroll",
"=",
"True... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | reindex | Reindex all documents from one index that satisfy a given query
to another, potentially (if `target_client` is specified) on a different cluster.
If you don't specify the query you will reindex all the documents.
Since ``2.3`` a :meth:`~elasticsearch.Elasticsearch.reindex` api is
available as part of e... | elasticsearch/helpers/actions.py | def reindex(
client,
source_index,
target_index,
query=None,
target_client=None,
chunk_size=500,
scroll="5m",
scan_kwargs={},
bulk_kwargs={},
):
"""
Reindex all documents from one index that satisfy a given query
to another, potentially (if `target_client` is specified) ... | def reindex(
client,
source_index,
target_index,
query=None,
target_client=None,
chunk_size=500,
scroll="5m",
scan_kwargs={},
bulk_kwargs={},
):
"""
Reindex all documents from one index that satisfy a given query
to another, potentially (if `target_client` is specified) ... | [
"Reindex",
"all",
"documents",
"from",
"one",
"index",
"that",
"satisfy",
"a",
"given",
"query",
"to",
"another",
"potentially",
"(",
"if",
"target_client",
"is",
"specified",
")",
"on",
"a",
"different",
"cluster",
".",
"If",
"you",
"don",
"t",
"specify",
... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/helpers/actions.py#L471-L530 | [
"def",
"reindex",
"(",
"client",
",",
"source_index",
",",
"target_index",
",",
"query",
"=",
"None",
",",
"target_client",
"=",
"None",
",",
"chunk_size",
"=",
"500",
",",
"scroll",
"=",
"\"5m\"",
",",
"scan_kwargs",
"=",
"{",
"}",
",",
"bulk_kwargs",
"... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Data_FrameClient.get_data_frame_transform | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html>`_
:arg transform_id: The id or comma delimited list of id expressions of
the transforms to get, '_all' or '*' implies get all transforms
:arg from_: skips a number of transform configs, defaults... | elasticsearch/client/xpack/data_frame.py | def get_data_frame_transform(self, transform_id=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html>`_
:arg transform_id: The id or comma delimited list of id expressions of
the transforms to get, '_all' or '*' impl... | def get_data_frame_transform(self, transform_id=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html>`_
:arg transform_id: The id or comma delimited list of id expressions of
the transforms to get, '_all' or '*' impl... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"get",
"-",
"data",
"-",
"frame",
"-",
"transform",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/data_frame.py#L23-L34 | [
"def",
"get_data_frame_transform",
"(",
"self",
",",
"transform_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_data_frame\"",
",",
"\"transforms\"",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Data_FrameClient.get_data_frame_transform_stats | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html>`_
:arg transform_id: The id of the transform for which to get stats.
'_all' or '*' implies all transforms | elasticsearch/client/xpack/data_frame.py | def get_data_frame_transform_stats(self, transform_id=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html>`_
:arg transform_id: The id of the transform for which to get stats.
'_all' or '*' implies all transfo... | def get_data_frame_transform_stats(self, transform_id=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html>`_
:arg transform_id: The id of the transform for which to get stats.
'_all' or '*' implies all transfo... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"get",
"-",
"data",
"-",
"frame",
"-",
"transform",
"-",
"stats",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/data_frame.py#L37-L48 | [
"def",
"get_data_frame_transform_stats",
"(",
"self",
",",
"transform_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_data_frame\"",
",",
"\"transform... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Data_FrameClient.preview_data_frame_transform | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html>`_
:arg body: The definition for the data_frame transform to preview | elasticsearch/client/xpack/data_frame.py | def preview_data_frame_transform(self, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html>`_
:arg body: The definition for the data_frame transform to preview
"""
if body in SKIP_IN_PATH:
raise ... | def preview_data_frame_transform(self, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html>`_
:arg body: The definition for the data_frame transform to preview
"""
if body in SKIP_IN_PATH:
raise ... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"preview",
"-",
"data",
"-",
"frame",
"-",
"transform",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/data_frame.py#L51-L61 | [
"def",
"preview_data_frame_transform",
"(",
"self",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self",
".",
"transpo... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Data_FrameClient.put_data_frame_transform | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html>`_
:arg transform_id: The id of the new transform.
:arg body: The data frame transform definition | elasticsearch/client/xpack/data_frame.py | def put_data_frame_transform(self, transform_id, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html>`_
:arg transform_id: The id of the new transform.
:arg body: The data frame transform definition
"""
... | def put_data_frame_transform(self, transform_id, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html>`_
:arg transform_id: The id of the new transform.
:arg body: The data frame transform definition
"""
... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"put",
"-",
"data",
"-",
"frame",
"-",
"transform",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/data_frame.py#L64-L79 | [
"def",
"put_data_frame_transform",
"(",
"self",
",",
"transform_id",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"transform_id",
",",
"body",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | Data_FrameClient.stop_data_frame_transform | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html>`_
:arg transform_id: The id of the transform to stop
:arg timeout: Controls the time to wait until the transform has stopped.
Default to 30 seconds
:arg wait_for_completion: Whether to ... | elasticsearch/client/xpack/data_frame.py | def stop_data_frame_transform(self, transform_id, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html>`_
:arg transform_id: The id of the transform to stop
:arg timeout: Controls the time to wait until the transform has stop... | def stop_data_frame_transform(self, transform_id, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html>`_
:arg transform_id: The id of the transform to stop
:arg timeout: Controls the time to wait until the transform has stop... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"stop",
"-",
"data",
"-",
"frame",
"-",
"transform",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/data_frame.py#L100-L118 | [
"def",
"stop_data_frame_transform",
"(",
"self",
",",
"transform_id",
",",
"params",
"=",
"None",
")",
":",
"if",
"transform_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'transform_id'.\"",
")",
"return",
"sel... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | CatClient.allocation | Allocation provides a snapshot of how shards have located around the
cluster and the state of disk usage.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html>`_
:arg node_id: A comma-separated list of node IDs or names to limit the
returned informat... | elasticsearch/client/cat.py | def allocation(self, node_id=None, params=None):
"""
Allocation provides a snapshot of how shards have located around the
cluster and the state of disk usage.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html>`_
:arg node_id: A comma-separated... | def allocation(self, node_id=None, params=None):
"""
Allocation provides a snapshot of how shards have located around the
cluster and the state of disk usage.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html>`_
:arg node_id: A comma-separated... | [
"Allocation",
"provides",
"a",
"snapshot",
"of",
"how",
"shards",
"have",
"located",
"around",
"the",
"cluster",
"and",
"the",
"state",
"of",
"disk",
"usage",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"el... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L27-L49 | [
"def",
"allocation",
"(",
"self",
",",
"node_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'allocation'",
",",
"node_id",
")",
","... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | CatClient.count | Count provides quick access to the document count of the entire cluster,
or individual indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg format... | elasticsearch/client/cat.py | def count(self, index=None, params=None):
"""
Count provides quick access to the document count of the entire cluster,
or individual indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html>`_
:arg index: A comma-separated list of index names to ... | def count(self, index=None, params=None):
"""
Count provides quick access to the document count of the entire cluster,
or individual indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html>`_
:arg index: A comma-separated list of index names to ... | [
"Count",
"provides",
"quick",
"access",
"to",
"the",
"document",
"count",
"of",
"the",
"entire",
"cluster",
"or",
"individual",
"indices",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"re... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L52-L72 | [
"def",
"count",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'count'",
",",
"index",
")",
",",
"params",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | CatClient.indices | The indices command provides a cross-section of each index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg bytes: The unit in which to display byte values,... | elasticsearch/client/cat.py | def indices(self, index=None, params=None):
"""
The indices command provides a cross-section of each index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html>`_
:arg index: A comma-separated list of index names to limit the returned
informati... | def indices(self, index=None, params=None):
"""
The indices command provides a cross-section of each index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html>`_
:arg index: A comma-separated list of index names to limit the returned
informati... | [
"The",
"indices",
"command",
"provides",
"a",
"cross",
"-",
"section",
"of",
"each",
"index",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cat",
"-",
... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L111-L137 | [
"def",
"indices",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'indices'",
",",
"index",
")",
",",
"param... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | CatClient.recovery | recovery is a view of shard replication.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-recovery.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg bytes: The unit in which to display byte values, valid choices are... | elasticsearch/client/cat.py | def recovery(self, index=None, params=None):
"""
recovery is a view of shard replication.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-recovery.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg b... | def recovery(self, index=None, params=None):
"""
recovery is a view of shard replication.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-recovery.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg b... | [
"recovery",
"is",
"a",
"view",
"of",
"shard",
"replication",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cat",
"-",
"recovery",
".",
"html",
">",
"... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L183-L202 | [
"def",
"recovery",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'recovery'",
",",
"index",
")",
",",
"par... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | CatClient.shards | The shards command is the detailed view of what nodes contain which shards.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg bytes: The unit in which to displ... | elasticsearch/client/cat.py | def shards(self, index=None, params=None):
"""
The shards command is the detailed view of what nodes contain which shards.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html>`_
:arg index: A comma-separated list of index names to limit the returned
... | def shards(self, index=None, params=None):
"""
The shards command is the detailed view of what nodes contain which shards.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html>`_
:arg index: A comma-separated list of index names to limit the returned
... | [
"The",
"shards",
"command",
"is",
"the",
"detailed",
"view",
"of",
"what",
"nodes",
"contain",
"which",
"shards",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L205-L226 | [
"def",
"shards",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'shards'",
",",
"index",
")",
",",
"params"... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | CatClient.segments | The segments command is the detailed view of Lucene segments per index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-segments.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg bytes: The unit in which to display... | elasticsearch/client/cat.py | def segments(self, index=None, params=None):
"""
The segments command is the detailed view of Lucene segments per index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-segments.html>`_
:arg index: A comma-separated list of index names to limit the returned
... | def segments(self, index=None, params=None):
"""
The segments command is the detailed view of Lucene segments per index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-segments.html>`_
:arg index: A comma-separated list of index names to limit the returned
... | [
"The",
"segments",
"command",
"is",
"the",
"detailed",
"view",
"of",
"Lucene",
"segments",
"per",
"index",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L229-L246 | [
"def",
"segments",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'segments'",
",",
"index",
")",
",",
"par... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | CatClient.thread_pool | Get information about thread pools.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html>`_
:arg thread_pool_patterns: A comma-separated list of regular-expressions
to filter the thread pools in the output
:arg format: a short version of the Accept ... | elasticsearch/client/cat.py | def thread_pool(self, thread_pool_patterns=None, params=None):
"""
Get information about thread pools.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html>`_
:arg thread_pool_patterns: A comma-separated list of regular-expressions
to filter... | def thread_pool(self, thread_pool_patterns=None, params=None):
"""
Get information about thread pools.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html>`_
:arg thread_pool_patterns: A comma-separated list of regular-expressions
to filter... | [
"Get",
"information",
"about",
"thread",
"pools",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cat",
"-",
"thread",
"-",
"pool",
".",
"html",
">",
"... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L272-L293 | [
"def",
"thread_pool",
"(",
"self",
",",
"thread_pool_patterns",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'thread_pool'",
",",
"thread_... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | CatClient.fielddata | Shows information about currently loaded fielddata on a per-node basis.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html>`_
:arg fields: A comma-separated list of fields to return the fielddata
size
:arg bytes: The unit in which to display byte va... | elasticsearch/client/cat.py | def fielddata(self, fields=None, params=None):
"""
Shows information about currently loaded fielddata on a per-node basis.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html>`_
:arg fields: A comma-separated list of fields to return the fielddata
... | def fielddata(self, fields=None, params=None):
"""
Shows information about currently loaded fielddata on a per-node basis.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html>`_
:arg fields: A comma-separated list of fields to return the fielddata
... | [
"Shows",
"information",
"about",
"currently",
"loaded",
"fielddata",
"on",
"a",
"per",
"-",
"node",
"basis",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L297-L318 | [
"def",
"fielddata",
"(",
"self",
",",
"fields",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'fielddata'",
",",
"fields",
")",
",",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | CatClient.templates | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-templates.html>`_
:arg name: A pattern that returned template names must match
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Retu... | elasticsearch/client/cat.py | def templates(self, name=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-templates.html>`_
:arg name: A pattern that returned template names must match
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-... | def templates(self, name=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-templates.html>`_
:arg name: A pattern that returned template names must match
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cat",
"-",
"templates",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L432-L449 | [
"def",
"templates",
"(",
"self",
",",
"name",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'templates'",
",",
"name",
")",
",",
"par... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | WatcherClient.ack_watch | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html>`_
:arg watch_id: Watch ID
:arg action_id: A comma-separated list of the action ids to be acked | elasticsearch/client/xpack/watcher.py | def ack_watch(self, watch_id, action_id=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html>`_
:arg watch_id: Watch ID
:arg action_id: A comma-separated list of the action ids to be acked
"""
if watch_id in ... | def ack_watch(self, watch_id, action_id=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html>`_
:arg watch_id: Watch ID
:arg action_id: A comma-separated list of the action ids to be acked
"""
if watch_id in ... | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"watcher",
"-",
"api",
"-",
"ack",
"-",
"watch",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/watcher.py#L6-L19 | [
"def",
"ack_watch",
"(",
"self",
",",
"watch_id",
",",
"action_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"watch_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'watch_id'.\"",
")",
"retu... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | WatcherClient.activate_watch | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html>`_
:arg watch_id: Watch ID | elasticsearch/client/xpack/watcher.py | def activate_watch(self, watch_id, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html>`_
:arg watch_id: Watch ID
"""
if watch_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argu... | def activate_watch(self, watch_id, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html>`_
:arg watch_id: Watch ID
"""
if watch_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argu... | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"watcher",
"-",
"api",
"-",
"activate",
"-",
"watch",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/watcher.py#L22-L32 | [
"def",
"activate_watch",
"(",
"self",
",",
"watch_id",
",",
"params",
"=",
"None",
")",
":",
"if",
"watch_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'watch_id'.\"",
")",
"return",
"self",
".",
"transport... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | WatcherClient.delete_watch | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html>`_
:arg id: Watch ID | elasticsearch/client/xpack/watcher.py | def delete_watch(self, id, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html>`_
:arg id: Watch ID
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'id'.")
re... | def delete_watch(self, id, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html>`_
:arg id: Watch ID
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'id'.")
re... | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"watcher",
"-",
"api",
"-",
"delete",
"-",
"watch",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/watcher.py#L50-L60 | [
"def",
"delete_watch",
"(",
"self",
",",
"id",
",",
"params",
"=",
"None",
")",
":",
"if",
"id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | WatcherClient.execute_watch | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html>`_
:arg id: Watch ID
:arg body: Execution control
:arg debug: indicates whether the watch should execute in debug mode | elasticsearch/client/xpack/watcher.py | def execute_watch(self, id=None, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html>`_
:arg id: Watch ID
:arg body: Execution control
:arg debug: indicates whether the watch should execute in debug mode
... | def execute_watch(self, id=None, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html>`_
:arg id: Watch ID
:arg body: Execution control
:arg debug: indicates whether the watch should execute in debug mode
... | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"watcher",
"-",
"api",
"-",
"execute",
"-",
"watch",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/watcher.py#L63-L76 | [
"def",
"execute_watch",
"(",
"self",
",",
"id",
"=",
"None",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"PUT\"",
",",
"_make_path",
"(",
"\"_watcher\"",
",",
"\"watch... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | WatcherClient.put_watch | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html>`_
:arg id: Watch ID
:arg body: The watch
:arg active: Specify whether the watch is in/active by default
:arg if_primary_term: only update the watch if the last operation that
has cha... | elasticsearch/client/xpack/watcher.py | def put_watch(self, id, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html>`_
:arg id: Watch ID
:arg body: The watch
:arg active: Specify whether the watch is in/active by default
:arg if_primary_term:... | def put_watch(self, id, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html>`_
:arg id: Watch ID
:arg body: The watch
:arg active: Specify whether the watch is in/active by default
:arg if_primary_term:... | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"watcher",
"-",
"api",
"-",
"put",
"-",
"watch",
".",
"html",
">",
"_"
] | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/watcher.py#L92-L109 | [
"def",
"put_watch",
"(",
"self",
",",
"id",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'id'.\"",
")",
"return",
"self",
".",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | ClusterClient.health | Get a very simple status on the health of the cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html>`_
:arg index: Limit the information returned to a specific index
:arg level: Specify the level of detail for returned information,
default 'cl... | elasticsearch/client/cluster.py | def health(self, index=None, params=None):
"""
Get a very simple status on the health of the cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html>`_
:arg index: Limit the information returned to a specific index
:arg level: Specify the le... | def health(self, index=None, params=None):
"""
Get a very simple status on the health of the cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html>`_
:arg index: Limit the information returned to a specific index
:arg level: Specify the le... | [
"Get",
"a",
"very",
"simple",
"status",
"on",
"the",
"health",
"of",
"the",
"cluster",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cluster",
"-",
"h... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cluster.py#L8-L34 | [
"def",
"health",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cluster'",
",",
"'health'",
",",
"index",
")",
",",
"par... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
train | ClusterClient.state | Get a comprehensive state information of the whole cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html>`_
:arg metric: Limit the information returned to the specified metrics
:arg index: A comma-separated list of index names; use `_all` or empty
... | elasticsearch/client/cluster.py | def state(self, metric=None, index=None, params=None):
"""
Get a comprehensive state information of the whole cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html>`_
:arg metric: Limit the information returned to the specified metrics
:arg... | def state(self, metric=None, index=None, params=None):
"""
Get a comprehensive state information of the whole cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html>`_
:arg metric: Limit the information returned to the specified metrics
:arg... | [
"Get",
"a",
"comprehensive",
"state",
"information",
"of",
"the",
"whole",
"cluster",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cluster",
"-",
"state"... | elastic/elasticsearch-py | python | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cluster.py#L53-L77 | [
"def",
"state",
"(",
"self",
",",
"metric",
"=",
"None",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"index",
"and",
"not",
"metric",
":",
"metric",
"=",
"'_all'",
"return",
"self",
".",
"transport",
".",
"perform_request",
... | 2aab285c8f506f3863cbdaba3c90a685c510ba00 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.