Skip to content

[7.8] Add 'accept_enterprise' parameter to xpack.info #1337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .ci/run-elasticsearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,16 @@ fi

echo -e "\033[34;1mINFO:\033[0m Starting container $NODE_NAME \033[0m"

# Pull the container, retry on failures up to 5 times with
# short delays between each attempt. Fixes most transient network errors.
docker_pull_attempts=0
until [ "$docker_pull_attempts" -ge 5 ]
do
docker pull docker.elastic.co/elasticsearch/"$ELASTICSEARCH_VERSION" && break
docker_pull_attempts=$((docker_pull_attempts+1))
sleep 10
done

set -x
docker run \
--name "$NODE_NAME" \
Expand Down
4 changes: 3 additions & 1 deletion elasticsearch/_async/client/xpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ def __getattr__(self, attr_name):
return getattr(self.client, attr_name)

# AUTO-GENERATED-API-DEFINITIONS #
@query_params("categories")
@query_params("accept_enterprise", "categories")
async def info(self, params=None, headers=None):
"""
Retrieves information about the installed X-Pack features.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.8/info-api.html>`_

:arg accept_enterprise: If an enterprise license is installed,
return the type and mode as 'enterprise' (default: false)
:arg categories: Comma-separated list of info categories. Can be
any of: build, license, features
"""
Expand Down
4 changes: 3 additions & 1 deletion elasticsearch/client/xpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ def __getattr__(self, attr_name):
return getattr(self.client, attr_name)

# AUTO-GENERATED-API-DEFINITIONS #
@query_params("categories")
@query_params("accept_enterprise", "categories")
def info(self, params=None, headers=None):
"""
Retrieves information about the installed X-Pack features.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.8/info-api.html>`_

:arg accept_enterprise: If an enterprise license is installed,
return the type and mode as 'enterprise' (default: false)
:arg categories: Comma-separated list of info categories. Can be
any of: build, license, features
"""
Expand Down
2 changes: 1 addition & 1 deletion utils/generate_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def __init__(self, namespace, name, definition):
self.doc_url = definition["documentation"]
else:
# set as attribute so it may be overriden by Module.add
self.description = definition["documentation"].get("description", "")
self.description = definition["documentation"].get("description", "").strip()
self.doc_url = definition["documentation"].get("url", "")

# Filter out bad URL refs like 'TODO'
Expand Down
2 changes: 1 addition & 1 deletion utils/templates/base
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

{% for p, info in api.params %}
{% filter wordwrap(72, wrapstring="\n ") %}
:arg {{ p }}: {{ info.description }} {% if info.options %} Valid choices: {{ info.options|join(", ") }}{% endif %} {% if info.default %} Default: {{ info.default }}{% endif %}
:arg {{ p }}: {{ info.description }}{% if info.options %} Valid choices: {{ info.options|join(", ") }}{% endif %}{% if info.default %} Default: {{ info.default }}{% endif %}
{% endfilter %}

{% endfor %}
Expand Down