diff --git a/.gitignore b/.gitignore index 1fbd7806..f762a205 100644 --- a/.gitignore +++ b/.gitignore @@ -68,9 +68,6 @@ instance/ # Scrapy stuff: .scrapy -# Sphinx documentation -docs/sphinx/_build/ - # PyBuilder .pybuilder/ target/ diff --git a/.readthedocs.yml b/.readthedocs.yml index e09a45ed..a3353d9b 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,6 +1,4 @@ version: 2 -sphinx: - configuration: docs/sphinx/conf.py python: version: 3.7 diff --git a/Changelog.rst b/Changelog.rst deleted file mode 100644 index c19e2bba..00000000 --- a/Changelog.rst +++ /dev/null @@ -1 +0,0 @@ -Release notes have moved to `elastic.co/guide `_. diff --git a/MANIFEST.in b/MANIFEST.in index 48174aef..ce967691 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,9 +6,7 @@ include MANIFEST.in include README.md include setup.py recursive-include elasticsearch* py.typed *.pyi -recursive-include docs/sphinx * -prune docs/sphinx/_build prune test_elasticsearch recursive-exclude * __pycache__ recursive-exclude * *.py[co] diff --git a/docs/guide/configuration.asciidoc b/docs/guide/configuration.asciidoc deleted file mode 100644 index 473ba1e5..00000000 --- a/docs/guide/configuration.asciidoc +++ /dev/null @@ -1,12 +0,0 @@ -[[config]] -== Configuration - -This page contains information about the most important configuration options of -the Python {es} client. - -* <> -* <> - - -include::connection-pool.asciidoc[] -include::connection-selector.asciidoc[] \ No newline at end of file diff --git a/docs/guide/connecting.asciidoc b/docs/guide/connecting.asciidoc deleted file mode 100644 index 2adfcb2a..00000000 --- a/docs/guide/connecting.asciidoc +++ /dev/null @@ -1,68 +0,0 @@ -[[connecting]] -== Connecting - -This page contains the information you need to connect the Client with {es}. - - -[discrete] -[[authentication]] -=== Authentication - -This section contains code snippets to show you how to connect to various {es} -providers. - - -[discrete] -[[auth-ec]] -==== Elastic Cloud - -Cloud ID is an easy way to configure your client to work with your Elastic Cloud -deployment. Combine the `cloud_id` with either `http_auth` or `api_key` to -authenticate with your Elastic Cloud deployment. - -Using `cloud_id` enables TLS verification and HTTP compression by default and -sets the port to 443 unless otherwise overwritten via the port parameter or the -port value encoded within `cloud_id`. Using Cloud ID also disables sniffing. - -[source,py] ----------------------------- -from elasticsearch import Elasticsearch - -es = Elasticsearch( - cloud_id=”cluster-1:dXMa5Fx...” -) ----------------------------- - - -[discrete] -[[auth-http]] -==== HTTP Authentication - -HTTP authentication uses the `http_auth` parameter by passing in a username and -password within a tuple: - -[source,py] ----------------------------- -from elasticsearch import Elasticsearch - -es = Elasticsearch( - http_auth=(“username”, “password”) -) ----------------------------- - - -[discrete] -[[auth-apikey]] -==== ApiKey authentication - -You can configure the client to use {es}'s API Key for connecting to your -cluster. - -[source,py] ----------------------------- -from elasticsearch import Elasticsearch - -es = Elasticsearch( - api_key=(“api_key_id”, “api_key_secret”) -) ----------------------------- diff --git a/docs/guide/connection-pool.asciidoc b/docs/guide/connection-pool.asciidoc deleted file mode 100644 index 9d71217c..00000000 --- a/docs/guide/connection-pool.asciidoc +++ /dev/null @@ -1,18 +0,0 @@ -[[connection-pool]] -=== Connection pool - -Connection pool is a container that holds the `Connection` instances, manages -the selection process (via a `ConnectionSelector`) and dead connections. - -Initially connections are stored in the class as a list and – along with the -connection options – get passed to the `ConnectionSelector` instance for future -reference. - -Upon each request, the `Transport` asks for a `Connection` via the -`get_connection` method. If the connection fails, it is marked as dead (via -`mark_dead`) and put on a timeout. When the timeout is over the connection is -resurrected and returned to the live pool. A connection that has been previously -marked as dead and then succeeds is marked as live (its fail count is deleted). - -For reference information, refer to the -https://elasticsearch-py.readthedocs.io/en/latest/connection.html#connection-pool[full {es} Python documentation]. \ No newline at end of file diff --git a/docs/guide/connection-selector.asciidoc b/docs/guide/connection-selector.asciidoc deleted file mode 100644 index 39d340c2..00000000 --- a/docs/guide/connection-selector.asciidoc +++ /dev/null @@ -1,20 +0,0 @@ -[[connection-selector]] -=== Connection selector - -Connection selector is a simple class used to select a connection from a list of -currently live connection instances. Initially, it is passed a dictionary -containing all the connections options which it can then use during the -selection process. When the _select_ method is called it is given a list of -currently live connections to choose from. - -The options dictionary is passed to `Transport` as the hosts parameter and the -same is used to construct the connection object itself. When the connection was -created based on information retrieved from the cluster via the sniffing -process, it is the dictionary returned by the `host_info_callback`. - -Example of where this might be useful is a zone-aware selector that would only -select connections from its own zones and only fall back to other connections -where there would be none in its zones. - -For reference information, refer to the -https://elasticsearch-py.readthedocs.io/en/latest/connection.html#connection-selector[full {es} Python documentation]. \ No newline at end of file diff --git a/docs/guide/examples.asciidoc b/docs/guide/examples.asciidoc deleted file mode 100644 index 09a5ef39..00000000 --- a/docs/guide/examples.asciidoc +++ /dev/null @@ -1,110 +0,0 @@ -[[examples]] -== Examples - -Below you can find examples of how to use the most frequently called APIs with -the Python client. - -* <> -* <> -* <> -* <> -* <> -* <> - -[discrete] -[[ex-index]] -=== Indexing a document - -To index a document, you need to specify three pieces of information: `index`, -`id`, and a `body`: - -[source,py] ----------------------------- -from datetime import datetime -from elasticsearch import Elasticsearch -es = Elasticsearch() - -doc = { - 'author': 'author_name', - 'text': 'Interesting content...', - 'timestamp': datetime.now(), -} -res = es.index(index="test-index", id=1, body=doc) -print(res['result']) ----------------------------- - - -[discrete] -[[ex-get]] -=== Getting a document - -To get a document, you need to specify its `index` and `id`: - -[source,py] ----------------------------- -res = es.get(index="test-index", id=1) -print(res['_source']) ----------------------------- - - -[discrete] -[[ex-refresh]] -=== Refreshing an index - -You can perform the refresh operation on an index: - -[source,py] ----------------------------- -es.indices.refresh(index="test-index") ----------------------------- - - -[discrete] -[[ex-search]] -=== Searching for a document - -The `search()` method returns results that are matching a query: - -[source,py] ----------------------------- -res = es.search(index="test-index", body={"query": {"match_all": {}}}) -print("Got %d Hits:" % res['hits']['total']['value']) -for hit in res['hits']['hits']: - print("%(timestamp)s %(author)s: %(text)s" % hit["_source"]) ----------------------------- - - -[discrete] -[[ex-update]] -=== Updating a document - -To update a document, you need to specify three pieces of information: `index`, -`id`, and a `body`: - -[source,py] ----------------------------- -from datetime import datetime -from elasticsearch import Elasticsearch -es = Elasticsearch() - -doc = { - 'author': 'author_name', - 'text': 'Interesting modified content...', - 'timestamp': datetime.now(), -} -res = es.update(index="test-index", id=1, body=doc) -print(res['result']) ----------------------------- - - -[discrete] -[[ex-delete]] -=== Deleting a document - -You can delete a document by specifying its `index`, and `id` in the `delete()` -method: - -[source,py] ----------------------------- -es.delete(index="test-index", id=1) ----------------------------- diff --git a/docs/guide/helpers.asciidoc b/docs/guide/helpers.asciidoc deleted file mode 100644 index 4c7b5f40..00000000 --- a/docs/guide/helpers.asciidoc +++ /dev/null @@ -1,94 +0,0 @@ -[[client-helpers]] -== Client helpers - -You can find here a collection of simple helper functions that abstract some -specifics of the raw API. For detailed examples, refer to -https://elasticsearch-py.readthedocs.io/en/stable/helpers.html[this page]. - - -[discrete] -[[bulk-helpers]] -=== Bulk helpers - -There are several helpers for the bulk API since its requirement for specific -formatting and other considerations can make it cumbersome if used directly. - -All bulk helpers accept an instance of `{es}` class and an iterable `action` -(any iterable, can also be a generator, which is ideal in most cases since it -allows you to index large datasets without the need of loading them into -memory). - -The items in the iterable `action` should be the documents we wish to index in -several formats. The most common one is the same as returned by `search()`, for -example: - -[source,yml] ----------------------------- -{ - '_index': 'index-name', - '_type': 'document', - '_id': 42, - '_routing': 5, - 'pipeline': 'my-ingest-pipeline', - '_source': { - "title": "Hello World!", - "body": "..." - } -} ----------------------------- - -Alternatively, if `_source` is not present, it pops all metadata fields from -the doc and use the rest as the document data: - -[source,yml] ----------------------------- -{ - "_id": 42, - "_routing": 5, - "title": "Hello World!", - "body": "..." -} ----------------------------- - -The `bulk()` api accepts `index`, `create`, `delete`, and `update` actions. Use -the `_op_type` field to specify an action (`_op_type` defaults to `index`): - -[source,yml] ----------------------------- -{ - '_op_type': 'delete', - '_index': 'index-name', - '_type': 'document', - '_id': 42, -} -{ - '_op_type': 'update', - '_index': 'index-name', - '_type': 'document', - '_id': 42, - 'doc': {'question': 'The life, universe and everything.'} -} ----------------------------- - - -[discrete] -[[scan]] -=== Scan - -Simple abstraction on top of the `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 or explicit sort -definition) when scrolling, use `preserve_order=True`. This may be an expensive -operation and will negate the performance benefits of using `scan`. - - -[source,py] ----------------------------- -scan(es, - query={"query": {"match": {"title": "python"}}}, - index="orders-*", - doc_type="books" -) ----------------------------- \ No newline at end of file diff --git a/docs/guide/index.asciidoc b/docs/guide/index.asciidoc deleted file mode 100644 index d8bc2da2..00000000 --- a/docs/guide/index.asciidoc +++ /dev/null @@ -1,21 +0,0 @@ -= elasticsearch-py - -:doctype: book - -include::{asciidoc-dir}/../../shared/attributes.asciidoc[] - -include::overview.asciidoc[] - -include::installation.asciidoc[] - -include::connecting.asciidoc[] - -include::configuration.asciidoc[] - -include::integrations.asciidoc[] - -include::examples.asciidoc[] - -include::helpers.asciidoc[] - -include::release-notes.asciidoc[] \ No newline at end of file diff --git a/docs/guide/installation.asciidoc b/docs/guide/installation.asciidoc deleted file mode 100644 index 68444334..00000000 --- a/docs/guide/installation.asciidoc +++ /dev/null @@ -1,20 +0,0 @@ -[[installation]] -== Installation - -The Python client for {es} can be installed with pip: - -[source,sh] -------------------------------------- -$ python -m pip install elasticsearch -------------------------------------- - -If your application uses async/await in Python you can install with the `async` -extra: - -[source,sh] --------------------------------------------- -$ python -m pip install elasticsearch[async] --------------------------------------------- - -Read more about -https://elasticsearch-py.readthedocs.io/en/master/async.html[how to use Asyncio with this project]. \ No newline at end of file diff --git a/docs/guide/integrations.asciidoc b/docs/guide/integrations.asciidoc deleted file mode 100644 index b1df4e81..00000000 --- a/docs/guide/integrations.asciidoc +++ /dev/null @@ -1,27 +0,0 @@ -[[integrations]] -== Integrations - -You can find integration options and information on this page. - - -[discrete] -[[transport]] -=== Transport - -The `Transport` class is a subclass of the -https://elasticsearch-py.readthedocs.io/en/latest/connection.html[Connection Layer API] -that contains all the classes that are responsible for handling the connection -to the {es} cluster. - -The `Transport` class is an encapsulation of the transport-related logic of the -Python client. For the exhaustive list of parameters, refer to the -https://elasticsearch-py.readthedocs.io/en/latest/connection.html#transport[documentation]. - - -[discrete] -[[transport-classes]] -==== Transport classes - -The `Transport` classes can be used to maintain connection with an {es} cluster. -For the reference information of these classes, refer to the -https://elasticsearch-py.readthedocs.io/en/latest/transports.html[documentation]. diff --git a/docs/guide/overview.asciidoc b/docs/guide/overview.asciidoc deleted file mode 100644 index 2ef91ac5..00000000 --- a/docs/guide/overview.asciidoc +++ /dev/null @@ -1,121 +0,0 @@ -[[overview]] -== Overview - -This is the official low-level Python client for {es}. Its goal is to provide -common ground for all {es}-related code in Python. For this reason, the client -is designed to be unopinionated and extendable. Full documentation is available -on https://elasticsearch-py.readthedocs.io[Read the Docs]. - - -[discrete] -=== Compatibility - -Current development happens in the master branch. - -The library is compatible with all Elasticsearch versions since `0.90.x` but you -**have to use a matching major version**: - -For **Elasticsearch 7.0** and later, use the major version 7 (`7.x.y`) of the -library. - -For **Elasticsearch 6.0** and later, use the major version 6 (`6.x.y`) of the -library. - -For **Elasticsearch 5.0** and later, use the major version 5 (`5.x.y`) of the -library. - -For **Elasticsearch 2.0** and later, use the major version 2 (`2.x.y`) of the -library, and so on. - -The recommended way to set your requirements in your `setup.py` or -`requirements.txt` is:: - - # Elasticsearch 7.x - elasticsearch>=7,<8 - - # Elasticsearch 6.x - elasticsearch>=6,<7 - - # Elasticsearch 5.x - elasticsearch>=5,<6 - - # Elasticsearch 2.x - elasticsearch>=2,<3 - -If you have a need to have multiple versions installed at the same time older -versions are also released as `elasticsearch2` and `elasticsearch5`. - - -[discrete] -=== Example use - -Simple use-case: - -[source,python] ------------------------------------- ->>> from datetime import datetime ->>> from elasticsearch import Elasticsearch - -# By default we connect to localhost:9200 ->>> es = Elasticsearch() - -# Datetimes will be serialized... ->>> es.index(index="my-index-000001", doc_type="test-type", id=42, body={"any": "data", "timestamp": datetime.now()}) -{'_id': '42', '_index': 'my-index-000001', '_type': 'test-type', '_version': 1, 'ok': True} - -# ...but not deserialized ->>> es.get(index="my-index-000001", doc_type="test-type", id=42)['_source'] -{'any': 'data', 'timestamp': '2013-05-12T19:45:31.804229'} ------------------------------------- - -[NOTE] -All the API calls map the raw REST API as closely as possible, including -the distinction between required and optional arguments to the calls. This -means that the code makes distinction between positional and keyword arguments; -we, however, recommend that people use keyword arguments for all calls for -consistency and safety. - - -[discrete] -=== Features - -The client's features include: - -* Translating basic Python data types to and from JSON - -* Configurable automatic discovery of cluster nodes - -* Persistent connections - -* Load balancing (with pluggable selection strategy) across all available nodes - -* Failed connection penalization (time based - failed connections won't be - retried until a timeout is reached) - -* Thread safety - -* Pluggable architecture - -The client also contains a convenient set of -https://elasticsearch-py.readthedocs.org/en/master/helpers.html[helpers] for -some of the more engaging tasks like bulk indexing and reindexing. - - -[discrete] -=== Elasticsearch DSL - -For a more high level client library with more limited scope, have a look at -https://elasticsearch-dsl.readthedocs.org/[elasticsearch-dsl] - a more Pythonic library -sitting on top of `elasticsearch-py`. - -It provides a more convenient and idiomatic way to write and manipulate -https://elasticsearch-dsl.readthedocs.org/en/latest/search_dsl.html[queries]. It -stays close to the Elasticsearch JSON DSL, mirroring its terminology and -structure while exposing the whole range of the DSL from Python either directly -using defined classes or a queryset-like expressions. - -It also provides an optional -https://elasticsearch-dsl.readthedocs.org/en/latest/persistence.html#doctype[persistence -layer] for working with documents as Python objects in an ORM-like fashion: -defining mappings, retrieving and saving documents, wrapping the document data -in user-defined classes. diff --git a/docs/sphinx/Makefile b/docs/sphinx/Makefile deleted file mode 100644 index e188f833..00000000 --- a/docs/sphinx/Makefile +++ /dev/null @@ -1,177 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = _build - -# User-friendly check for sphinx-build -ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) -$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) -endif - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " xml to make Docutils-native XML files" - @echo " pseudoxml to make pseudoxml-XML files for display purposes" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Elasticsearch.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Elasticsearch.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/Elasticsearch" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Elasticsearch" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -latexpdfja: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through platex and dvipdfmx..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." - -xml: - $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml - @echo - @echo "Build finished. The XML files are in $(BUILDDIR)/xml." - -pseudoxml: - $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml - @echo - @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/docs/sphinx/api.rst b/docs/sphinx/api.rst deleted file mode 100644 index c9a4c2df..00000000 --- a/docs/sphinx/api.rst +++ /dev/null @@ -1,302 +0,0 @@ -.. _api: - -API Documentation -================= - -All the API calls map the raw REST api as closely as possible, including the -distinction between required and optional arguments to the calls. This means -that the code makes distinction between positional and keyword arguments; we, -however, recommend that people **use keyword arguments for all calls for -consistency and safety**. - -.. note:: - - for compatibility with the Python ecosystem we use ``from_`` instead of - ``from`` and ``doc_type`` instead of ``type`` as parameter names. - - -Global Options --------------- - -Some parameters are added by the client itself and can be used in all API -calls. - -Ignore -~~~~~~ - -An API call is considered successful (and will return a response) if -elasticsearch returns a 2XX response. Otherwise an instance of -:class:`~elasticsearch.TransportError` (or a more specific subclass) will be -raised. You can see other exception and error states in :ref:`exceptions`. If -you do not wish an exception to be raised you can always pass in an ``ignore`` -parameter with either a single status code that should be ignored or a list of -them: - -.. code-block:: python - - from elasticsearch import Elasticsearch - es = Elasticsearch() - - # ignore 400 cause by IndexAlreadyExistsException when creating an index - es.indices.create(index='test-index', ignore=400) - - # ignore 404 and 400 - es.indices.delete(index='test-index', ignore=[400, 404]) - - -Timeout -~~~~~~~ - -Global timeout can be set when constructing the client (see -:class:`~elasticsearch.Connection`'s ``timeout`` parameter) or on a per-request -basis using ``request_timeout`` (float value in seconds) as part of any API -call, this value will get passed to the ``perform_request`` method of the -connection class: - -.. code-block:: python - - # only wait for 1 second, regardless of the client's default - es.cluster.health(wait_for_status='yellow', request_timeout=1) - -.. note:: - - Some API calls also accept a ``timeout`` parameter that is passed to - Elasticsearch server. This timeout is internal and doesn't guarantee that the - request will end in the specified time. - -Tracking Requests with Opaque ID -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can enrich your requests against Elasticsearch with an identifier string, that allows you to discover this identifier -in `deprecation logs `_, to support you with -`identifying search slow log origin `_ -or to help with `identifying running tasks `_. - - .. code-block:: python - - from elasticsearch import Elasticsearch - - client = Elasticsearch() - - # You can apply X-Opaque-Id in any API request via 'opaque_id': - resp = client.get(index="test", id="1", opaque_id="request-1") - - -.. py:module:: elasticsearch - -Response Filtering -~~~~~~~~~~~~~~~~~~ - -The ``filter_path`` parameter is used to reduce the response returned by -elasticsearch. For example, to only return ``_id`` and ``_type``, do: - -.. code-block:: python - - es.search(index='test-index', filter_path=['hits.hits._id', 'hits.hits._type']) - -It also supports the ``*`` wildcard character to match any field or part of a -field's name: - -.. code-block:: python - - es.search(index='test-index', filter_path=['hits.hits._*']) - -Elasticsearch -------------- - -.. autoclass:: Elasticsearch - :members: - -.. py:module:: elasticsearch.client - -Async Search ------------- - -.. autoclass:: AsyncSearchClient - :members: - -Autoscaling ------------ - -.. autoclass:: AutoscalingClient - :members: - -Cat ---- - -.. autoclass:: CatClient - :members: - -Cross-Cluster Replication (CCR) -------------------------------- - -.. autoclass:: CcrClient - :members: - -Cluster -------- - -.. autoclass:: ClusterClient - :members: - -Dangling Indices ----------------- - -.. autoclass:: DanglingIndicesClient - :members: - -Enrich Policies ---------------- - -.. autoclass:: EnrichClient - :members: - -Event Query Language (EQL) --------------------------- - -.. autoclass:: EqlClient - :members: - -Snapshottable Features ----------------------- - -.. autoclass:: FeaturesClient - :members: - -Fleet ------ - -.. autoclass:: FleetClient - :members: - -Graph Explore -------------- - -.. autoclass:: GraphClient - :members: - -Index Lifecycle Management (ILM) --------------------------------- - -.. autoclass:: IlmClient - :members: - -Indices -------- - -.. autoclass:: IndicesClient - :members: - -Ingest Pipelines ----------------- - -.. autoclass:: IngestClient - :members: - -License -------- - -.. autoclass:: LicenseClient - :members: - -Logstash --------- - -.. autoclass:: LogstashClient - :members: - -Migration ---------- - -.. autoclass:: MigrationClient - :members: - -Machine Learning (ML) ---------------------- - -.. autoclass:: MlClient - :members: - -Monitoring ----------- - -.. autoclass:: MonitoringClient - :members: - -Nodes ------ - -.. autoclass:: NodesClient - :members: - -Rollup Indices --------------- - -.. autoclass:: RollupClient - :members: - -Searchable Snapshots --------------------- - -.. autoclass:: SearchableSnapshotsClient - :members: - -Security --------- - -.. autoclass:: SecurityClient - :members: - -Shutdown --------- - -.. autoclass:: ShutdownClient - :members: - -Snapshot Lifecycle Management (SLM) ------------------------------------ - -.. autoclass:: SlmClient - :members: - -Snapshots ---------- - -.. autoclass:: SnapshotClient - :members: - -SQL ---- - -.. autoclass:: SqlClient - :members: - -TLS/SSL -------- - -.. autoclass:: SslClient - :members: - -Tasks ------ - -.. autoclass:: TasksClient - :members: - -Text Structure --------------- - -.. autoclass:: TextStructureClient - :members: - -Transforms ----------- - -.. autoclass:: TransformClient - :members: - -Watcher -------- - -.. autoclass:: WatcherClient - :members: diff --git a/docs/sphinx/async.rst b/docs/sphinx/async.rst deleted file mode 100644 index 08ddfa33..00000000 --- a/docs/sphinx/async.rst +++ /dev/null @@ -1,243 +0,0 @@ -Using Asyncio with Elasticsearch -================================ - - .. py:module:: elasticsearch - -Starting in ``elasticsearch-py`` v7.8.0 for Python 3.6+ the ``elasticsearch`` package supports async/await with -`Asyncio `_ and `Aiohttp `_. -You can either install ``aiohttp`` directly or use the ``[async]`` extra: - - .. code-block:: bash - - $ python -m pip install elasticsearch>=7.8.0 aiohttp - - # - OR - - - $ python -m pip install elasticsearch[async]>=7.8.0 - - .. note:: - Async functionality is a new feature of this library in v7.8.0+ so - `please open an issue `_ - if you find an issue or have a question about async support. - -Getting Started with Async --------------------------- - -After installation all async API endpoints are available via :class:`~elasticsearch.AsyncElasticsearch` -and are used in the same way as other APIs, just with an extra ``await``: - - .. code-block:: python - - import asyncio - from elasticsearch import AsyncElasticsearch - - es = AsyncElasticsearch() - - async def main(): - resp = await es.search( - index="documents", - body={"query": {"match_all": {}}}, - size=20, - ) - print(resp) - - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) - -All APIs that are available under the sync client are also available under the async client. - -ASGI Applications and Elastic APM ---------------------------------- - -`ASGI `_ (Asynchronous Server Gateway Interface) is a new way to -serve Python web applications making use of async I/O to achieve better performance. -Some examples of ASGI frameworks include FastAPI, Django 3.0+, and Starlette. -If you're using one of these frameworks along with Elasticsearch then you -should be using :py:class:`~elasticsearch.AsyncElasticsearch` to avoid blocking -the event loop with synchronous network calls for optimal performance. - -`Elastic APM `_ -also supports tracing of async Elasticsearch queries just the same as -synchronous queries. For an example on how to configure ``AsyncElasticsearch`` with -a popular ASGI framework `FastAPI `_ and APM tracing -there is a `pre-built example `_ -in the ``examples/fastapi-apm`` directory. - -Frequently Asked Questions --------------------------- - -NameError / ImportError when importing ``AsyncElasticsearch``? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If when trying to use ``AsyncElasticsearch`` and you're receiving a ``NameError`` or ``ImportError`` -you should ensure that you're running Python 3.6+ (check with ``$ python --version``) and -that you have ``aiohttp`` installed in your environment (check with ``$ python -m pip freeze | grep aiohttp``). -If either of the above conditions is not met then async support won't be available. - -What about the ``elasticsearch-async`` package? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Previously asyncio was supported separately via the `elasticsearch-async `_ -package. The ``elasticsearch-async`` package has been deprecated in favor of -``AsyncElasticsearch`` provided by the ``elasticsearch`` package -in v7.8 and onwards. - -Receiving 'Unclosed client session / connector' warning? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This warning is created by ``aiohttp`` when an open HTTP connection is -garbage collected. You'll typically run into this when closing your application. -To resolve the issue ensure that :meth:`~elasticsearch.AsyncElasticsearch.close` -is called before the :py:class:`~elasticsearch.AsyncElasticsearch` instance is garbage collected. - -For example if using FastAPI that might look like this: - - .. code-block:: python - - from fastapi import FastAPI - from elasticsearch import AsyncElasticsearch - - app = FastAPI() - es = AsyncElasticsearch() - - # This gets called once the app is shutting down. - @app.on_event("shutdown") - async def app_shutdown(): - await es.close() - - -Async Helpers -------------- - -Async variants of all helpers are available in ``elasticsearch.helpers`` -and are all prefixed with ``async_*``. You'll notice that these APIs -are identical to the ones in the sync :ref:`helpers` documentation. - -All async helpers that accept an iterator or generator also accept async iterators -and async generators. - - .. py:module:: elasticsearch.helpers - -Bulk and Streaming Bulk -~~~~~~~~~~~~~~~~~~~~~~~ - - .. autofunction:: async_bulk - - .. code-block:: python - - import asyncio - from elasticsearch import AsyncElasticsearch - from elasticsearch.helpers import async_bulk - - es = AsyncElasticsearch() - - async def gendata(): - mywords = ['foo', 'bar', 'baz'] - for word in mywords: - yield { - "_index": "mywords", - "doc": {"word": word}, - } - - async def main(): - await async_bulk(es, gendata()) - - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) - - .. autofunction:: async_streaming_bulk - - .. code-block:: python - - import asyncio - from elasticsearch import AsyncElasticsearch - from elasticsearch.helpers import async_streaming_bulk - - es = AsyncElasticsearch() - - async def gendata(): - mywords = ['foo', 'bar', 'baz'] - for word in mywords: - yield { - "_index": "mywords", - "word": word, - } - - async def main(): - async for ok, result in async_streaming_bulk(es, gendata()): - action, result = result.popitem() - if not ok: - print("failed to %s document %s" % ()) - - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) - -Scan -~~~~ - - .. autofunction:: async_scan - - .. code-block:: python - - import asyncio - from elasticsearch import AsyncElasticsearch - from elasticsearch.helpers import async_scan - - es = AsyncElasticsearch() - - async def main(): - async for doc in async_scan( - client=es, - query={"query": {"match": {"title": "python"}}}, - index="orders-*" - ): - print(doc) - - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) - -Reindex -~~~~~~~ - - .. autofunction:: async_reindex - - -API Reference -------------- - - .. py:module:: elasticsearch - -The API of :class:`~elasticsearch.AsyncElasticsearch` is nearly identical -to the API of :class:`~elasticsearch.Elasticsearch` with the exception that -every API call like :py:func:`~elasticsearch.AsyncElasticsearch.search` is -an ``async`` function and requires an ``await`` to properly return the response -body. - -AsyncElasticsearch -~~~~~~~~~~~~~~~~~~ - - .. note:: - - To reference Elasticsearch APIs that are namespaced like ``.indices.create()`` - refer to the sync API reference. These APIs are identical between sync and async. - - .. autoclass:: AsyncElasticsearch - :members: - -AsyncTransport -~~~~~~~~~~~~~~ - - .. autoclass:: AsyncTransport - :members: - -AsyncConnection -~~~~~~~~~~~~~~~~~ - - .. autoclass:: AsyncConnection - :members: - -AIOHttpConnection -~~~~~~~~~~~~~~~~~ - - .. autoclass:: AIOHttpConnection - :members: diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py deleted file mode 100644 index 5fe119f0..00000000 --- a/docs/sphinx/conf.py +++ /dev/null @@ -1,272 +0,0 @@ -# -*- coding: utf-8 -*- -# SPDX-License-Identifier: Apache-2.0 -# -# The OpenSearch Contributors require contributions made to -# this file be licensed under the Apache-2.0 license or a -# compatible open source license. -# -# Modifications Copyright OpenSearch Contributors. See -# GitHub history for details. -# -# Licensed to Elasticsearch B.V under one or more agreements. -# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -# See the LICENSE file in the project root for more information - -import os -import datetime -import elasticsearch - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# sys.path.insert(0, os.path.abspath('.')) - -# -- General configuration ----------------------------------------------------- - -# If your documentation needs a minimal Sphinx version, state it here. -# needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ["sphinx.ext.autodoc", "sphinx.ext.doctest"] - -autoclass_content = "both" - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# The suffix of source filenames. -source_suffix = ".rst" - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"Elasticsearch" -copyright = u"%d, Elasticsearch B.V" % datetime.date.today().year - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. - -# The short X.Y version. -version = elasticsearch.__versionstr__ -# The full version, including alpha/beta/rc tags. -release = version - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - - -# -- Options for HTML output --------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. - -on_rtd = os.environ.get("READTHEDOCS", None) == "True" - -if not on_rtd: # only import and set the theme if we're building docs locally - import sphinx_rtd_theme - - html_theme = "sphinx_rtd_theme" - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -# html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Output file base name for HTML help builder. -htmlhelp_basename = "Elasticsearchdoc" - - -# -- Options for LaTeX output -------------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - # 'preamble': '', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [ - ( - "index", - "Elasticsearch.tex", - u"Elasticsearch Documentation", - u"Honza Král", - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output -------------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ("index", "elasticsearch-py", u"Elasticsearch Documentation", [u"Honza Král"], 1) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------------ - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - "index", - "Elasticsearch", - u"Elasticsearch Documentation", - u"Honza Král", - "Elasticsearch", - "One line description of project.", - "Miscellaneous", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False diff --git a/docs/sphinx/connection.rst b/docs/sphinx/connection.rst deleted file mode 100644 index 71da4493..00000000 --- a/docs/sphinx/connection.rst +++ /dev/null @@ -1,88 +0,0 @@ -.. _connection_api: - -Connection Layer API -==================== - -All of the classes responsible for handling the connection to the Elasticsearch -cluster. The default subclasses used can be overridden by passing parameters to the -:class:`~elasticsearch.Elasticsearch` class. All of the arguments to the client -will be passed on to :class:`~elasticsearch.Transport`, -:class:`~elasticsearch.ConnectionPool` and :class:`~elasticsearch.Connection`. - -For example if you wanted to use your own implementation of the -:class:`~elasticsearch.ConnectionSelector` class you can just pass in the -``selector_class`` parameter. - -.. note:: - - :class:`~elasticsearch.ConnectionPool` and related options (like - ``selector_class``) will only be used if more than one connection is defined. - Either directly or via the :ref:`sniffing` mechanism. - -.. py:module:: elasticsearch - -Transport ---------- - -.. autoclass:: Transport(hosts, connection_class=Urllib3HttpConnection, connection_pool_class=ConnectionPool, host_info_callback=construct_hosts_list, sniff_on_start=False, sniffer_timeout=None, sniff_on_connection_fail=False, serializer=JSONSerializer(), max_retries=3, ** kwargs) - :members: - - -Connection Pool ---------------- - -.. autoclass:: ConnectionPool(connections, dead_timeout=60, selector_class=RoundRobinSelector, randomize_hosts=True, ** kwargs) - :members: - - -Connection Selector -------------------- - -.. autoclass:: ConnectionSelector(opts) - :members: - - -Urllib3HttpConnection (default connection_class) ------------------------------------------------- - -If you have complex SSL logic for connecting to Elasticsearch using an `SSLContext` object -might be more helpful. You can create one natively using the python SSL library with the -`create_default_context` (https://docs.python.org/3/library/ssl.html#ssl.create_default_context) method. - -To create an `SSLContext` object you only need to use one of cafile, capath or cadata: - -.. code-block:: python - - >>> from ssl import create_default_context - >>> context = create_default_context(cafile=None, capath=None, cadata=None) - -* `cafile` is the path to your CA File -* `capath` is the directory of a collection of CA's -* `cadata` is either an ASCII string of one or more PEM-encoded certificates or a bytes-like object of DER-encoded certificates. - -Please note that the use of SSLContext is only available for urllib3. - -.. autoclass:: Urllib3HttpConnection - :members: - - -API Compatibility HTTP Header ------------------------------ - -The Python client can be configured to emit an HTTP header -``Accept: application/vnd.elasticsearch+json; compatible-with=7`` -which signals to Elasticsearch that the client is requesting -``7.x`` version of request and response bodies. This allows for -upgrading from 7.x to 8.x version of Elasticsearch without upgrading -everything at once. Elasticsearch should be upgraded first after -the compatibility header is configured and clients should be upgraded -second. - - .. code-block:: python - - from elasticsearch import Elasticsearch - - client = Elasticsearch("http://...", headers={"accept": "application/vnd.elasticsearch+json; compatible-with=7"}) - -If you'd like to have the client emit the header without configuring ``headers`` you -can use the environment variable ``ELASTIC_CLIENT_APIVERSIONING=1``. diff --git a/docs/sphinx/exceptions.rst b/docs/sphinx/exceptions.rst deleted file mode 100644 index 03bb60e1..00000000 --- a/docs/sphinx/exceptions.rst +++ /dev/null @@ -1,25 +0,0 @@ -.. _exceptions: - -Exceptions -========== - -.. py:module:: elasticsearch - -.. autoclass:: ImproperlyConfigured - -.. autoclass:: ElasticsearchException - -.. autoclass:: SerializationError(ElasticsearchException) - -.. autoclass:: TransportError(ElasticsearchException) - :members: - -.. autoclass:: ConnectionError(TransportError) -.. autoclass:: ConnectionTimeout(ConnectionError) -.. autoclass:: SSLError(ConnectionError) - -.. autoclass:: NotFoundError(TransportError) -.. autoclass:: ConflictError(TransportError) -.. autoclass:: RequestError(TransportError) -.. autoclass:: AuthenticationException(TransportError) -.. autoclass:: AuthorizationException(TransportError) diff --git a/docs/sphinx/helpers.rst b/docs/sphinx/helpers.rst deleted file mode 100644 index 20e3bcbe..00000000 --- a/docs/sphinx/helpers.rst +++ /dev/null @@ -1,137 +0,0 @@ -.. _helpers: - -Helpers -======= - -Collection of simple helper functions that abstract some specifics of the raw API. - - -Bulk helpers ------------- - -There are several helpers for the ``bulk`` API since its requirement for -specific formatting and other considerations can make it cumbersome if used directly. - -All bulk helpers accept an instance of ``Elasticsearch`` class and an iterable -``actions`` (any iterable, can also be a generator, which is ideal in most -cases since it will allow you to index large datasets without the need of -loading them into memory). - -The items in the ``action`` iterable should be the documents we wish to index -in several formats. The most common one is the same as returned by -:meth:`~elasticsearch.Elasticsearch.search`, for example: - -.. code:: python - - { - '_index': 'index-name', - '_type': 'document', - '_id': 42, - '_routing': 5, - 'pipeline': 'my-ingest-pipeline', - '_source': { - "title": "Hello World!", - "body": "..." - } - } - -Alternatively, if `_source` is not present, it will pop all metadata fields -from the doc and use the rest as the document data: - -.. code:: python - - { - "_id": 42, - "_routing": 5, - "title": "Hello World!", - "body": "..." - } - -The :meth:`~elasticsearch.Elasticsearch.bulk` api accepts ``index``, ``create``, -``delete``, and ``update`` actions. Use the ``_op_type`` field to specify an -action (``_op_type`` defaults to ``index``): - -.. code:: python - - { - '_op_type': 'delete', - '_index': 'index-name', - '_type': 'document', - '_id': 42, - } - { - '_op_type': 'update', - '_index': 'index-name', - '_type': 'document', - '_id': 42, - 'doc': {'question': 'The life, universe and everything.'} - } - - -Example: -~~~~~~~~ - -Lets say we have an iterable of data. Lets say a list of words called ``mywords`` -and we want to index those words into individual documents where the structure of the -document is like ``{"word": ""}``. - -.. code:: python - - def gendata(): - mywords = ['foo', 'bar', 'baz'] - for word in mywords: - yield { - "_index": "mywords", - "word": word, - } - - bulk(es, gendata()) - -For a more complete and complex example please take a look at -https://github.com/elastic/elasticsearch-py/blob/master/examples/bulk-ingest - -The :meth:`~elasticsearch.Elasticsearch.parallel_bulk` api is a wrapper around the :meth:`~elasticsearch.Elasticsearch.bulk` api to provide threading. :meth:`~elasticsearch.Elasticsearch.parallel_bulk` returns a generator which must be consumed to produce results. - -To see the results use: - -.. code:: python - - for success, info in parallel_bulk(...): - if not success: - print('A document failed:', info) - -If you don't care about the results, you can use deque from collections: - -.. code:: python - - from collections import deque - deque(parallel_bulk(...), maxlen=0) - -.. note:: - - When reading raw json strings from a file, you can also pass them in - directly (without decoding to dicts first). In that case, however, you lose - the ability to specify anything (index, type, even id) on a per-record - basis, all documents will just be sent to elasticsearch to be indexed - as-is. - - -.. py:module:: elasticsearch.helpers - -.. autofunction:: streaming_bulk - -.. autofunction:: parallel_bulk - -.. autofunction:: bulk - - -Scan ----- - -.. autofunction:: scan - - -Reindex -------- - -.. autofunction:: reindex diff --git a/docs/sphinx/index.rst b/docs/sphinx/index.rst deleted file mode 100644 index a8087b71..00000000 --- a/docs/sphinx/index.rst +++ /dev/null @@ -1,451 +0,0 @@ -Python Elasticsearch Client -=========================== - -Official low-level client for Elasticsearch. Its goal is to provide common -ground for all Elasticsearch-related code in Python; because of this it tries -to be opinion-free and very extendable. - - -Installation ------------- - -Install the ``elasticsearch`` package with `pip -`_: - -.. code-block:: console - - $ python -m pip install elasticsearch - -If your application uses async/await in Python you can install with -the ``async`` extra: - -.. code-block:: console - - $ python -m pip install elasticsearch[async] - -Read more about `how to use asyncio with this project `_. - - -Compatibility -------------- - -The library is compatible with all Elasticsearch versions since ``0.90.x`` but you -**have to use a matching major version**: - -For **Elasticsearch 7.0** and later, use the major version 7 (``7.x.y``) of the -library. - -For **Elasticsearch 6.0** and later, use the major version 6 (``6.x.y``) of the -library. - -For **Elasticsearch 5.0** and later, use the major version 5 (``5.x.y``) of the -library. - -For **Elasticsearch 2.0** and later, use the major version 2 (``2.x.y``) of the -library, and so on. - -The recommended way to set your requirements in your `setup.py` or -`requirements.txt` is: - -.. code-block:: python - - # Elasticsearch 7.x - elasticsearch>=7.0.0,<8.0.0 - - # Elasticsearch 6.x - elasticsearch>=6.0.0,<7.0.0 - - # Elasticsearch 5.x - elasticsearch>=5.0.0,<6.0.0 - - # Elasticsearch 2.x - elasticsearch>=2.0.0,<3.0.0 - -If you have a need to have multiple versions installed at the same time older -versions are also released as ``elasticsearch2``, ``elasticsearch5`` and ``elasticsearch6``. - - -Example Usage -------------- - -.. code-block:: python - - from datetime import datetime - from elasticsearch import Elasticsearch - es = Elasticsearch() - - doc = { - 'author': 'kimchy', - 'text': 'Elasticsearch: cool. bonsai cool.', - 'timestamp': datetime.now(), - } - res = es.index(index="test-index", id=1, body=doc) - print(res['result']) - - res = es.get(index="test-index", id=1) - print(res['_source']) - - es.indices.refresh(index="test-index") - - res = es.search(index="test-index", body={"query": {"match_all": {}}}) - print("Got %d Hits:" % res['hits']['total']['value']) - for hit in res['hits']['hits']: - print("%(timestamp)s %(author)s: %(text)s" % hit["_source"]) - - -Features --------- - -This client was designed as very thin wrapper around Elasticsearch's REST API to -allow for maximum flexibility. This means that there are no opinions in this -client; it also means that some of the APIs are a little cumbersome to use from -Python. We have created some :ref:`helpers` to help with this issue as well as -a more high level library (`elasticsearch-dsl`_) on top of this one to provide -a more convenient way of working with Elasticsearch. - -.. _elasticsearch-dsl: https://elasticsearch-dsl.readthedocs.io/ - -Persistent Connections -~~~~~~~~~~~~~~~~~~~~~~ - -``elasticsearch-py`` uses persistent connections inside of individual connection -pools (one per each configured or sniffed node). Out of the box you can choose -between two ``http`` protocol implementations. See :ref:`transports` for more -information. - -The transport layer will create an instance of the selected connection class -per node and keep track of the health of individual nodes - if a node becomes -unresponsive (throwing exceptions while connecting to it) it's put on a timeout -by the :class:`~elasticsearch.ConnectionPool` class and only returned to the -circulation after the timeout is over (or when no live nodes are left). By -default nodes are randomized before being passed into the pool and round-robin -strategy is used for load balancing. - -You can customize this behavior by passing parameters to the -:ref:`connection_api` (all keyword arguments to the -:class:`~elasticsearch.Elasticsearch` class will be passed through). If what -you want to accomplish is not supported you should be able to create a subclass -of the relevant component and pass it in as a parameter to be used instead of -the default implementation. - - -Automatic Retries -~~~~~~~~~~~~~~~~~ - -If a connection to a node fails due to connection issues (raises -:class:`~elasticsearch.ConnectionError`) it is considered in faulty state. It -will be placed on hold for ``dead_timeout`` seconds and the request will be -retried on another node. If a connection fails multiple times in a row the -timeout will get progressively larger to avoid hitting a node that's, by all -indication, down. If no live connection is available, the connection that has -the smallest timeout will be used. - -By default retries are not triggered by a timeout -(:class:`~elasticsearch.ConnectionTimeout`), set ``retry_on_timeout`` to -``True`` to also retry on timeouts. - -.. _sniffing: - -Sniffing -~~~~~~~~ - -The client can be configured to inspect the cluster state to get a list of -nodes upon startup, periodically and/or on failure. See -:class:`~elasticsearch.Transport` parameters for details. - -Some example configurations: - - .. code-block:: python - - from elasticsearch import Elasticsearch - - # by default we don't sniff, ever - es = Elasticsearch() - - # you can specify to sniff on startup to inspect the cluster and load - # balance across all nodes - es = Elasticsearch(["seed1", "seed2"], sniff_on_start=True) - - # you can also sniff periodically and/or after failure: - es = Elasticsearch(["seed1", "seed2"], - sniff_on_start=True, - sniff_on_connection_fail=True, - sniffer_timeout=60) - -Thread safety -~~~~~~~~~~~~~ - -The client is thread safe and can be used in a multi threaded environment. Best -practice is to create a single global instance of the client and use it -throughout your application. If your application is long-running consider -turning on :ref:`sniffing` to make sure the client is up to date on the cluster -location. - -By default we allow ``urllib3`` to open up to 10 connections to each node, if -your application calls for more parallelism, use the ``maxsize`` parameter to -raise the limit: - -.. code-block:: python - - # allow up to 25 connections to each node - es = Elasticsearch(["host1", "host2"], maxsize=25) - -.. note:: - - Since we use persistent connections throughout the client it means that the - client doesn't tolerate ``fork`` very well. If your application calls for - multiple processes make sure you create a fresh client after call to - ``fork``. Note that Python's ``multiprocessing`` module uses ``fork`` to - create new processes on POSIX systems. - -TLS/SSL and Authentication -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can configure the client to use ``SSL`` for connecting to your -elasticsearch cluster, including certificate verification and HTTP auth: - -.. code-block:: python - - from elasticsearch import Elasticsearch - - # you can use RFC-1738 to specify the url - es = Elasticsearch(['https://user:secret@localhost:443']) - - # ... or specify common parameters as kwargs - - es = Elasticsearch( - ['localhost', 'otherhost'], - http_auth=('user', 'secret'), - scheme="https", - port=443, - ) - - # SSL client authentication using client_cert and client_key - - from ssl import create_default_context - - context = create_default_context(cafile="path/to/cert.pem") - es = Elasticsearch( - ['localhost', 'otherhost'], - http_auth=('user', 'secret'), - scheme="https", - port=443, - ssl_context=context, - ) - -.. warning:: - - ``elasticsearch-py`` doesn't ship with default set of root certificates. To - have working SSL certificate validation you need to either specify your own - as ``cafile`` or ``capath`` or ``cadata`` or install `certifi`_ which will - be picked up automatically. - - -See class :class:`~elasticsearch.Urllib3HttpConnection` for detailed -description of the options. - -.. _certifi: http://certifiio.readthedocs.io/en/latest/ - -Connecting via Cloud ID -~~~~~~~~~~~~~~~~~~~~~~~ - -Cloud ID is an easy way to configure your client to work -with your Elastic Cloud deployment. Combine the ``cloud_id`` -with either ``http_auth`` or ``api_key`` to authenticate -with your Elastic Cloud deployment. - -Using ``cloud_id`` enables TLS verification and HTTP compression by default -and sets the port to ``443`` unless otherwise overwritten via the ``port`` parameter -or the port value encoded within ``cloud_id``. Using Cloud ID also disables sniffing. - -.. code-block:: python - - from elasticsearch import Elasticsearch - - es = Elasticsearch( - cloud_id="cluster-1:dXMa5Fx...", - http_auth=("elastic", ""), - ) - -API Key Authentication -~~~~~~~~~~~~~~~~~~~~~~ - -You can configure the client to use Elasticsearch's `API Key`_ for connecting to your cluster. -Please note this authentication method has been introduced with release of Elasticsearch ``6.7.0``. - - from elasticsearch import Elasticsearch - - # you can use the api key tuple - es = Elasticsearch( - ['node-1', 'node-2', 'node-3'], - api_key=('id', 'api_key'), - ) - - # or you pass the base 64 encoded token - es = Elasticsearch( - ['node-1', 'node-2', 'node-3'], - api_key='base64encoded tuple', - ) - -.. _API Key: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html - -Logging -~~~~~~~ - -``elasticsearch-py`` uses the standard `logging library`_ from python to define -two loggers: ``elasticsearch`` and ``elasticsearch.trace``. ``elasticsearch`` -is used by the client to log standard activity, depending on the log level. -``elasticsearch.trace`` can be used to log requests to the server in the form -of ``curl`` commands using pretty-printed json that can then be executed from -command line. Because it is designed to be shared (for example to demonstrate -an issue) it also just uses ``localhost:9200`` as the address instead of the -actual address of the host. If the trace logger has not been configured -already it is set to `propagate=False` so it needs to be activated separately. - -.. _logging library: http://docs.python.org/3/library/logging.html - -Type Hints -~~~~~~~~~~ - -Starting in ``elasticsearch-py`` v7.10.0 the library now ships with `type hints`_ -and supports basic static type analysis with tools like `Mypy`_ and `Pyright`_. - -If we write a script that has a type error like using ``request_timeout`` with -a ``str`` argument instead of ``float`` and then run Mypy on the script: - -.. code-block:: python - - # script.py - from elasticsearch import Elasticsearch - - es = Elasticsearch(...) - es.search( - index="test-index", - request_timeout="5" # type error! - ) - - # $ mypy script.py - # script.py:5: error: Argument "request_timeout" to "search" of "Elasticsearch" has - # incompatible type "str"; expected "Union[int, float, None]" - # Found 1 error in 1 file (checked 1 source file) - -For now many parameter types for API methods aren't specific to -a type (ie they are of type ``typing.Any``) but in the future -they will be tightened for even better static type checking. - -Type hints also allow tools like your IDE to check types and provide better -auto-complete functionality. - -.. warning:: - - The type hints for API methods like ``search`` don't match the function signature - that can be found in the source code. Type hints represent optimal usage of the - API methods. Using keyword arguments is highly recommended so all optional parameters - and ``body`` are keyword-only in type hints. - - JetBrains PyCharm will use the warning ``Unexpected argument`` to denote that the - parameter may be keyword-only. - -.. _type hints: https://www.python.org/dev/peps/pep-0484 -.. _mypy: http://mypy-lang.org -.. _pyright: https://github.com/microsoft/pyright - - -Environment considerations --------------------------- - -When using the client there are several limitations of your environment that -could come into play. - -When using an HTTP load balancer you cannot use the :ref:`sniffing` -functionality - the cluster would supply the client with IP addresses to -directly connect to the cluster, circumventing the load balancer. Depending on -your configuration this might be something you don't want or break completely. - -Compression -~~~~~~~~~~~ - -When using capacity-constrained networks (low throughput), it may be handy to enable -compression. This is especially useful when doing bulk loads or inserting large -documents. This will configure compression. - -.. code-block:: python - - from elasticsearch import Elasticsearch - es = Elasticsearch(hosts, http_compress=True) - -Compression is enabled by default when connecting to Elastic Cloud via ``cloud_id``. - -Customization -------------- - -Custom serializers -~~~~~~~~~~~~~~~~~~ - -By default, `JSONSerializer`_ is used to encode all outgoing requests. -However, you can implement your own custom serializer - -.. code-block:: python - - from elasticsearch.serializer import JSONSerializer - - class SetEncoder(JSONSerializer): - def default(self, obj): - if isinstance(obj, set): - return list(obj) - if isinstance(obj, Something): - return 'CustomSomethingRepresentation' - return JSONSerializer.default(self, obj) - - es = Elasticsearch(serializer=SetEncoder()) - -.. _JSONSerializer: https://github.com/elastic/elasticsearch-py/blob/master/elasticsearch/serializer.py#L24 - - -Elasticsearch-DSL ------------------ - -For a more high level client library with more limited scope, have a look at -`elasticsearch-dsl`_ - a more pythonic library sitting on top of -``elasticsearch-py``. - -`elasticsearch-dsl`_ provides a more convenient and idiomatic way to write and manipulate -`queries`_ by mirroring the terminology and structure of Elasticsearch JSON DSL -while exposing the whole range of the DSL from Python -either directly using defined classes or a queryset-like expressions. - -It also provides an optional `persistence layer`_ for working with documents as -Python objects in an ORM-like fashion: defining mappings, retrieving and saving -documents, wrapping the document data in user-defined classes. - -.. _elasticsearch-dsl: https://elasticsearch-dsl.readthedocs.io/ -.. _queries: https://elasticsearch-dsl.readthedocs.io/en/latest/search_dsl.html -.. _persistence layer: https://elasticsearch-dsl.readthedocs.io/en/latest/persistence.html#doctype - - -Contents --------- - -.. toctree:: - :maxdepth: 2 - - api - exceptions - async - connection - transports - helpers - Release Notes - -License -------- - -Copyright 2021 Elasticsearch B.V. Licensed under the Apache License, Version 2.0. - - -Indices and tables ------------------- - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/docs/sphinx/transports.rst b/docs/sphinx/transports.rst deleted file mode 100644 index 1a0d902b..00000000 --- a/docs/sphinx/transports.rst +++ /dev/null @@ -1,42 +0,0 @@ -.. _transports: - -Transport classes -================= - -List of transport classes that can be used, simply import your choice and pass -it to the constructor of :class:`~elasticsearch.Elasticsearch` as -`connection_class`. Note that the -:class:`~elasticsearch.connection.RequestsHttpConnection` requires ``requests`` -to be installed. - -For example to use the ``requests``-based connection just import it and use it: - -.. code-block:: python - - from elasticsearch import Elasticsearch, RequestsHttpConnection - es = Elasticsearch(connection_class=RequestsHttpConnection) - -The default connection class is based on ``urllib3`` which is more performant -and lightweight than the optional ``requests``-based class. Only use -``RequestsHttpConnection`` if you have need of any of ``requests`` advanced -features like custom auth plugins etc. - - -.. py:module:: elasticsearch.connection - -Connection ----------- - -.. autoclass:: Connection - -Urllib3HttpConnection ---------------------- - -.. autoclass:: Urllib3HttpConnection - - -RequestsHttpConnection ----------------------- - -.. autoclass:: RequestsHttpConnection - diff --git a/elasticsearch/_async/client/__init__.py b/elasticsearch/_async/client/__init__.py index 71731d06..b974aba2 100644 --- a/elasticsearch/_async/client/__init__.py +++ b/elasticsearch/_async/client/__init__.py @@ -230,7 +230,6 @@ class AsyncElasticsearch(object): """ Returns whether the cluster is running. - ``_ """ try: return await self.transport.perform_request( @@ -244,7 +243,6 @@ class AsyncElasticsearch(object): """ Returns basic information about the cluster. - ``_ """ return await self.transport.perform_request( "GET", "/", params=params, headers=headers @@ -264,7 +262,6 @@ class AsyncElasticsearch(object): Creates a new document in the index. Returns a 409 response when a document with a same ID already exists in the index. - ``_ :arg index: The name of the index :arg id: Document ID @@ -319,7 +316,6 @@ class AsyncElasticsearch(object): """ Creates or updates a document in an index. - ``_ :arg index: The name of the index :arg body: The document @@ -383,7 +379,6 @@ class AsyncElasticsearch(object): """ Allows to perform multiple index/update/delete operations in a single request. - ``_ :arg body: The operation definition and data (action-data pairs), separated by newlines @@ -430,7 +425,6 @@ class AsyncElasticsearch(object): """ Explicitly clears the search context for a scroll. - ``_ :arg body: A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter @@ -469,7 +463,6 @@ class AsyncElasticsearch(object): """ Returns number of documents matching a query. - ``_ :arg body: A query to restrict the results specified with the Query DSL (optional) @@ -527,7 +520,6 @@ class AsyncElasticsearch(object): """ Removes a document from the index. - ``_ :arg index: The name of the index :arg id: The document ID @@ -605,7 +597,6 @@ class AsyncElasticsearch(object): """ Deletes documents matching the provided query. - ``_ :arg index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -702,7 +693,6 @@ class AsyncElasticsearch(object): Changes the number of requests per second for a particular Delete By Query operation. - ``_ :arg task_id: The task id to rethrottle :arg requests_per_second: The throttle to set on this request in @@ -723,7 +713,6 @@ class AsyncElasticsearch(object): """ Deletes a script. - ``_ :arg id: Script ID :arg master_timeout: Specify timeout for connection to master @@ -752,7 +741,6 @@ class AsyncElasticsearch(object): """ Returns information about whether a document exists in an index. - ``_ :arg index: The name of the index :arg id: The document ID @@ -803,7 +791,6 @@ class AsyncElasticsearch(object): """ Returns information about whether a document source exists in an index. - ``_ :arg index: The name of the index :arg id: The document ID @@ -859,7 +846,6 @@ class AsyncElasticsearch(object): """ Returns information about why a specific matches (or doesn't match) a query. - ``_ :arg index: The name of the index :arg id: The document ID @@ -912,7 +898,6 @@ class AsyncElasticsearch(object): Returns the information about the capabilities of fields among multiple indices. - ``_ :arg body: An index filter specified with the Query DSL :arg index: A comma-separated list of index names; use `_all` or @@ -953,7 +938,6 @@ class AsyncElasticsearch(object): """ Returns a document. - ``_ :arg index: The name of the index :arg id: The document ID @@ -994,7 +978,6 @@ class AsyncElasticsearch(object): """ Returns a script. - ``_ :arg id: Script ID :arg master_timeout: Specify timeout for connection to master @@ -1021,7 +1004,6 @@ class AsyncElasticsearch(object): """ Returns the source of a document. - ``_ :arg index: The name of the index :arg id: The document ID @@ -1071,7 +1053,6 @@ class AsyncElasticsearch(object): """ Allows to get multiple documents in one request. - ``_ :arg body: Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is @@ -1118,7 +1099,6 @@ class AsyncElasticsearch(object): """ Allows to execute several search operations in one request. - ``_ :arg body: The request definitions (metadata-search request definition pairs), separated by newlines @@ -1174,7 +1154,6 @@ class AsyncElasticsearch(object): """ Allows to execute several search template operations in one request. - ``_ :arg body: The request definitions (metadata-search request definition pairs), separated by newlines @@ -1226,7 +1205,6 @@ class AsyncElasticsearch(object): """ Returns multiple termvectors in one request. - ``_ :arg body: Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of @@ -1279,7 +1257,6 @@ class AsyncElasticsearch(object): """ Creates or updates a script. - ``_ :arg id: Script ID :arg body: The document @@ -1307,7 +1284,6 @@ class AsyncElasticsearch(object): Allows to evaluate the quality of ranked search results over a set of typical search queries - ``_ .. warning:: @@ -1356,7 +1332,6 @@ class AsyncElasticsearch(object): source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster. - ``_ :arg body: The search definition using the Query DSL and the prototype for the index request. @@ -1392,7 +1367,6 @@ class AsyncElasticsearch(object): """ Changes the number of requests per second for a particular Reindex operation. - ``_ :arg task_id: The task id to rethrottle :arg requests_per_second: The throttle to set on this request in @@ -1415,7 +1389,6 @@ class AsyncElasticsearch(object): """ Allows to use the Mustache language to pre-render a search definition. - ``_ :arg body: The search definition template and its params :arg id: The id of the stored search template @@ -1433,7 +1406,6 @@ class AsyncElasticsearch(object): """ Allows an arbitrary script to be executed and a result to be returned - ``_ .. warning:: @@ -1455,7 +1427,6 @@ class AsyncElasticsearch(object): """ Allows to retrieve a large numbers of results from a single search request. - ``_ :arg body: The scroll ID if not passed by URL or query parameter. @@ -1527,7 +1498,6 @@ class AsyncElasticsearch(object): """ Returns results matching a query. - ``_ :arg body: The search definition using the Query DSL :arg index: A comma-separated list of index names to search; use @@ -1653,7 +1623,6 @@ class AsyncElasticsearch(object): Returns information about the indices and shards that a search request would be executed against. - ``_ :arg index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -1696,7 +1665,6 @@ class AsyncElasticsearch(object): """ Allows to use the Mustache language to pre-render a search definition. - ``_ :arg body: The search definition template and its params :arg index: A comma-separated list of index names to search; use @@ -1762,7 +1730,6 @@ class AsyncElasticsearch(object): Returns information and statistics about terms in the fields of a particular document. - ``_ :arg index: The index in which the document resides. :arg body: Define parameters and or supply a document to get @@ -1821,7 +1788,6 @@ class AsyncElasticsearch(object): """ Updates a document with a script or partial document. - ``_ :arg index: The name of the index :arg id: Document ID @@ -1914,7 +1880,6 @@ class AsyncElasticsearch(object): Performs an update on every document in the index without changing the source, for example to pick up a mapping change. - ``_ :arg index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -2014,7 +1979,6 @@ class AsyncElasticsearch(object): Changes the number of requests per second for a particular Update By Query operation. - ``_ :arg task_id: The task id to rethrottle :arg requests_per_second: The throttle to set on this request in @@ -2035,7 +1999,6 @@ class AsyncElasticsearch(object): """ Returns all script contexts. - ``_ .. warning:: @@ -2051,7 +2014,6 @@ class AsyncElasticsearch(object): """ Returns available script types, languages and contexts - ``_ .. warning:: @@ -2067,7 +2029,6 @@ class AsyncElasticsearch(object): """ Close a point in time - ``_ :arg body: a point-in-time id to close """ @@ -2082,7 +2043,6 @@ class AsyncElasticsearch(object): """ Open a point in time that can be used in subsequent searches - ``_ :arg index: A comma-separated list of index names to open point in time; use `_all` or empty string to perform the operation on all @@ -2108,7 +2068,6 @@ class AsyncElasticsearch(object): the provided string. It is designed for low-latency look-ups used in auto- complete scenarios. - ``_ .. warning:: diff --git a/elasticsearch/_async/client/cat.py b/elasticsearch/_async/client/cat.py index d2ada33e..c199a1b5 100644 --- a/elasticsearch/_async/client/cat.py +++ b/elasticsearch/_async/client/cat.py @@ -34,7 +34,6 @@ class CatClient(NamespacedClient): Shows information about currently configured aliases to indices including filter and routing infos. - ``_ :arg name: A comma-separated list of alias names to return :arg expand_wildcards: Whether to expand wildcard expression to @@ -60,7 +59,6 @@ class CatClient(NamespacedClient): Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. - ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information @@ -91,7 +89,6 @@ class CatClient(NamespacedClient): Provides quick access to the document count of the entire cluster, or individual indices. - ``_ :arg index: A comma-separated list of index names to limit the returned information @@ -112,7 +109,6 @@ class CatClient(NamespacedClient): """ Returns a concise representation of the cluster health. - ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -134,7 +130,6 @@ class CatClient(NamespacedClient): """ Returns help for the Cat APIs. - ``_ :arg help: Return help information :arg s: Comma-separated list of column names or column aliases @@ -164,7 +159,6 @@ class CatClient(NamespacedClient): Returns information about indices: number of primaries and replicas, document counts, disk size, ... - ``_ :arg index: A comma-separated list of index names to limit the returned information @@ -203,7 +197,6 @@ class CatClient(NamespacedClient): """ Returns information about the master node. - ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -238,7 +231,6 @@ class CatClient(NamespacedClient): """ Returns basic statistics about performance of cluster nodes. - ``_ :arg bytes: The unit in which to display byte values Valid choices: b, k, kb, m, mb, g, gb, t, tb, p, pb @@ -272,7 +264,6 @@ class CatClient(NamespacedClient): """ Returns information about index shard recoveries, both on-going completed. - ``_ :arg index: Comma-separated list or wildcard expression of index names to limit the returned information @@ -303,7 +294,6 @@ class CatClient(NamespacedClient): """ Provides a detailed view of shard allocation on nodes. - ``_ :arg index: A comma-separated list of index names to limit the returned information @@ -332,7 +322,6 @@ class CatClient(NamespacedClient): """ Provides low-level information about the segments in the shards of an index. - ``_ :arg index: A comma-separated list of index names to limit the returned information @@ -355,7 +344,6 @@ class CatClient(NamespacedClient): """ Returns a concise representation of the cluster pending tasks. - ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -381,7 +369,6 @@ class CatClient(NamespacedClient): Returns cluster-wide thread pool statistics per node. By default the active, queue and rejected statistics are returned for all thread pools. - ``_ :arg thread_pool_patterns: A comma-separated list of regular- expressions to filter the thread pools in the output @@ -412,7 +399,6 @@ class CatClient(NamespacedClient): Shows how much heap memory is currently being used by fielddata on every data node in the cluster. - ``_ :arg fields: A comma-separated list of fields to return in the output @@ -440,7 +426,6 @@ class CatClient(NamespacedClient): """ Returns information about installed plugins across nodes node. - ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -465,7 +450,6 @@ class CatClient(NamespacedClient): """ Returns information about custom node attributes. - ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -488,7 +472,6 @@ class CatClient(NamespacedClient): """ Returns information about snapshot repositories registered in the cluster. - ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -513,7 +496,6 @@ class CatClient(NamespacedClient): """ Returns all snapshots in a specific repository. - ``_ :arg repository: Name of repository from which to fetch the snapshot information @@ -555,7 +537,6 @@ class CatClient(NamespacedClient): Returns information about the tasks currently executing on one or more nodes in the cluster. - ``_ :arg actions: A comma-separated list of actions that should be returned. Leave empty to return all. @@ -584,7 +565,6 @@ class CatClient(NamespacedClient): """ Returns information about existing templates. - ``_ :arg name: A pattern that returned template names must match :arg format: a short version of the Accept header, e.g. json, @@ -608,7 +588,6 @@ class CatClient(NamespacedClient): """ Gets configuration and usage information about data frame analytics jobs. - ``_ :arg id: The ID of the data frame analytics to fetch :arg allow_no_match: Whether to ignore if a wildcard expression @@ -640,7 +619,6 @@ class CatClient(NamespacedClient): """ Gets configuration and usage information about datafeeds. - ``_ :arg datafeed_id: The ID of the datafeeds stats to fetch :arg allow_no_datafeeds: Whether to ignore if a wildcard @@ -681,7 +659,6 @@ class CatClient(NamespacedClient): """ Gets configuration and usage information about anomaly detection jobs. - ``_ :arg job_id: The ID of the jobs stats to fetch :arg allow_no_jobs: Whether to ignore if a wildcard expression @@ -725,7 +702,6 @@ class CatClient(NamespacedClient): """ Gets configuration and usage information about inference trained models. - ``_ :arg model_id: The ID of the trained models stats to fetch :arg allow_no_match: Whether to ignore if a wildcard expression @@ -764,7 +740,6 @@ class CatClient(NamespacedClient): """ Gets configuration and usage information about transforms. - ``_ :arg transform_id: The id of the transform for which to get stats. '_all' or '*' implies all transforms diff --git a/elasticsearch/_async/client/cluster.py b/elasticsearch/_async/client/cluster.py index 5131ce89..52df4f28 100644 --- a/elasticsearch/_async/client/cluster.py +++ b/elasticsearch/_async/client/cluster.py @@ -45,7 +45,6 @@ class ClusterClient(NamespacedClient): """ Returns basic information about the health of the cluster. - ``_ :arg index: Limit the information returned to a specific index :arg expand_wildcards: Whether to expand wildcard expression to @@ -85,7 +84,6 @@ class ClusterClient(NamespacedClient): Returns a list of any cluster-level changes (e.g. create index, update mapping, allocate or fail shard) which have not yet been executed. - ``_ :arg local: Return local information, do not retrieve the state from master node (default: false) @@ -109,7 +107,6 @@ class ClusterClient(NamespacedClient): """ Returns a comprehensive information about the state of the cluster. - ``_ :arg metric: Limit the information returned to the specified metrics Valid choices: _all, blocks, metadata, nodes, routing_table, @@ -149,7 +146,6 @@ class ClusterClient(NamespacedClient): """ Returns high-level overview of cluster statistics. - ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from @@ -175,7 +171,6 @@ class ClusterClient(NamespacedClient): """ Allows to manually change the allocation of individual shards in the cluster. - ``_ :arg body: The definition of `commands` to perform (`move`, `cancel`, `allocate`) @@ -201,7 +196,6 @@ class ClusterClient(NamespacedClient): """ Returns cluster settings. - ``_ :arg flat_settings: Return settings in flat format (default: false) @@ -220,7 +214,6 @@ class ClusterClient(NamespacedClient): """ Updates the cluster settings. - ``_ :arg body: The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). @@ -242,7 +235,6 @@ class ClusterClient(NamespacedClient): """ Returns the information about configured remote clusters. - ``_ """ return await self.transport.perform_request( "GET", "/_remote/info", params=params, headers=headers @@ -253,7 +245,6 @@ class ClusterClient(NamespacedClient): """ Provides explanations for shard allocations in the cluster. - ``_ :arg body: The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' @@ -275,7 +266,6 @@ class ClusterClient(NamespacedClient): """ Deletes a component template - ``_ :arg name: The name of the template :arg master_timeout: Specify timeout for connection to master @@ -296,7 +286,6 @@ class ClusterClient(NamespacedClient): """ Returns one or more component templates - ``_ :arg name: The comma separated names of the component templates :arg local: Return local information, do not retrieve the state @@ -316,7 +305,6 @@ class ClusterClient(NamespacedClient): """ Creates or updates a component template - ``_ :arg name: The name of the template :arg body: The template definition @@ -342,7 +330,6 @@ class ClusterClient(NamespacedClient): """ Returns information about whether a particular component template exist - ``_ :arg name: The name of the template :arg local: Return local information, do not retrieve the state @@ -365,7 +352,6 @@ class ClusterClient(NamespacedClient): """ Clears cluster voting config exclusions. - ``_ :arg wait_for_removal: Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting @@ -383,7 +369,6 @@ class ClusterClient(NamespacedClient): """ Updates the cluster voting config exclusions by node ids or node names. - ``_ :arg node_ids: A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you diff --git a/elasticsearch/_async/client/dangling_indices.py b/elasticsearch/_async/client/dangling_indices.py index 0d7ceb2a..761b20da 100644 --- a/elasticsearch/_async/client/dangling_indices.py +++ b/elasticsearch/_async/client/dangling_indices.py @@ -33,7 +33,6 @@ class DanglingIndicesClient(NamespacedClient): """ Deletes the specified dangling index - ``_ :arg index_uuid: The UUID of the dangling index :arg accept_data_loss: Must be set to true in order to delete @@ -56,7 +55,6 @@ class DanglingIndicesClient(NamespacedClient): """ Imports the specified dangling index - ``_ :arg index_uuid: The UUID of the dangling index :arg accept_data_loss: Must be set to true in order to import @@ -76,7 +74,6 @@ class DanglingIndicesClient(NamespacedClient): """ Returns all dangling indices. - ``_ """ return await self.transport.perform_request( "GET", "/_dangling", params=params, headers=headers diff --git a/elasticsearch/_async/client/features.py b/elasticsearch/_async/client/features.py index 2ee00d31..6b70c815 100644 --- a/elasticsearch/_async/client/features.py +++ b/elasticsearch/_async/client/features.py @@ -34,7 +34,6 @@ class FeaturesClient(NamespacedClient): Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot - ``_ :arg master_timeout: Explicit operation timeout for connection to master node @@ -48,7 +47,6 @@ class FeaturesClient(NamespacedClient): """ Resets the internal state of features, usually by deleting system indices - ``_ .. warning:: diff --git a/elasticsearch/_async/client/indices.py b/elasticsearch/_async/client/indices.py index b9e94aad..08670849 100644 --- a/elasticsearch/_async/client/indices.py +++ b/elasticsearch/_async/client/indices.py @@ -34,7 +34,6 @@ class IndicesClient(NamespacedClient): Performs the analysis process on a text and return the tokens breakdown of the text. - ``_ :arg body: Define analyzer/tokenizer parameters and the text on which the analysis should be performed @@ -53,7 +52,6 @@ class IndicesClient(NamespacedClient): """ Performs the refresh operation in one or more indices. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -81,7 +79,6 @@ class IndicesClient(NamespacedClient): """ Performs the flush operation on one or more indices. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string for all indices @@ -114,7 +111,6 @@ class IndicesClient(NamespacedClient): """ Creates an index with optional settings and mappings. - ``_ :arg index: The name of the index :arg body: The configuration for the index (`settings` and @@ -138,7 +134,6 @@ class IndicesClient(NamespacedClient): """ Clones an index - ``_ :arg index: The name of the source index to clone :arg target: The name of the target index to clone into @@ -175,7 +170,6 @@ class IndicesClient(NamespacedClient): """ Returns information about one or more indices. - ``_ :arg index: A comma-separated list of index names :arg allow_no_indices: Ignore if a wildcard expression resolves @@ -214,7 +208,6 @@ class IndicesClient(NamespacedClient): """ Opens an index. - ``_ :arg index: A comma separated list of indices to open :arg allow_no_indices: Whether to ignore if a wildcard indices @@ -249,7 +242,6 @@ class IndicesClient(NamespacedClient): """ Closes an index. - ``_ :arg index: A comma separated list of indices to close :arg allow_no_indices: Whether to ignore if a wildcard indices @@ -285,7 +277,6 @@ class IndicesClient(NamespacedClient): """ Deletes an index. - ``_ :arg index: A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices @@ -318,7 +309,6 @@ class IndicesClient(NamespacedClient): """ Returns information about whether a particular index exists. - ``_ :arg index: A comma-separated list of index names :arg allow_no_indices: Ignore if a wildcard expression resolves @@ -348,7 +338,6 @@ class IndicesClient(NamespacedClient): Returns information about whether a particular document type exists. (DEPRECATED) - ``_ :arg index: A comma-separated list of index names; use `_all` to check the types across all indices @@ -390,7 +379,6 @@ class IndicesClient(NamespacedClient): """ Updates the index mappings. - ``_ :arg body: The mapping definition :arg index: A comma-separated list of index names the mapping @@ -438,7 +426,6 @@ class IndicesClient(NamespacedClient): """ Returns mappings for one or more indices. - ``_ :arg index: A comma-separated list of index names :arg doc_type: A comma-separated list of document types @@ -477,7 +464,6 @@ class IndicesClient(NamespacedClient): """ Returns mapping for one or more fields. - ``_ :arg fields: A comma-separated list of fields :arg index: A comma-separated list of index names @@ -512,7 +498,6 @@ class IndicesClient(NamespacedClient): """ Creates or updates an alias. - ``_ :arg index: A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the @@ -540,7 +525,6 @@ class IndicesClient(NamespacedClient): """ Returns information about whether a particular alias exists. - ``_ :arg name: A comma-separated list of alias names to return :arg index: A comma-separated list of index names to filter @@ -568,7 +552,6 @@ class IndicesClient(NamespacedClient): """ Returns an alias. - ``_ :arg index: A comma-separated list of index names to filter aliases @@ -593,7 +576,6 @@ class IndicesClient(NamespacedClient): """ Updates index aliases. - ``_ :arg body: The definition of `actions` to perform :arg master_timeout: Specify timeout for connection to master @@ -611,7 +593,6 @@ class IndicesClient(NamespacedClient): """ Deletes an alias. - ``_ :arg index: A comma-separated list of index names (supports wildcards); use `_all` for all indices @@ -633,7 +614,6 @@ class IndicesClient(NamespacedClient): """ Creates or updates an index template. - ``_ :arg name: The name of the template :arg body: The template definition @@ -663,7 +643,6 @@ class IndicesClient(NamespacedClient): """ Returns information about whether a particular index template exists. - ``_ :arg name: The comma separated names of the index templates :arg flat_settings: Return settings in flat format (default: @@ -685,7 +664,6 @@ class IndicesClient(NamespacedClient): """ Returns an index template. - ``_ :arg name: The comma separated names of the index templates :arg flat_settings: Return settings in flat format (default: @@ -706,7 +684,6 @@ class IndicesClient(NamespacedClient): """ Deletes an index template. - ``_ :arg name: The name of the template :arg master_timeout: Specify timeout for connection to master @@ -732,7 +709,6 @@ class IndicesClient(NamespacedClient): """ Returns settings for one or more indices. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -770,7 +746,6 @@ class IndicesClient(NamespacedClient): """ Updates the index settings. - ``_ :arg body: The index settings to be updated :arg index: A comma-separated list of index names; use `_all` or @@ -818,7 +793,6 @@ class IndicesClient(NamespacedClient): """ Provides statistics on operations happening in an index. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -862,7 +836,6 @@ class IndicesClient(NamespacedClient): """ Provides low-level information about segments in a Lucene index. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -900,7 +873,6 @@ class IndicesClient(NamespacedClient): """ Allows a user to validate a potentially expensive query without executing it. - ``_ :arg body: The query definition specified with the Query DSL :arg index: A comma-separated list of index names to restrict @@ -954,7 +926,6 @@ class IndicesClient(NamespacedClient): """ Clears all or specific caches for one or more indices. - ``_ :arg index: A comma-separated list of index name to limit the operation @@ -981,7 +952,6 @@ class IndicesClient(NamespacedClient): """ Returns information about ongoing index shard recoveries. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1005,7 +975,6 @@ class IndicesClient(NamespacedClient): """ DEPRECATED Upgrades to the current version of Lucene. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1031,7 +1000,6 @@ class IndicesClient(NamespacedClient): """ DEPRECATED Returns a progress status of current upgrade. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1054,7 +1022,6 @@ class IndicesClient(NamespacedClient): Performs a synced flush operation on one or more indices. Synced flush is deprecated and will be removed in 8.0. Use flush instead - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string for all indices @@ -1081,7 +1048,6 @@ class IndicesClient(NamespacedClient): """ Provides store information for shard copies of indices. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1113,7 +1079,6 @@ class IndicesClient(NamespacedClient): """ Performs the force merge operation on one or more indices. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1143,7 +1108,6 @@ class IndicesClient(NamespacedClient): """ Allow to shrink an existing index into a new index with fewer primary shards. - ``_ :arg index: The name of the source index to shrink :arg target: The name of the target index to shrink into @@ -1176,7 +1140,6 @@ class IndicesClient(NamespacedClient): Allows you to split an existing index into a new index with more primary shards. - ``_ :arg index: The name of the source index to split :arg target: The name of the target index to split into @@ -1215,7 +1178,6 @@ class IndicesClient(NamespacedClient): Updates an alias to point to a new index when the existing index is considered to be too large or too old. - ``_ :arg alias: The name of the alias to rollover :arg body: The conditions that needs to be met for executing @@ -1256,7 +1218,6 @@ class IndicesClient(NamespacedClient): Freezes an index. A frozen index has almost no overhead on the cluster (except for maintaining its metadata in memory) and is read-only. - ``_ :arg index: The name of the index to freeze :arg allow_no_indices: Whether to ignore if a wildcard indices @@ -1292,7 +1253,6 @@ class IndicesClient(NamespacedClient): Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again. - ``_ :arg index: The name of the index to unfreeze :arg allow_no_indices: Whether to ignore if a wildcard indices @@ -1320,7 +1280,6 @@ class IndicesClient(NamespacedClient): """ Reloads an index's search analyzers and their resources. - ``_ :arg index: A comma-separated list of index names to reload analyzers for @@ -1348,7 +1307,6 @@ class IndicesClient(NamespacedClient): """ Creates a data stream - ``_ :arg name: The name of the data stream """ @@ -1364,7 +1322,6 @@ class IndicesClient(NamespacedClient): """ Deletes a data stream. - ``_ :arg name: A comma-separated list of data streams to delete; use `*` to delete all data streams @@ -1384,7 +1341,6 @@ class IndicesClient(NamespacedClient): """ Deletes an index template. - ``_ :arg name: The name of the template :arg master_timeout: Specify timeout for connection to master @@ -1405,7 +1361,6 @@ class IndicesClient(NamespacedClient): """ Returns information about whether a particular index template exists. - ``_ :arg name: The name of the template :arg flat_settings: Return settings in flat format (default: @@ -1427,7 +1382,6 @@ class IndicesClient(NamespacedClient): """ Returns an index template. - ``_ :arg name: The comma separated names of the index templates :arg flat_settings: Return settings in flat format (default: @@ -1446,7 +1400,6 @@ class IndicesClient(NamespacedClient): """ Creates or updates an index template. - ``_ :arg name: The name of the template :arg body: The template definition @@ -1474,7 +1427,6 @@ class IndicesClient(NamespacedClient): Simulate matching the given index name against the index templates in the system - ``_ :arg name: The name of the index (it must be a concrete index name) @@ -1503,7 +1455,6 @@ class IndicesClient(NamespacedClient): """ Returns data streams. - ``_ :arg name: A comma-separated list of data streams to get; use `*` to get all data streams @@ -1520,7 +1471,6 @@ class IndicesClient(NamespacedClient): """ Simulate resolving the given template name or body - ``_ :arg body: New index template definition to be simulated, if no index template name is specified @@ -1545,7 +1495,6 @@ class IndicesClient(NamespacedClient): """ Returns information about any matching indices, aliases, and data streams - ``_ .. warning:: @@ -1576,7 +1525,6 @@ class IndicesClient(NamespacedClient): """ Adds a block to an index. - ``_ :arg index: A comma separated list of indices to add a block to :arg block: The block to add (one of read, write, read_only or @@ -1605,7 +1553,6 @@ class IndicesClient(NamespacedClient): """ Provides statistics on operations happening in a data stream. - ``_ :arg name: A comma-separated list of data stream names; use `_all` or empty string to perform the operation on all data streams @@ -1623,7 +1570,6 @@ class IndicesClient(NamespacedClient): Promotes a data stream from a replicated data stream managed by CCR to a regular data stream - ``_ :arg name: The name of the data stream """ @@ -1642,7 +1588,6 @@ class IndicesClient(NamespacedClient): """ Migrates an alias to a data stream - ``_ :arg name: The name of the alias to migrate """ @@ -1667,7 +1612,6 @@ class IndicesClient(NamespacedClient): """ Analyzes the disk usage of each field of an index or data stream - ``_ .. warning:: @@ -1703,7 +1647,6 @@ class IndicesClient(NamespacedClient): """ Returns the field usage stats for each field of an index - ``_ .. warning:: diff --git a/elasticsearch/_async/client/ingest.py b/elasticsearch/_async/client/ingest.py index 7027ad9b..fcd33e94 100644 --- a/elasticsearch/_async/client/ingest.py +++ b/elasticsearch/_async/client/ingest.py @@ -33,7 +33,6 @@ class IngestClient(NamespacedClient): """ Returns a pipeline. - ``_ :arg id: Comma separated list of pipeline ids. Wildcards supported @@ -51,7 +50,6 @@ class IngestClient(NamespacedClient): """ Creates or updates a pipeline. - ``_ :arg id: Pipeline ID :arg body: The ingest definition @@ -76,7 +74,6 @@ class IngestClient(NamespacedClient): """ Deletes a pipeline. - ``_ :arg id: Pipeline ID :arg master_timeout: Explicit operation timeout for connection @@ -98,7 +95,6 @@ class IngestClient(NamespacedClient): """ Allows to simulate a pipeline with example documents. - ``_ :arg body: The simulate definition :arg id: Pipeline ID @@ -121,7 +117,6 @@ class IngestClient(NamespacedClient): """ Returns a list of the built-in patterns. - ``_ """ return await self.transport.perform_request( "GET", "/_ingest/processor/grok", params=params, headers=headers @@ -132,7 +127,6 @@ class IngestClient(NamespacedClient): """ Returns statistical information about geoip databases - ``_ """ return await self.transport.perform_request( "GET", "/_ingest/geoip/stats", params=params, headers=headers diff --git a/elasticsearch/_async/client/nodes.py b/elasticsearch/_async/client/nodes.py index 7a050f18..55317e0f 100644 --- a/elasticsearch/_async/client/nodes.py +++ b/elasticsearch/_async/client/nodes.py @@ -35,7 +35,6 @@ class NodesClient(NamespacedClient): """ Reloads secure settings. - ``_ :arg body: An object containing the password for the elasticsearch keystore @@ -57,7 +56,6 @@ class NodesClient(NamespacedClient): """ Returns information about nodes in the cluster. - ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from @@ -91,7 +89,6 @@ class NodesClient(NamespacedClient): """ Returns statistical information about nodes in the cluster. - ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from @@ -139,7 +136,6 @@ class NodesClient(NamespacedClient): """ Returns information about hot threads on each node in the cluster. - ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from @@ -173,7 +169,6 @@ class NodesClient(NamespacedClient): """ Returns low-level information about REST actions usage on nodes. - ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from diff --git a/elasticsearch/_async/client/remote.py b/elasticsearch/_async/client/remote.py index 2f54d76d..9f2f7aec 100644 --- a/elasticsearch/_async/client/remote.py +++ b/elasticsearch/_async/client/remote.py @@ -30,9 +30,6 @@ from .utils import NamespacedClient, query_params class RemoteClient(NamespacedClient): @query_params() async def info(self, params=None, headers=None): - """ - ``_ - """ return await self.transport.perform_request( "GET", "/_remote/info", params=params, headers=headers ) diff --git a/elasticsearch/_async/client/snapshot.py b/elasticsearch/_async/client/snapshot.py index 131bd10a..da0666d3 100644 --- a/elasticsearch/_async/client/snapshot.py +++ b/elasticsearch/_async/client/snapshot.py @@ -33,7 +33,6 @@ class SnapshotClient(NamespacedClient): """ Creates a snapshot in a repository. - ``_ :arg repository: A repository name :arg snapshot: A snapshot name @@ -60,7 +59,6 @@ class SnapshotClient(NamespacedClient): """ Deletes a snapshot. - ``_ :arg repository: A repository name :arg snapshot: A snapshot name @@ -89,7 +87,6 @@ class SnapshotClient(NamespacedClient): """ Returns information about a snapshot. - ``_ :arg repository: A repository name :arg snapshot: A comma-separated list of snapshot names @@ -121,7 +118,6 @@ class SnapshotClient(NamespacedClient): """ Deletes a repository. - ``_ :arg repository: Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. @@ -144,7 +140,6 @@ class SnapshotClient(NamespacedClient): """ Returns information about a repository. - ``_ :arg repository: A comma-separated list of repository names :arg local: Return local information, do not retrieve the state @@ -161,7 +156,6 @@ class SnapshotClient(NamespacedClient): """ Creates a repository. - ``_ :arg repository: A repository name :arg body: The repository definition @@ -187,7 +181,6 @@ class SnapshotClient(NamespacedClient): """ Restores a snapshot. - ``_ :arg repository: A repository name :arg snapshot: A snapshot name @@ -214,7 +207,6 @@ class SnapshotClient(NamespacedClient): """ Returns information about the status of a snapshot. - ``_ :arg repository: A repository name :arg snapshot: A comma-separated list of snapshot names @@ -236,7 +228,6 @@ class SnapshotClient(NamespacedClient): """ Verifies a repository. - ``_ :arg repository: A repository name :arg master_timeout: Explicit operation timeout for connection @@ -258,7 +249,6 @@ class SnapshotClient(NamespacedClient): """ Removes stale data from repository. - ``_ :arg repository: A repository name :arg master_timeout: Explicit operation timeout for connection @@ -282,7 +272,6 @@ class SnapshotClient(NamespacedClient): """ Clones indices from one snapshot into another snapshot in the same repository. - ``_ :arg repository: A repository name :arg snapshot: The name of the snapshot to clone from @@ -320,7 +309,6 @@ class SnapshotClient(NamespacedClient): """ Analyzes a repository for correctness and performance - ``_ :arg repository: A repository name :arg blob_count: Number of blobs to create during the test. diff --git a/elasticsearch/_async/client/tasks.py b/elasticsearch/_async/client/tasks.py index ab95307e..4373c09b 100644 --- a/elasticsearch/_async/client/tasks.py +++ b/elasticsearch/_async/client/tasks.py @@ -43,7 +43,6 @@ class TasksClient(NamespacedClient): """ Returns a list of tasks. - ``_ .. warning:: @@ -73,7 +72,6 @@ class TasksClient(NamespacedClient): """ Cancels a task, if it can be cancelled through an API. - ``_ .. warning:: @@ -105,7 +103,6 @@ class TasksClient(NamespacedClient): """ Returns information about a task. - ``_ .. warning:: diff --git a/elasticsearch/client/__init__.py b/elasticsearch/client/__init__.py index 8043b42e..5d6bea3d 100644 --- a/elasticsearch/client/__init__.py +++ b/elasticsearch/client/__init__.py @@ -230,7 +230,6 @@ class Elasticsearch(object): """ Returns whether the cluster is running. - ``_ """ try: return self.transport.perform_request( @@ -244,7 +243,6 @@ class Elasticsearch(object): """ Returns basic information about the cluster. - ``_ """ return self.transport.perform_request( "GET", "/", params=params, headers=headers @@ -264,7 +262,6 @@ class Elasticsearch(object): Creates a new document in the index. Returns a 409 response when a document with a same ID already exists in the index. - ``_ :arg index: The name of the index :arg id: Document ID @@ -317,7 +314,6 @@ class Elasticsearch(object): """ Creates or updates a document in an index. - ``_ :arg index: The name of the index :arg body: The document @@ -381,7 +377,6 @@ class Elasticsearch(object): """ Allows to perform multiple index/update/delete operations in a single request. - ``_ :arg body: The operation definition and data (action-data pairs), separated by newlines @@ -428,7 +423,6 @@ class Elasticsearch(object): """ Explicitly clears the search context for a scroll. - ``_ :arg body: A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter @@ -465,7 +459,6 @@ class Elasticsearch(object): """ Returns number of documents matching a query. - ``_ :arg body: A query to restrict the results specified with the Query DSL (optional) @@ -523,7 +516,6 @@ class Elasticsearch(object): """ Removes a document from the index. - ``_ :arg index: The name of the index :arg id: The document ID @@ -599,7 +591,6 @@ class Elasticsearch(object): """ Deletes documents matching the provided query. - ``_ :arg index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -696,7 +687,6 @@ class Elasticsearch(object): Changes the number of requests per second for a particular Delete By Query operation. - ``_ :arg task_id: The task id to rethrottle :arg requests_per_second: The throttle to set on this request in @@ -717,7 +707,6 @@ class Elasticsearch(object): """ Deletes a script. - ``_ :arg id: Script ID :arg master_timeout: Specify timeout for connection to master @@ -746,7 +735,6 @@ class Elasticsearch(object): """ Returns information about whether a document exists in an index. - ``_ :arg index: The name of the index :arg id: The document ID @@ -797,7 +785,6 @@ class Elasticsearch(object): """ Returns information about whether a document source exists in an index. - ``_ :arg index: The name of the index :arg id: The document ID @@ -851,7 +838,6 @@ class Elasticsearch(object): """ Returns information about why a specific matches (or doesn't match) a query. - ``_ :arg index: The name of the index :arg id: The document ID @@ -904,7 +890,6 @@ class Elasticsearch(object): Returns the information about the capabilities of fields among multiple indices. - ``_ :arg body: An index filter specified with the Query DSL :arg index: A comma-separated list of index names; use `_all` or @@ -945,7 +930,6 @@ class Elasticsearch(object): """ Returns a document. - ``_ :arg index: The name of the index :arg id: The document ID @@ -986,7 +970,6 @@ class Elasticsearch(object): """ Returns a script. - ``_ :arg id: Script ID :arg master_timeout: Specify timeout for connection to master @@ -1013,7 +996,6 @@ class Elasticsearch(object): """ Returns the source of a document. - ``_ :arg index: The name of the index :arg id: The document ID @@ -1063,7 +1045,6 @@ class Elasticsearch(object): """ Allows to get multiple documents in one request. - ``_ :arg body: Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is @@ -1110,7 +1091,6 @@ class Elasticsearch(object): """ Allows to execute several search operations in one request. - ``_ :arg body: The request definitions (metadata-search request definition pairs), separated by newlines @@ -1166,7 +1146,6 @@ class Elasticsearch(object): """ Allows to execute several search template operations in one request. - ``_ :arg body: The request definitions (metadata-search request definition pairs), separated by newlines @@ -1218,7 +1197,6 @@ class Elasticsearch(object): """ Returns multiple termvectors in one request. - ``_ :arg body: Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of @@ -1271,7 +1249,6 @@ class Elasticsearch(object): """ Creates or updates a script. - ``_ :arg id: Script ID :arg body: The document @@ -1299,7 +1276,6 @@ class Elasticsearch(object): Allows to evaluate the quality of ranked search results over a set of typical search queries - ``_ .. warning:: @@ -1348,7 +1324,6 @@ class Elasticsearch(object): source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster. - ``_ :arg body: The search definition using the Query DSL and the prototype for the index request. @@ -1384,7 +1359,6 @@ class Elasticsearch(object): """ Changes the number of requests per second for a particular Reindex operation. - ``_ :arg task_id: The task id to rethrottle :arg requests_per_second: The throttle to set on this request in @@ -1405,7 +1379,6 @@ class Elasticsearch(object): """ Allows to use the Mustache language to pre-render a search definition. - ``_ :arg body: The search definition template and its params :arg id: The id of the stored search template @@ -1423,7 +1396,6 @@ class Elasticsearch(object): """ Allows an arbitrary script to be executed and a result to be returned - ``_ .. warning:: @@ -1445,7 +1417,6 @@ class Elasticsearch(object): """ Allows to retrieve a large numbers of results from a single search request. - ``_ :arg body: The scroll ID if not passed by URL or query parameter. @@ -1515,7 +1486,6 @@ class Elasticsearch(object): """ Returns results matching a query. - ``_ :arg body: The search definition using the Query DSL :arg index: A comma-separated list of index names to search; use @@ -1641,7 +1611,6 @@ class Elasticsearch(object): Returns information about the indices and shards that a search request would be executed against. - ``_ :arg index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -1684,7 +1653,6 @@ class Elasticsearch(object): """ Allows to use the Mustache language to pre-render a search definition. - ``_ :arg body: The search definition template and its params :arg index: A comma-separated list of index names to search; use @@ -1750,7 +1718,6 @@ class Elasticsearch(object): Returns information and statistics about terms in the fields of a particular document. - ``_ :arg index: The index in which the document resides. :arg body: Define parameters and or supply a document to get @@ -1809,7 +1776,6 @@ class Elasticsearch(object): """ Updates a document with a script or partial document. - ``_ :arg index: The name of the index :arg id: Document ID @@ -1902,7 +1868,6 @@ class Elasticsearch(object): Performs an update on every document in the index without changing the source, for example to pick up a mapping change. - ``_ :arg index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -2002,7 +1967,6 @@ class Elasticsearch(object): Changes the number of requests per second for a particular Update By Query operation. - ``_ :arg task_id: The task id to rethrottle :arg requests_per_second: The throttle to set on this request in @@ -2023,7 +1987,6 @@ class Elasticsearch(object): """ Returns all script contexts. - ``_ .. warning:: @@ -2039,7 +2002,6 @@ class Elasticsearch(object): """ Returns available script types, languages and contexts - ``_ .. warning:: @@ -2055,7 +2017,6 @@ class Elasticsearch(object): """ Close a point in time - ``_ :arg body: a point-in-time id to close """ @@ -2070,7 +2031,6 @@ class Elasticsearch(object): """ Open a point in time that can be used in subsequent searches - ``_ :arg index: A comma-separated list of index names to open point in time; use `_all` or empty string to perform the operation on all @@ -2096,7 +2056,6 @@ class Elasticsearch(object): the provided string. It is designed for low-latency look-ups used in auto- complete scenarios. - ``_ .. warning:: diff --git a/elasticsearch/client/cat.py b/elasticsearch/client/cat.py index 1797c011..bc1c8d3b 100644 --- a/elasticsearch/client/cat.py +++ b/elasticsearch/client/cat.py @@ -34,7 +34,6 @@ class CatClient(NamespacedClient): Shows information about currently configured aliases to indices including filter and routing infos. - ``_ :arg name: A comma-separated list of alias names to return :arg expand_wildcards: Whether to expand wildcard expression to @@ -60,7 +59,6 @@ class CatClient(NamespacedClient): Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. - ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information @@ -91,7 +89,6 @@ class CatClient(NamespacedClient): Provides quick access to the document count of the entire cluster, or individual indices. - ``_ :arg index: A comma-separated list of index names to limit the returned information @@ -112,7 +109,6 @@ class CatClient(NamespacedClient): """ Returns a concise representation of the cluster health. - ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -134,7 +130,6 @@ class CatClient(NamespacedClient): """ Returns help for the Cat APIs. - ``_ :arg help: Return help information :arg s: Comma-separated list of column names or column aliases @@ -164,7 +159,6 @@ class CatClient(NamespacedClient): Returns information about indices: number of primaries and replicas, document counts, disk size, ... - ``_ :arg index: A comma-separated list of index names to limit the returned information @@ -203,7 +197,6 @@ class CatClient(NamespacedClient): """ Returns information about the master node. - ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -238,7 +231,6 @@ class CatClient(NamespacedClient): """ Returns basic statistics about performance of cluster nodes. - ``_ :arg bytes: The unit in which to display byte values Valid choices: b, k, kb, m, mb, g, gb, t, tb, p, pb @@ -272,7 +264,6 @@ class CatClient(NamespacedClient): """ Returns information about index shard recoveries, both on-going completed. - ``_ :arg index: Comma-separated list or wildcard expression of index names to limit the returned information @@ -303,7 +294,6 @@ class CatClient(NamespacedClient): """ Provides a detailed view of shard allocation on nodes. - ``_ :arg index: A comma-separated list of index names to limit the returned information @@ -332,7 +322,6 @@ class CatClient(NamespacedClient): """ Provides low-level information about the segments in the shards of an index. - ``_ :arg index: A comma-separated list of index names to limit the returned information @@ -355,7 +344,6 @@ class CatClient(NamespacedClient): """ Returns a concise representation of the cluster pending tasks. - ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -381,7 +369,6 @@ class CatClient(NamespacedClient): Returns cluster-wide thread pool statistics per node. By default the active, queue and rejected statistics are returned for all thread pools. - ``_ :arg thread_pool_patterns: A comma-separated list of regular- expressions to filter the thread pools in the output @@ -412,7 +399,6 @@ class CatClient(NamespacedClient): Shows how much heap memory is currently being used by fielddata on every data node in the cluster. - ``_ :arg fields: A comma-separated list of fields to return in the output @@ -440,7 +426,6 @@ class CatClient(NamespacedClient): """ Returns information about installed plugins across nodes node. - ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -465,7 +450,6 @@ class CatClient(NamespacedClient): """ Returns information about custom node attributes. - ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -488,7 +472,6 @@ class CatClient(NamespacedClient): """ Returns information about snapshot repositories registered in the cluster. - ``_ :arg format: a short version of the Accept header, e.g. json, yaml @@ -513,7 +496,6 @@ class CatClient(NamespacedClient): """ Returns all snapshots in a specific repository. - ``_ :arg repository: Name of repository from which to fetch the snapshot information @@ -555,7 +537,6 @@ class CatClient(NamespacedClient): Returns information about the tasks currently executing on one or more nodes in the cluster. - ``_ :arg actions: A comma-separated list of actions that should be returned. Leave empty to return all. @@ -584,7 +565,6 @@ class CatClient(NamespacedClient): """ Returns information about existing templates. - ``_ :arg name: A pattern that returned template names must match :arg format: a short version of the Accept header, e.g. json, @@ -608,7 +588,6 @@ class CatClient(NamespacedClient): """ Gets configuration and usage information about data frame analytics jobs. - ``_ :arg id: The ID of the data frame analytics to fetch :arg allow_no_match: Whether to ignore if a wildcard expression @@ -640,7 +619,6 @@ class CatClient(NamespacedClient): """ Gets configuration and usage information about datafeeds. - ``_ :arg datafeed_id: The ID of the datafeeds stats to fetch :arg allow_no_datafeeds: Whether to ignore if a wildcard @@ -681,7 +659,6 @@ class CatClient(NamespacedClient): """ Gets configuration and usage information about anomaly detection jobs. - ``_ :arg job_id: The ID of the jobs stats to fetch :arg allow_no_jobs: Whether to ignore if a wildcard expression @@ -725,7 +702,6 @@ class CatClient(NamespacedClient): """ Gets configuration and usage information about inference trained models. - ``_ :arg model_id: The ID of the trained models stats to fetch :arg allow_no_match: Whether to ignore if a wildcard expression @@ -764,7 +740,6 @@ class CatClient(NamespacedClient): """ Gets configuration and usage information about transforms. - ``_ :arg transform_id: The id of the transform for which to get stats. '_all' or '*' implies all transforms diff --git a/elasticsearch/client/cluster.py b/elasticsearch/client/cluster.py index b1f0178a..1d615148 100644 --- a/elasticsearch/client/cluster.py +++ b/elasticsearch/client/cluster.py @@ -45,7 +45,6 @@ class ClusterClient(NamespacedClient): """ Returns basic information about the health of the cluster. - ``_ :arg index: Limit the information returned to a specific index :arg expand_wildcards: Whether to expand wildcard expression to @@ -85,7 +84,6 @@ class ClusterClient(NamespacedClient): Returns a list of any cluster-level changes (e.g. create index, update mapping, allocate or fail shard) which have not yet been executed. - ``_ :arg local: Return local information, do not retrieve the state from master node (default: false) @@ -109,7 +107,6 @@ class ClusterClient(NamespacedClient): """ Returns a comprehensive information about the state of the cluster. - ``_ :arg metric: Limit the information returned to the specified metrics Valid choices: _all, blocks, metadata, nodes, routing_table, @@ -149,7 +146,6 @@ class ClusterClient(NamespacedClient): """ Returns high-level overview of cluster statistics. - ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from @@ -175,7 +171,6 @@ class ClusterClient(NamespacedClient): """ Allows to manually change the allocation of individual shards in the cluster. - ``_ :arg body: The definition of `commands` to perform (`move`, `cancel`, `allocate`) @@ -201,7 +196,6 @@ class ClusterClient(NamespacedClient): """ Returns cluster settings. - ``_ :arg flat_settings: Return settings in flat format (default: false) @@ -220,7 +214,6 @@ class ClusterClient(NamespacedClient): """ Updates the cluster settings. - ``_ :arg body: The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). @@ -242,7 +235,6 @@ class ClusterClient(NamespacedClient): """ Returns the information about configured remote clusters. - ``_ """ return self.transport.perform_request( "GET", "/_remote/info", params=params, headers=headers @@ -253,7 +245,6 @@ class ClusterClient(NamespacedClient): """ Provides explanations for shard allocations in the cluster. - ``_ :arg body: The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' @@ -275,7 +266,6 @@ class ClusterClient(NamespacedClient): """ Deletes a component template - ``_ :arg name: The name of the template :arg master_timeout: Specify timeout for connection to master @@ -296,7 +286,6 @@ class ClusterClient(NamespacedClient): """ Returns one or more component templates - ``_ :arg name: The comma separated names of the component templates :arg local: Return local information, do not retrieve the state @@ -316,7 +305,6 @@ class ClusterClient(NamespacedClient): """ Creates or updates a component template - ``_ :arg name: The name of the template :arg body: The template definition @@ -342,7 +330,6 @@ class ClusterClient(NamespacedClient): """ Returns information about whether a particular component template exist - ``_ :arg name: The name of the template :arg local: Return local information, do not retrieve the state @@ -365,7 +352,6 @@ class ClusterClient(NamespacedClient): """ Clears cluster voting config exclusions. - ``_ :arg wait_for_removal: Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting @@ -383,7 +369,6 @@ class ClusterClient(NamespacedClient): """ Updates the cluster voting config exclusions by node ids or node names. - ``_ :arg node_ids: A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you diff --git a/elasticsearch/client/dangling_indices.py b/elasticsearch/client/dangling_indices.py index 8c6b5741..edc7369b 100644 --- a/elasticsearch/client/dangling_indices.py +++ b/elasticsearch/client/dangling_indices.py @@ -33,7 +33,6 @@ class DanglingIndicesClient(NamespacedClient): """ Deletes the specified dangling index - ``_ :arg index_uuid: The UUID of the dangling index :arg accept_data_loss: Must be set to true in order to delete @@ -56,7 +55,6 @@ class DanglingIndicesClient(NamespacedClient): """ Imports the specified dangling index - ``_ :arg index_uuid: The UUID of the dangling index :arg accept_data_loss: Must be set to true in order to import @@ -76,7 +74,6 @@ class DanglingIndicesClient(NamespacedClient): """ Returns all dangling indices. - ``_ """ return self.transport.perform_request( "GET", "/_dangling", params=params, headers=headers diff --git a/elasticsearch/client/features.py b/elasticsearch/client/features.py index e3b9f02c..37fe2f86 100644 --- a/elasticsearch/client/features.py +++ b/elasticsearch/client/features.py @@ -34,7 +34,6 @@ class FeaturesClient(NamespacedClient): Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot - ``_ :arg master_timeout: Explicit operation timeout for connection to master node @@ -48,7 +47,6 @@ class FeaturesClient(NamespacedClient): """ Resets the internal state of features, usually by deleting system indices - ``_ .. warning:: diff --git a/elasticsearch/client/indices.py b/elasticsearch/client/indices.py index 1dcad4ab..3afd618c 100644 --- a/elasticsearch/client/indices.py +++ b/elasticsearch/client/indices.py @@ -34,7 +34,6 @@ class IndicesClient(NamespacedClient): Performs the analysis process on a text and return the tokens breakdown of the text. - ``_ :arg body: Define analyzer/tokenizer parameters and the text on which the analysis should be performed @@ -53,7 +52,6 @@ class IndicesClient(NamespacedClient): """ Performs the refresh operation in one or more indices. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -81,7 +79,6 @@ class IndicesClient(NamespacedClient): """ Performs the flush operation on one or more indices. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string for all indices @@ -114,7 +111,6 @@ class IndicesClient(NamespacedClient): """ Creates an index with optional settings and mappings. - ``_ :arg index: The name of the index :arg body: The configuration for the index (`settings` and @@ -138,7 +134,6 @@ class IndicesClient(NamespacedClient): """ Clones an index - ``_ :arg index: The name of the source index to clone :arg target: The name of the target index to clone into @@ -175,7 +170,6 @@ class IndicesClient(NamespacedClient): """ Returns information about one or more indices. - ``_ :arg index: A comma-separated list of index names :arg allow_no_indices: Ignore if a wildcard expression resolves @@ -214,7 +208,6 @@ class IndicesClient(NamespacedClient): """ Opens an index. - ``_ :arg index: A comma separated list of indices to open :arg allow_no_indices: Whether to ignore if a wildcard indices @@ -249,7 +242,6 @@ class IndicesClient(NamespacedClient): """ Closes an index. - ``_ :arg index: A comma separated list of indices to close :arg allow_no_indices: Whether to ignore if a wildcard indices @@ -285,7 +277,6 @@ class IndicesClient(NamespacedClient): """ Deletes an index. - ``_ :arg index: A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices @@ -318,7 +309,6 @@ class IndicesClient(NamespacedClient): """ Returns information about whether a particular index exists. - ``_ :arg index: A comma-separated list of index names :arg allow_no_indices: Ignore if a wildcard expression resolves @@ -348,7 +338,6 @@ class IndicesClient(NamespacedClient): Returns information about whether a particular document type exists. (DEPRECATED) - ``_ :arg index: A comma-separated list of index names; use `_all` to check the types across all indices @@ -388,7 +377,6 @@ class IndicesClient(NamespacedClient): """ Updates the index mappings. - ``_ :arg body: The mapping definition :arg index: A comma-separated list of index names the mapping @@ -436,7 +424,6 @@ class IndicesClient(NamespacedClient): """ Returns mappings for one or more indices. - ``_ :arg index: A comma-separated list of index names :arg doc_type: A comma-separated list of document types @@ -475,7 +462,6 @@ class IndicesClient(NamespacedClient): """ Returns mapping for one or more fields. - ``_ :arg fields: A comma-separated list of fields :arg index: A comma-separated list of index names @@ -510,7 +496,6 @@ class IndicesClient(NamespacedClient): """ Creates or updates an alias. - ``_ :arg index: A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the @@ -538,7 +523,6 @@ class IndicesClient(NamespacedClient): """ Returns information about whether a particular alias exists. - ``_ :arg name: A comma-separated list of alias names to return :arg index: A comma-separated list of index names to filter @@ -566,7 +550,6 @@ class IndicesClient(NamespacedClient): """ Returns an alias. - ``_ :arg index: A comma-separated list of index names to filter aliases @@ -591,7 +574,6 @@ class IndicesClient(NamespacedClient): """ Updates index aliases. - ``_ :arg body: The definition of `actions` to perform :arg master_timeout: Specify timeout for connection to master @@ -609,7 +591,6 @@ class IndicesClient(NamespacedClient): """ Deletes an alias. - ``_ :arg index: A comma-separated list of index names (supports wildcards); use `_all` for all indices @@ -631,7 +612,6 @@ class IndicesClient(NamespacedClient): """ Creates or updates an index template. - ``_ :arg name: The name of the template :arg body: The template definition @@ -661,7 +641,6 @@ class IndicesClient(NamespacedClient): """ Returns information about whether a particular index template exists. - ``_ :arg name: The comma separated names of the index templates :arg flat_settings: Return settings in flat format (default: @@ -683,7 +662,6 @@ class IndicesClient(NamespacedClient): """ Returns an index template. - ``_ :arg name: The comma separated names of the index templates :arg flat_settings: Return settings in flat format (default: @@ -704,7 +682,6 @@ class IndicesClient(NamespacedClient): """ Deletes an index template. - ``_ :arg name: The name of the template :arg master_timeout: Specify timeout for connection to master @@ -730,7 +707,6 @@ class IndicesClient(NamespacedClient): """ Returns settings for one or more indices. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -768,7 +744,6 @@ class IndicesClient(NamespacedClient): """ Updates the index settings. - ``_ :arg body: The index settings to be updated :arg index: A comma-separated list of index names; use `_all` or @@ -816,7 +791,6 @@ class IndicesClient(NamespacedClient): """ Provides statistics on operations happening in an index. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -860,7 +834,6 @@ class IndicesClient(NamespacedClient): """ Provides low-level information about segments in a Lucene index. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -898,7 +871,6 @@ class IndicesClient(NamespacedClient): """ Allows a user to validate a potentially expensive query without executing it. - ``_ :arg body: The query definition specified with the Query DSL :arg index: A comma-separated list of index names to restrict @@ -952,7 +924,6 @@ class IndicesClient(NamespacedClient): """ Clears all or specific caches for one or more indices. - ``_ :arg index: A comma-separated list of index name to limit the operation @@ -979,7 +950,6 @@ class IndicesClient(NamespacedClient): """ Returns information about ongoing index shard recoveries. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1003,7 +973,6 @@ class IndicesClient(NamespacedClient): """ DEPRECATED Upgrades to the current version of Lucene. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1029,7 +998,6 @@ class IndicesClient(NamespacedClient): """ DEPRECATED Returns a progress status of current upgrade. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1052,7 +1020,6 @@ class IndicesClient(NamespacedClient): Performs a synced flush operation on one or more indices. Synced flush is deprecated and will be removed in 8.0. Use flush instead - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string for all indices @@ -1079,7 +1046,6 @@ class IndicesClient(NamespacedClient): """ Provides store information for shard copies of indices. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1111,7 +1077,6 @@ class IndicesClient(NamespacedClient): """ Performs the force merge operation on one or more indices. - ``_ :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1141,7 +1106,6 @@ class IndicesClient(NamespacedClient): """ Allow to shrink an existing index into a new index with fewer primary shards. - ``_ :arg index: The name of the source index to shrink :arg target: The name of the target index to shrink into @@ -1174,7 +1138,6 @@ class IndicesClient(NamespacedClient): Allows you to split an existing index into a new index with more primary shards. - ``_ :arg index: The name of the source index to split :arg target: The name of the target index to split into @@ -1211,7 +1174,6 @@ class IndicesClient(NamespacedClient): Updates an alias to point to a new index when the existing index is considered to be too large or too old. - ``_ :arg alias: The name of the alias to rollover :arg body: The conditions that needs to be met for executing @@ -1252,7 +1214,6 @@ class IndicesClient(NamespacedClient): Freezes an index. A frozen index has almost no overhead on the cluster (except for maintaining its metadata in memory) and is read-only. - ``_ :arg index: The name of the index to freeze :arg allow_no_indices: Whether to ignore if a wildcard indices @@ -1288,7 +1249,6 @@ class IndicesClient(NamespacedClient): Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again. - ``_ :arg index: The name of the index to unfreeze :arg allow_no_indices: Whether to ignore if a wildcard indices @@ -1316,7 +1276,6 @@ class IndicesClient(NamespacedClient): """ Reloads an index's search analyzers and their resources. - ``_ :arg index: A comma-separated list of index names to reload analyzers for @@ -1344,7 +1303,6 @@ class IndicesClient(NamespacedClient): """ Creates a data stream - ``_ :arg name: The name of the data stream """ @@ -1360,7 +1318,6 @@ class IndicesClient(NamespacedClient): """ Deletes a data stream. - ``_ :arg name: A comma-separated list of data streams to delete; use `*` to delete all data streams @@ -1380,7 +1337,6 @@ class IndicesClient(NamespacedClient): """ Deletes an index template. - ``_ :arg name: The name of the template :arg master_timeout: Specify timeout for connection to master @@ -1401,7 +1357,6 @@ class IndicesClient(NamespacedClient): """ Returns information about whether a particular index template exists. - ``_ :arg name: The name of the template :arg flat_settings: Return settings in flat format (default: @@ -1423,7 +1378,6 @@ class IndicesClient(NamespacedClient): """ Returns an index template. - ``_ :arg name: The comma separated names of the index templates :arg flat_settings: Return settings in flat format (default: @@ -1442,7 +1396,6 @@ class IndicesClient(NamespacedClient): """ Creates or updates an index template. - ``_ :arg name: The name of the template :arg body: The template definition @@ -1470,7 +1423,6 @@ class IndicesClient(NamespacedClient): Simulate matching the given index name against the index templates in the system - ``_ :arg name: The name of the index (it must be a concrete index name) @@ -1499,7 +1451,6 @@ class IndicesClient(NamespacedClient): """ Returns data streams. - ``_ :arg name: A comma-separated list of data streams to get; use `*` to get all data streams @@ -1516,7 +1467,6 @@ class IndicesClient(NamespacedClient): """ Simulate resolving the given template name or body - ``_ :arg body: New index template definition to be simulated, if no index template name is specified @@ -1541,7 +1491,6 @@ class IndicesClient(NamespacedClient): """ Returns information about any matching indices, aliases, and data streams - ``_ .. warning:: @@ -1572,7 +1521,6 @@ class IndicesClient(NamespacedClient): """ Adds a block to an index. - ``_ :arg index: A comma separated list of indices to add a block to :arg block: The block to add (one of read, write, read_only or @@ -1601,7 +1549,6 @@ class IndicesClient(NamespacedClient): """ Provides statistics on operations happening in a data stream. - ``_ :arg name: A comma-separated list of data stream names; use `_all` or empty string to perform the operation on all data streams @@ -1619,7 +1566,6 @@ class IndicesClient(NamespacedClient): Promotes a data stream from a replicated data stream managed by CCR to a regular data stream - ``_ :arg name: The name of the data stream """ @@ -1638,7 +1584,6 @@ class IndicesClient(NamespacedClient): """ Migrates an alias to a data stream - ``_ :arg name: The name of the alias to migrate """ @@ -1663,7 +1608,6 @@ class IndicesClient(NamespacedClient): """ Analyzes the disk usage of each field of an index or data stream - ``_ .. warning:: @@ -1699,7 +1643,6 @@ class IndicesClient(NamespacedClient): """ Returns the field usage stats for each field of an index - ``_ .. warning:: diff --git a/elasticsearch/client/ingest.py b/elasticsearch/client/ingest.py index 5c1a4a70..54b2cada 100644 --- a/elasticsearch/client/ingest.py +++ b/elasticsearch/client/ingest.py @@ -33,7 +33,6 @@ class IngestClient(NamespacedClient): """ Returns a pipeline. - ``_ :arg id: Comma separated list of pipeline ids. Wildcards supported @@ -51,7 +50,6 @@ class IngestClient(NamespacedClient): """ Creates or updates a pipeline. - ``_ :arg id: Pipeline ID :arg body: The ingest definition @@ -76,7 +74,6 @@ class IngestClient(NamespacedClient): """ Deletes a pipeline. - ``_ :arg id: Pipeline ID :arg master_timeout: Explicit operation timeout for connection @@ -98,7 +95,6 @@ class IngestClient(NamespacedClient): """ Allows to simulate a pipeline with example documents. - ``_ :arg body: The simulate definition :arg id: Pipeline ID @@ -121,7 +117,6 @@ class IngestClient(NamespacedClient): """ Returns a list of the built-in patterns. - ``_ """ return self.transport.perform_request( "GET", "/_ingest/processor/grok", params=params, headers=headers @@ -132,7 +127,6 @@ class IngestClient(NamespacedClient): """ Returns statistical information about geoip databases - ``_ """ return self.transport.perform_request( "GET", "/_ingest/geoip/stats", params=params, headers=headers diff --git a/elasticsearch/client/nodes.py b/elasticsearch/client/nodes.py index 776cb3e3..86b4f981 100644 --- a/elasticsearch/client/nodes.py +++ b/elasticsearch/client/nodes.py @@ -35,7 +35,6 @@ class NodesClient(NamespacedClient): """ Reloads secure settings. - ``_ :arg body: An object containing the password for the elasticsearch keystore @@ -57,7 +56,6 @@ class NodesClient(NamespacedClient): """ Returns information about nodes in the cluster. - ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from @@ -91,7 +89,6 @@ class NodesClient(NamespacedClient): """ Returns statistical information about nodes in the cluster. - ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from @@ -139,7 +136,6 @@ class NodesClient(NamespacedClient): """ Returns information about hot threads on each node in the cluster. - ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from @@ -173,7 +169,6 @@ class NodesClient(NamespacedClient): """ Returns low-level information about REST actions usage on nodes. - ``_ :arg node_id: A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from diff --git a/elasticsearch/client/remote.py b/elasticsearch/client/remote.py index ff772f06..d6d0b79b 100644 --- a/elasticsearch/client/remote.py +++ b/elasticsearch/client/remote.py @@ -30,9 +30,6 @@ from .utils import NamespacedClient, query_params class RemoteClient(NamespacedClient): @query_params() def info(self, params=None, headers=None): - """ - ``_ - """ return self.transport.perform_request( "GET", "/_remote/info", params=params, headers=headers ) diff --git a/elasticsearch/client/snapshot.py b/elasticsearch/client/snapshot.py index 10f96487..482c5cfe 100644 --- a/elasticsearch/client/snapshot.py +++ b/elasticsearch/client/snapshot.py @@ -33,7 +33,6 @@ class SnapshotClient(NamespacedClient): """ Creates a snapshot in a repository. - ``_ :arg repository: A repository name :arg snapshot: A snapshot name @@ -60,7 +59,6 @@ class SnapshotClient(NamespacedClient): """ Deletes a snapshot. - ``_ :arg repository: A repository name :arg snapshot: A snapshot name @@ -89,7 +87,6 @@ class SnapshotClient(NamespacedClient): """ Returns information about a snapshot. - ``_ :arg repository: A repository name :arg snapshot: A comma-separated list of snapshot names @@ -121,7 +118,6 @@ class SnapshotClient(NamespacedClient): """ Deletes a repository. - ``_ :arg repository: Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. @@ -144,7 +140,6 @@ class SnapshotClient(NamespacedClient): """ Returns information about a repository. - ``_ :arg repository: A comma-separated list of repository names :arg local: Return local information, do not retrieve the state @@ -161,7 +156,6 @@ class SnapshotClient(NamespacedClient): """ Creates a repository. - ``_ :arg repository: A repository name :arg body: The repository definition @@ -187,7 +181,6 @@ class SnapshotClient(NamespacedClient): """ Restores a snapshot. - ``_ :arg repository: A repository name :arg snapshot: A snapshot name @@ -214,7 +207,6 @@ class SnapshotClient(NamespacedClient): """ Returns information about the status of a snapshot. - ``_ :arg repository: A repository name :arg snapshot: A comma-separated list of snapshot names @@ -236,7 +228,6 @@ class SnapshotClient(NamespacedClient): """ Verifies a repository. - ``_ :arg repository: A repository name :arg master_timeout: Explicit operation timeout for connection @@ -258,7 +249,6 @@ class SnapshotClient(NamespacedClient): """ Removes stale data from repository. - ``_ :arg repository: A repository name :arg master_timeout: Explicit operation timeout for connection @@ -282,7 +272,6 @@ class SnapshotClient(NamespacedClient): """ Clones indices from one snapshot into another snapshot in the same repository. - ``_ :arg repository: A repository name :arg snapshot: The name of the snapshot to clone from @@ -320,7 +309,6 @@ class SnapshotClient(NamespacedClient): """ Analyzes a repository for correctness and performance - ``_ :arg repository: A repository name :arg blob_count: Number of blobs to create during the test. diff --git a/elasticsearch/client/tasks.py b/elasticsearch/client/tasks.py index dfd8a135..522dade3 100644 --- a/elasticsearch/client/tasks.py +++ b/elasticsearch/client/tasks.py @@ -43,7 +43,6 @@ class TasksClient(NamespacedClient): """ Returns a list of tasks. - ``_ .. warning:: @@ -73,7 +72,6 @@ class TasksClient(NamespacedClient): """ Cancels a task, if it can be cancelled through an API. - ``_ .. warning:: @@ -105,7 +103,6 @@ class TasksClient(NamespacedClient): """ Returns information about a task. - ``_ .. warning:: diff --git a/elasticsearch/connection/base.py b/elasticsearch/connection/base.py index 962f0a78..3bf57cd7 100644 --- a/elasticsearch/connection/base.py +++ b/elasticsearch/connection/base.py @@ -346,7 +346,7 @@ class Connection(object): def _get_api_key_header_val(self, api_key): """ Check the type of the passed api_key and return the correct header value - for the `API Key authentication ` + for the API Key authentication :arg api_key, either a tuple or a base64 encoded string """ if isinstance(api_key, (tuple, list)): diff --git a/noxfile.py b/noxfile.py index 162fc386..8801499f 100644 --- a/noxfile.py +++ b/noxfile.py @@ -86,5 +86,3 @@ def docs(session): "-rdev-requirements.txt", "sphinx-rtd-theme", "sphinx-autodoc-typehints" ) session.run("python", "-m", "pip", "install", "sphinx-autodoc-typehints") - - session.run("sphinx-build", "docs/sphinx/", "docs/sphinx/_build", "-b", "html") diff --git a/setup.cfg b/setup.cfg index 59d36e29..a4b0884a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,8 +1,3 @@ -[build_sphinx] -source-dir = docs/ -build-dir = docs/_build -all_files = 1 - [bdist_wheel] universal = 1