From 82cebac2212a3f9a85e51705c2c2d74a95ac78b9 Mon Sep 17 00:00:00 2001 From: AbitraryYu Date: Tue, 23 Apr 2024 10:16:52 +0800 Subject: [PATCH 1/5] Added Tests for Notification and Search Pipeline.ml Signed-off-by: AbitraryYu --- .ci/test-matrix.yml | 4 +- .github/CODEOWNERS | 2 +- .github/workflows/ci.yml | 20 +- .github/workflows/docs.yml | 4 +- .github/workflows/release-drafter.yml | 3 + .github/workflows/test.yml | 5 +- .github/workflows/unified-release.yml | 2 +- .github/workflows/update_api.yml | 53 + .readthedocs.yml | 2 +- CHANGELOG.md | 40 +- COMPATIBILITY.md | 2 +- DEVELOPER_GUIDE.md | 4 +- benchmarks/poetry.lock | 263 +- benchmarks/pyproject.toml | 2 +- dev-requirements.txt | 8 +- docs/source/api-ref/metrics.md | 14 + guides/ssl.md | 36 +- noxfile.py | 9 +- opensearchpy/__init__.py | 4 + opensearchpy/_async/client/__init__.py | 2117 +++++++++++------ opensearchpy/_async/client/cat.py | 568 ++++- opensearchpy/_async/client/cluster.py | 613 ++++- .../_async/client/dangling_indices.py | 73 +- opensearchpy/_async/client/indices.py | 1885 +++++++++++---- opensearchpy/_async/client/ingest.py | 128 +- opensearchpy/_async/client/nodes.py | 176 +- opensearchpy/_async/client/plugins.py | 4 + opensearchpy/_async/client/remote_store.py | 20 +- opensearchpy/_async/client/search_pipeline.py | 151 ++ opensearchpy/_async/client/security.py | 581 ++++- opensearchpy/_async/client/snapshot.py | 347 ++- opensearchpy/_async/client/tasks.py | 114 +- opensearchpy/_async/compat.py | 18 +- opensearchpy/_async/plugins/alerting.py | 8 +- opensearchpy/_async/plugins/knn.py | 383 +++ opensearchpy/_async/plugins/notifications.py | 326 +++ opensearchpy/_async/transport.py | 6 +- opensearchpy/_version.py | 2 +- opensearchpy/client/__init__.py | 2117 +++++++++++------ opensearchpy/client/cat.py | 568 ++++- opensearchpy/client/cluster.py | 613 ++++- opensearchpy/client/dangling_indices.py | 73 +- opensearchpy/client/indices.py | 1885 +++++++++++---- opensearchpy/client/ingest.py | 128 +- opensearchpy/client/nodes.py | 176 +- opensearchpy/client/plugins.py | 4 + opensearchpy/client/remote_store.py | 20 +- opensearchpy/client/search_pipeline.py | 151 ++ opensearchpy/client/security.py | 581 ++++- opensearchpy/client/snapshot.py | 347 ++- opensearchpy/client/tasks.py | 114 +- opensearchpy/connection/http_requests.py | 10 + opensearchpy/connection/http_urllib3.py | 11 + opensearchpy/helpers/analysis.py | 10 +- opensearchpy/metrics/__init__.py | 18 + opensearchpy/metrics/metrics.py | 42 + opensearchpy/metrics/metrics_events.py | 61 + opensearchpy/metrics/metrics_none.py | 47 + opensearchpy/plugins/__init__.py | 1 - opensearchpy/plugins/alerting.py | 8 +- opensearchpy/plugins/knn.py | 383 +++ opensearchpy/plugins/notifications.py | 326 +++ opensearchpy/transport.py | 10 +- samples/poetry.lock | 275 +-- samples/pyproject.toml | 2 +- setup.py | 12 +- .../test_async/test_server/__init__.py | 4 +- .../test_security_plugin.py | 4 +- .../test_client/test_search_pipeline.py | 35 + test_opensearchpy/test_server/__init__.py | 14 +- test_opensearchpy/test_server/test_metrics.py | 117 + .../test_plugins/test_notification.py | 67 + .../test_server/test_rest_api_spec.py | 12 +- utils/build_dists.py | 2 +- utils/changelog_updater.py | 67 + utils/generate_api.py | 287 ++- utils/license_headers.py | 2 +- utils/templates/base | 2 +- 78 files changed, 12932 insertions(+), 3671 deletions(-) create mode 100644 .github/workflows/update_api.yml create mode 100644 docs/source/api-ref/metrics.md create mode 100644 opensearchpy/_async/client/search_pipeline.py create mode 100644 opensearchpy/_async/plugins/knn.py create mode 100644 opensearchpy/_async/plugins/notifications.py create mode 100644 opensearchpy/client/search_pipeline.py create mode 100644 opensearchpy/metrics/__init__.py create mode 100644 opensearchpy/metrics/metrics.py create mode 100644 opensearchpy/metrics/metrics_events.py create mode 100644 opensearchpy/metrics/metrics_none.py create mode 100644 opensearchpy/plugins/knn.py create mode 100644 opensearchpy/plugins/notifications.py create mode 100644 test_opensearchpy/test_client/test_search_pipeline.py create mode 100644 test_opensearchpy/test_server/test_metrics.py create mode 100644 test_opensearchpy/test_server/test_plugins/test_notification.py create mode 100644 utils/changelog_updater.py diff --git a/.ci/test-matrix.yml b/.ci/test-matrix.yml index d63b57938..63fced43d 100755 --- a/.ci/test-matrix.yml +++ b/.ci/test-matrix.yml @@ -2,11 +2,11 @@ TEST_SUITE: - oss PYTHON_VERSION: - - "3.6" - - "3.7" - "3.8" - "3.9" - "3.10" + - "3.11" + - "3.12" PYTHON_CONNECTION_CLASS: - Urllib3HttpConnection diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 13f8a3497..13ba77364 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +1,2 @@ # This should match the team set up in https://github.com/orgs/opensearch-project/teams and include any additional contributors -* @VachaShah @dblock @harshavamsi @axeoman @deztructor @Shephalimittal @saimedhi @florianvazelle \ No newline at end of file +* @VachaShah @dblock @harshavamsi @axeoman @Shephalimittal @saimedhi @florianvazelle diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af9a4b667..a1e826ccc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,13 +9,13 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v3 - - name: Set up Python 3.7 + - name: Set up Python 3.8 uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.8 - name: Install dependencies run: | - python3.7 -m pip install nox + python3.8 -m pip install nox - name: Lint the code run: nox -s lint @@ -24,13 +24,13 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v3 - - name: Set up Python 3.7 + - name: Set up Python 3.8 uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.8 - name: Install dependencies run: | - python3.7 -m pip install nox + python3.8 -m pip install nox - name: Run the api generator run: nox -s generate @@ -39,16 +39,16 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v3 - - name: Set up Python 3.7 + - name: Set up Python 3.8 uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.8 - name: Install build tools run: | - python3.7 -m pip install --upgrade build + python3.8 -m pip install --upgrade build - name: Build project for distribution run: | - python3.7 -m build + python3.8 -m build twine-check: runs-on: ubuntu-latest diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 333c39022..96105baec 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,11 +8,11 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.8 - name: Install Dependencies run: | - python3.7 -m pip install nox + python3.8 -m pip install nox - name: Make run: | diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index fe8cb0cab..f634fd827 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -8,6 +8,9 @@ on: jobs: draft-a-release: runs-on: ubuntu-latest + permissions: + contents: write + issues: write steps: - name: Checkout Repository uses: actions/checkout@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 40013d62a..39c5123e2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,14 +7,15 @@ jobs: strategy: matrix: entry: - - { os: 'ubuntu-20.04', python-version: "3.6" } - - { os: 'ubuntu-latest', python-version: "3.7" } - { os: 'ubuntu-latest', python-version: "3.8" } - { os: 'ubuntu-latest', python-version: "3.9" } - { os: 'ubuntu-latest', python-version: "3.10" } - { os: 'ubuntu-latest', python-version: "3.11" } - { os: 'macos-latest', python-version: "3.11" } - { os: 'windows-latest', python-version: "3.11" } + - { os: 'ubuntu-latest', python-version: "3.12" } + - { os: 'macos-latest', python-version: "3.12" } + - { os: 'windows-latest', python-version: "3.12" } name: test (os=${{ matrix.entry.os }}, python=${{ matrix.entry.python-version }}) continue-on-error: ${{ matrix.entry.experimental || false }} diff --git a/.github/workflows/unified-release.yml b/.github/workflows/unified-release.yml index 8a812578f..c84fba23d 100644 --- a/.github/workflows/unified-release.yml +++ b/.github/workflows/unified-release.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - stack_version: ['2.4.3'] + stack_version: ['2.5.0'] steps: - name: Checkout diff --git a/.github/workflows/update_api.yml b/.github/workflows/update_api.yml new file mode 100644 index 000000000..2cc4f298d --- /dev/null +++ b/.github/workflows/update_api.yml @@ -0,0 +1,53 @@ +name: Update API +on: + workflow_dispatch: + schedule: + - cron: "30 3 * * *" +jobs: + update-api: + if: ${{ github.repository == 'opensearch-project/opensearch-py' }} + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + - name: Config git to rebase + run: git config --global pull.rebase true + - name: Set up Python 3.8 + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python3.8 -m pip install nox + - name: Generate API + run: nox -s generate + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + - name: GitHub App token + id: github_app_token + uses: tibdex/github-app-token@v1.5.0 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + installation_id: 22958780 + - name: Create pull request + id: cpr + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ steps.github_app_token.outputs.token }} + commit-message: Updated opensearch-py to reflect the latest OpenSearch API spec (${{ steps.date.outputs.date }}) + title: Updated opensearch-py to reflect the latest OpenSearch API spec + body: | + Updated [opensearch-py](https://github.com/opensearch-project/opensearch-py) to reflect the latest [OpenSearch API spec](https://github.com/opensearch-project/opensearch-api-specification/releases/download/main/opensearch-openapi.yaml) + Date: ${{ steps.date.outputs.date }} + branch: automated-api-update + base: main + signoff: true + labels: | + autocut \ No newline at end of file diff --git a/.readthedocs.yml b/.readthedocs.yml index a3353d9ba..145d7a993 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,7 +1,7 @@ version: 2 python: - version: 3.7 + version: 3.8 install: - method: pip path: . diff --git a/CHANGELOG.md b/CHANGELOG.md index f4ce00af0..685d81f77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,15 +3,39 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## [Unreleased] ### Added -- Added pylint `assignment-from-no-return` and `unused-variable` (([#658](https://github.com/opensearch-project/opensearch-py/pull/658)) -- Added pylint `unnecessary-dunder-calls` (([#655](https://github.com/opensearch-project/opensearch-py/pull/655)) -- Changed to use .pylintrc files in root and any directory with override requirements (([#654](https://github.com/opensearch-project/opensearch-py/pull/654)) -- Added pylint `unspecified-encoding` and `missing-function-docstring` and ignored opensearchpy for lints (([#643](https://github.com/opensearch-project/opensearch-py/pull/643))) +- Added support for Python 3.12 ([#717](https://github.com/opensearch-project/opensearch-py/pull/717)) +- Added service time metrics ([#716](https://github.com/opensearch-project/opensearch-py/pull/716)) +- Added `search_pipeline` APIs and `notifications` plugin APIs ([#724](https://github.com/opensearch-project/opensearch-py/pull/724)) +### Changed +### Deprecated +### Removed +- Removed support for Python 3.6, 3.7 ([#717](https://github.com/opensearch-project/opensearch-py/pull/717)) +### Fixed +- Updated code generator to use native OpenAPI specification ([#721](https://github.com/opensearch-project/opensearch-py/pull/721)) +### Updated APIs +- Updated opensearch-py APIs to reflect [opensearch-api-specification@fe6f977](https://github.com/opensearch-project/opensearch-api-specification/commit/fe6f977bcae4e27a2b261fb9599884df5606c0bc) +- Updated opensearch-py APIs to reflect [opensearch-api-specification@29faff0](https://github.com/opensearch-project/opensearch-api-specification/commit/29faff0709b2557acfd4c3c7e053a2c313413633) +### Security +### Dependencies +- Bumps `aiohttp` from >=3,<4 to >=3.9.2,<4 ([#717](https://github.com/opensearch-project/opensearch-py/pull/717)) +- Bumps `black` to >=24.3.0 ([#717](https://github.com/opensearch-project/opensearch-py/pull/717)) +- Bumps `pytest-asyncio` from <=0.23.5 to <=0.23.6 + +## [2.5.0] +### Added +- Added pylint `assignment-from-no-return` and `unused-variable` ([#658](https://github.com/opensearch-project/opensearch-py/pull/658)) +- Added pylint `unnecessary-dunder-calls` ([#655](https://github.com/opensearch-project/opensearch-py/pull/655)) +- Changed to use .pylintrc files in root and any directory with override requirements ([#654](https://github.com/opensearch-project/opensearch-py/pull/654)) +- Added pylint `unspecified-encoding` and `missing-function-docstring` and ignored opensearchpy for lints ([#643](https://github.com/opensearch-project/opensearch-py/pull/643)) - Added pylint `line-too-long` and `invalid-name` ([#590](https://github.com/opensearch-project/opensearch-py/pull/590)) - Added pylint `pointless-statement` ([#611](https://github.com/opensearch-project/opensearch-py/pull/611)) - Added a log collection guide ([#579](https://github.com/opensearch-project/opensearch-py/pull/579)) - Added GHA release ([#614](https://github.com/opensearch-project/opensearch-py/pull/614)) - Incorporated API generation into CI workflow and fixed 'generate' nox session ([#660](https://github.com/opensearch-project/opensearch-py/pull/660)) +- Added an automated api update bot for opensearch-py ([#664](https://github.com/opensearch-project/opensearch-py/pull/664)) +- Enhance generator to generate plugins ([#700](https://github.com/opensearch-project/opensearch-py/pull/700)) +- Enhance generator to update changelog only if generated code differs from existing ([#684](https://github.com/opensearch-project/opensearch-py/pull/684)) +- Added guide for configuring ssl_assert_hostname ([#694](https://github.com/opensearch-project/opensearch-py/pull/694)) ### Changed - Updated the `get_policy` API in the index_management plugin to allow the policy_id argument as optional ([#633](https://github.com/opensearch-project/opensearch-py/pull/633)) - Updated the `point_in_time.md` guide with examples demonstrating the usage of the new APIs as alternatives to the deprecated ones. ([#661](https://github.com/opensearch-project/opensearch-py/pull/661)) @@ -21,9 +45,12 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Fixed - Fix KeyError when scroll return no hits ([#616](https://github.com/opensearch-project/opensearch-py/pull/616)) - Fix reuse of `OpenSearch` using `Urllib3HttpConnection` and `AsyncOpenSearch` after calling `close` ([#639](https://github.com/opensearch-project/opensearch-py/pull/639)) +### Updated APIs +- Updated opensearch-py APIs to reflect [opensearch-api-specification@3763fdd](https://github.com/opensearch-project/opensearch-api-specification/commit/3763fdd051889c26e4f865734501c483d429de9f) +- Updated opensearch-py APIs to reflect [opensearch-api-specification@1787056](https://github.com/opensearch-project/opensearch-api-specification/commit/178705681e5fd812ab59ad00cefa04146d03d7ad) ### Security ### Dependencies -- Bumps `pytest-asyncio` from <=0.21.1 to <=0.23.4 +- Bumps `pytest-asyncio` from <=0.21.1 to <=0.23.5 - Bumps `urllib3` from >=1.26.18 to >=1.26.18, <2 ([#632](https://github.com/opensearch-project/opensearch-py/pull/632)) ## [2.4.2] @@ -208,7 +235,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Fixed Wrong return type hint in `async_scan` ([520](https://github.com/opensearch-project/opensearch-py/pull/520)) ### Security -[Unreleased]: https://github.com/opensearch-project/opensearch-py/compare/v2.4.2...HEAD +[Unreleased]: https://github.com/opensearch-project/opensearch-py/compare/v2.5.0...HEAD +[2.5.0]: https://github.com/opensearch-project/opensearch-py/compare/v2.4.2...v2.5.0 [2.4.2]: https://github.com/opensearch-project/opensearch-py/compare/v2.4.0...v2.4.2 [2.4.1]: https://github.com/opensearch-project/opensearch-py/compare/v2.4.0...v2.4.1 [2.4.0]: https://github.com/opensearch-project/opensearch-py/compare/v2.3.2...v2.4.0 diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md index 39dba02bd..7f986025e 100644 --- a/COMPATIBILITY.md +++ b/COMPATIBILITY.md @@ -9,7 +9,7 @@ The below matrix shows the compatibility of the [`opensearch-py`](https://pypi.o | --- | --- | --- | | 1.0.0 | 1.0.0-1.2.4 | | | 1.1.0 | 1.3.0-1.3.7 | | -| 2.x.x | 1.0.0-2.11.0 | client works against OpenSearch 1.x as long as features removed in 2.0 are not used | +| 2.x.x | 1.0.0-2.11.1 | client works against OpenSearch 1.x as long as features removed in 2.0 are not used | ## Upgrading diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index ee788e499..cf566e20a 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -10,7 +10,7 @@ ## Prerequisites -Python 3.6 or newer is required. +Python 3.8 or newer is required. ``` $ python --version @@ -125,7 +125,7 @@ Open `docs/build/html/index.html` to see results. ## Client Code Generator -OpenSearch publishes an [OpenAPI specification](https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json) in the [opensearch-api-specification](https://github.com/opensearch-project/opensearch-api-specification) repository, which is used to auto-generate the less interesting parts of the client. +OpenSearch publishes an [OpenAPI specification](https://github.com/opensearch-project/opensearch-api-specification/releases/download/main/opensearch-openapi.yaml) in the [opensearch-api-specification](https://github.com/opensearch-project/opensearch-api-specification) repository, which is used to auto-generate the less interesting parts of the client. ``` nox -rs generate diff --git a/benchmarks/poetry.lock b/benchmarks/poetry.lock index d4c2e4a84..841f5dc7d 100644 --- a/benchmarks/poetry.lock +++ b/benchmarks/poetry.lock @@ -1,114 +1,100 @@ -# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "aiohttp" -version = "3.8.6" +version = "3.9.3" description = "Async http client/server framework (asyncio)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "aiohttp-3.8.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:41d55fc043954cddbbd82503d9cc3f4814a40bcef30b3569bc7b5e34130718c1"}, - {file = "aiohttp-3.8.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1d84166673694841d8953f0a8d0c90e1087739d24632fe86b1a08819168b4566"}, - {file = "aiohttp-3.8.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:253bf92b744b3170eb4c4ca2fa58f9c4b87aeb1df42f71d4e78815e6e8b73c9e"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3fd194939b1f764d6bb05490987bfe104287bbf51b8d862261ccf66f48fb4096"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6c5f938d199a6fdbdc10bbb9447496561c3a9a565b43be564648d81e1102ac22"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2817b2f66ca82ee699acd90e05c95e79bbf1dc986abb62b61ec8aaf851e81c93"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0fa375b3d34e71ccccf172cab401cd94a72de7a8cc01847a7b3386204093bb47"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9de50a199b7710fa2904be5a4a9b51af587ab24c8e540a7243ab737b45844543"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e1d8cb0b56b3587c5c01de3bf2f600f186da7e7b5f7353d1bf26a8ddca57f965"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:8e31e9db1bee8b4f407b77fd2507337a0a80665ad7b6c749d08df595d88f1cf5"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:7bc88fc494b1f0311d67f29fee6fd636606f4697e8cc793a2d912ac5b19aa38d"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:ec00c3305788e04bf6d29d42e504560e159ccaf0be30c09203b468a6c1ccd3b2"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ad1407db8f2f49329729564f71685557157bfa42b48f4b93e53721a16eb813ed"}, - {file = "aiohttp-3.8.6-cp310-cp310-win32.whl", hash = "sha256:ccc360e87341ad47c777f5723f68adbb52b37ab450c8bc3ca9ca1f3e849e5fe2"}, - {file = "aiohttp-3.8.6-cp310-cp310-win_amd64.whl", hash = "sha256:93c15c8e48e5e7b89d5cb4613479d144fda8344e2d886cf694fd36db4cc86865"}, - {file = "aiohttp-3.8.6-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6e2f9cc8e5328f829f6e1fb74a0a3a939b14e67e80832975e01929e320386b34"}, - {file = "aiohttp-3.8.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e6a00ffcc173e765e200ceefb06399ba09c06db97f401f920513a10c803604ca"}, - {file = "aiohttp-3.8.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:41bdc2ba359032e36c0e9de5a3bd00d6fb7ea558a6ce6b70acedf0da86458321"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:14cd52ccf40006c7a6cd34a0f8663734e5363fd981807173faf3a017e202fec9"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2d5b785c792802e7b275c420d84f3397668e9d49ab1cb52bd916b3b3ffcf09ad"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1bed815f3dc3d915c5c1e556c397c8667826fbc1b935d95b0ad680787896a358"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:96603a562b546632441926cd1293cfcb5b69f0b4159e6077f7c7dbdfb686af4d"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d76e8b13161a202d14c9584590c4df4d068c9567c99506497bdd67eaedf36403"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e3f1e3f1a1751bb62b4a1b7f4e435afcdade6c17a4fd9b9d43607cebd242924a"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:76b36b3124f0223903609944a3c8bf28a599b2cc0ce0be60b45211c8e9be97f8"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:a2ece4af1f3c967a4390c284797ab595a9f1bc1130ef8b01828915a05a6ae684"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:16d330b3b9db87c3883e565340d292638a878236418b23cc8b9b11a054aaa887"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:42c89579f82e49db436b69c938ab3e1559e5a4409eb8639eb4143989bc390f2f"}, - {file = "aiohttp-3.8.6-cp311-cp311-win32.whl", hash = "sha256:efd2fcf7e7b9d7ab16e6b7d54205beded0a9c8566cb30f09c1abe42b4e22bdcb"}, - {file = "aiohttp-3.8.6-cp311-cp311-win_amd64.whl", hash = "sha256:3b2ab182fc28e7a81f6c70bfbd829045d9480063f5ab06f6e601a3eddbbd49a0"}, - {file = "aiohttp-3.8.6-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:fdee8405931b0615220e5ddf8cd7edd8592c606a8e4ca2a00704883c396e4479"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d25036d161c4fe2225d1abff2bd52c34ed0b1099f02c208cd34d8c05729882f0"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5d791245a894be071d5ab04bbb4850534261a7d4fd363b094a7b9963e8cdbd31"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0cccd1de239afa866e4ce5c789b3032442f19c261c7d8a01183fd956b1935349"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1f13f60d78224f0dace220d8ab4ef1dbc37115eeeab8c06804fec11bec2bbd07"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8a9b5a0606faca4f6cc0d338359d6fa137104c337f489cd135bb7fbdbccb1e39"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:13da35c9ceb847732bf5c6c5781dcf4780e14392e5d3b3c689f6d22f8e15ae31"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:4d4cbe4ffa9d05f46a28252efc5941e0462792930caa370a6efaf491f412bc66"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:229852e147f44da0241954fc6cb910ba074e597f06789c867cb7fb0621e0ba7a"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:713103a8bdde61d13490adf47171a1039fd880113981e55401a0f7b42c37d071"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:45ad816b2c8e3b60b510f30dbd37fe74fd4a772248a52bb021f6fd65dff809b6"}, - {file = "aiohttp-3.8.6-cp36-cp36m-win32.whl", hash = "sha256:2b8d4e166e600dcfbff51919c7a3789ff6ca8b3ecce16e1d9c96d95dd569eb4c"}, - {file = "aiohttp-3.8.6-cp36-cp36m-win_amd64.whl", hash = "sha256:0912ed87fee967940aacc5306d3aa8ba3a459fcd12add0b407081fbefc931e53"}, - {file = "aiohttp-3.8.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e2a988a0c673c2e12084f5e6ba3392d76c75ddb8ebc6c7e9ead68248101cd446"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ebf3fd9f141700b510d4b190094db0ce37ac6361a6806c153c161dc6c041ccda"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3161ce82ab85acd267c8f4b14aa226047a6bee1e4e6adb74b798bd42c6ae1f80"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d95fc1bf33a9a81469aa760617b5971331cdd74370d1214f0b3109272c0e1e3c"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c43ecfef7deaf0617cee936836518e7424ee12cb709883f2c9a1adda63cc460"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca80e1b90a05a4f476547f904992ae81eda5c2c85c66ee4195bb8f9c5fb47f28"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:90c72ebb7cb3a08a7f40061079817133f502a160561d0675b0a6adf231382c92"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:bb54c54510e47a8c7c8e63454a6acc817519337b2b78606c4e840871a3e15349"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:de6a1c9f6803b90e20869e6b99c2c18cef5cc691363954c93cb9adeb26d9f3ae"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:a3628b6c7b880b181a3ae0a0683698513874df63783fd89de99b7b7539e3e8a8"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:fc37e9aef10a696a5a4474802930079ccfc14d9f9c10b4662169671ff034b7df"}, - {file = "aiohttp-3.8.6-cp37-cp37m-win32.whl", hash = "sha256:f8ef51e459eb2ad8e7a66c1d6440c808485840ad55ecc3cafefadea47d1b1ba2"}, - {file = "aiohttp-3.8.6-cp37-cp37m-win_amd64.whl", hash = "sha256:b2fe42e523be344124c6c8ef32a011444e869dc5f883c591ed87f84339de5976"}, - {file = "aiohttp-3.8.6-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:9e2ee0ac5a1f5c7dd3197de309adfb99ac4617ff02b0603fd1e65b07dc772e4b"}, - {file = "aiohttp-3.8.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:01770d8c04bd8db568abb636c1fdd4f7140b284b8b3e0b4584f070180c1e5c62"}, - {file = "aiohttp-3.8.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:3c68330a59506254b556b99a91857428cab98b2f84061260a67865f7f52899f5"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:89341b2c19fb5eac30c341133ae2cc3544d40d9b1892749cdd25892bbc6ac951"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:71783b0b6455ac8f34b5ec99d83e686892c50498d5d00b8e56d47f41b38fbe04"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f628dbf3c91e12f4d6c8b3f092069567d8eb17814aebba3d7d60c149391aee3a"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b04691bc6601ef47c88f0255043df6f570ada1a9ebef99c34bd0b72866c217ae"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7ee912f7e78287516df155f69da575a0ba33b02dd7c1d6614dbc9463f43066e3"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9c19b26acdd08dd239e0d3669a3dddafd600902e37881f13fbd8a53943079dbc"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:99c5ac4ad492b4a19fc132306cd57075c28446ec2ed970973bbf036bcda1bcc6"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:f0f03211fd14a6a0aed2997d4b1c013d49fb7b50eeb9ffdf5e51f23cfe2c77fa"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:8d399dade330c53b4106160f75f55407e9ae7505263ea86f2ccca6bfcbdb4921"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ec4fd86658c6a8964d75426517dc01cbf840bbf32d055ce64a9e63a40fd7b771"}, - {file = "aiohttp-3.8.6-cp38-cp38-win32.whl", hash = "sha256:33164093be11fcef3ce2571a0dccd9041c9a93fa3bde86569d7b03120d276c6f"}, - {file = "aiohttp-3.8.6-cp38-cp38-win_amd64.whl", hash = "sha256:bdf70bfe5a1414ba9afb9d49f0c912dc524cf60141102f3a11143ba3d291870f"}, - {file = "aiohttp-3.8.6-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:d52d5dc7c6682b720280f9d9db41d36ebe4791622c842e258c9206232251ab2b"}, - {file = "aiohttp-3.8.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4ac39027011414dbd3d87f7edb31680e1f430834c8cef029f11c66dad0670aa5"}, - {file = "aiohttp-3.8.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3f5c7ce535a1d2429a634310e308fb7d718905487257060e5d4598e29dc17f0b"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b30e963f9e0d52c28f284d554a9469af073030030cef8693106d918b2ca92f54"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:918810ef188f84152af6b938254911055a72e0f935b5fbc4c1a4ed0b0584aed1"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:002f23e6ea8d3dd8d149e569fd580c999232b5fbc601c48d55398fbc2e582e8c"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4fcf3eabd3fd1a5e6092d1242295fa37d0354b2eb2077e6eb670accad78e40e1"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:255ba9d6d5ff1a382bb9a578cd563605aa69bec845680e21c44afc2670607a95"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d67f8baed00870aa390ea2590798766256f31dc5ed3ecc737debb6e97e2ede78"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:86f20cee0f0a317c76573b627b954c412ea766d6ada1a9fcf1b805763ae7feeb"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:39a312d0e991690ccc1a61f1e9e42daa519dcc34ad03eb6f826d94c1190190dd"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:e827d48cf802de06d9c935088c2924e3c7e7533377d66b6f31ed175c1620e05e"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:bd111d7fc5591ddf377a408ed9067045259ff2770f37e2d94e6478d0f3fc0c17"}, - {file = "aiohttp-3.8.6-cp39-cp39-win32.whl", hash = "sha256:caf486ac1e689dda3502567eb89ffe02876546599bbf915ec94b1fa424eeffd4"}, - {file = "aiohttp-3.8.6-cp39-cp39-win_amd64.whl", hash = "sha256:3f0e27e5b733803333bb2371249f41cf42bae8884863e8e8965ec69bebe53132"}, - {file = "aiohttp-3.8.6.tar.gz", hash = "sha256:b0cf2a4501bff9330a8a5248b4ce951851e415bdcce9dc158e76cfd55e15085c"}, + {file = "aiohttp-3.9.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:939677b61f9d72a4fa2a042a5eee2a99a24001a67c13da113b2e30396567db54"}, + {file = "aiohttp-3.9.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1f5cd333fcf7590a18334c90f8c9147c837a6ec8a178e88d90a9b96ea03194cc"}, + {file = "aiohttp-3.9.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:82e6aa28dd46374f72093eda8bcd142f7771ee1eb9d1e223ff0fa7177a96b4a5"}, + {file = "aiohttp-3.9.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f56455b0c2c7cc3b0c584815264461d07b177f903a04481dfc33e08a89f0c26b"}, + {file = "aiohttp-3.9.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bca77a198bb6e69795ef2f09a5f4c12758487f83f33d63acde5f0d4919815768"}, + {file = "aiohttp-3.9.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e083c285857b78ee21a96ba1eb1b5339733c3563f72980728ca2b08b53826ca5"}, + {file = "aiohttp-3.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ab40e6251c3873d86ea9b30a1ac6d7478c09277b32e14745d0d3c6e76e3c7e29"}, + {file = "aiohttp-3.9.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:df822ee7feaaeffb99c1a9e5e608800bd8eda6e5f18f5cfb0dc7eeb2eaa6bbec"}, + {file = "aiohttp-3.9.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:acef0899fea7492145d2bbaaaec7b345c87753168589cc7faf0afec9afe9b747"}, + {file = "aiohttp-3.9.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:cd73265a9e5ea618014802ab01babf1940cecb90c9762d8b9e7d2cc1e1969ec6"}, + {file = "aiohttp-3.9.3-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:a78ed8a53a1221393d9637c01870248a6f4ea5b214a59a92a36f18151739452c"}, + {file = "aiohttp-3.9.3-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:6b0e029353361f1746bac2e4cc19b32f972ec03f0f943b390c4ab3371840aabf"}, + {file = "aiohttp-3.9.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7cf5c9458e1e90e3c390c2639f1017a0379a99a94fdfad3a1fd966a2874bba52"}, + {file = "aiohttp-3.9.3-cp310-cp310-win32.whl", hash = "sha256:3e59c23c52765951b69ec45ddbbc9403a8761ee6f57253250c6e1536cacc758b"}, + {file = "aiohttp-3.9.3-cp310-cp310-win_amd64.whl", hash = "sha256:055ce4f74b82551678291473f66dc9fb9048a50d8324278751926ff0ae7715e5"}, + {file = "aiohttp-3.9.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6b88f9386ff1ad91ace19d2a1c0225896e28815ee09fc6a8932fded8cda97c3d"}, + {file = "aiohttp-3.9.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c46956ed82961e31557b6857a5ca153c67e5476972e5f7190015018760938da2"}, + {file = "aiohttp-3.9.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:07b837ef0d2f252f96009e9b8435ec1fef68ef8b1461933253d318748ec1acdc"}, + {file = "aiohttp-3.9.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dad46e6f620574b3b4801c68255492e0159d1712271cc99d8bdf35f2043ec266"}, + {file = "aiohttp-3.9.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5ed3e046ea7b14938112ccd53d91c1539af3e6679b222f9469981e3dac7ba1ce"}, + {file = "aiohttp-3.9.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:039df344b45ae0b34ac885ab5b53940b174530d4dd8a14ed8b0e2155b9dddccb"}, + {file = "aiohttp-3.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7943c414d3a8d9235f5f15c22ace69787c140c80b718dcd57caaade95f7cd93b"}, + {file = "aiohttp-3.9.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:84871a243359bb42c12728f04d181a389718710129b36b6aad0fc4655a7647d4"}, + {file = "aiohttp-3.9.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:5eafe2c065df5401ba06821b9a054d9cb2848867f3c59801b5d07a0be3a380ae"}, + {file = "aiohttp-3.9.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:9d3c9b50f19704552f23b4eaea1fc082fdd82c63429a6506446cbd8737823da3"}, + {file = "aiohttp-3.9.3-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:f033d80bc6283092613882dfe40419c6a6a1527e04fc69350e87a9df02bbc283"}, + {file = "aiohttp-3.9.3-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:2c895a656dd7e061b2fd6bb77d971cc38f2afc277229ce7dd3552de8313a483e"}, + {file = "aiohttp-3.9.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1f5a71d25cd8106eab05f8704cd9167b6e5187bcdf8f090a66c6d88b634802b4"}, + {file = "aiohttp-3.9.3-cp311-cp311-win32.whl", hash = "sha256:50fca156d718f8ced687a373f9e140c1bb765ca16e3d6f4fe116e3df7c05b2c5"}, + {file = "aiohttp-3.9.3-cp311-cp311-win_amd64.whl", hash = "sha256:5fe9ce6c09668063b8447f85d43b8d1c4e5d3d7e92c63173e6180b2ac5d46dd8"}, + {file = "aiohttp-3.9.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:38a19bc3b686ad55804ae931012f78f7a534cce165d089a2059f658f6c91fa60"}, + {file = "aiohttp-3.9.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:770d015888c2a598b377bd2f663adfd947d78c0124cfe7b959e1ef39f5b13869"}, + {file = "aiohttp-3.9.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ee43080e75fc92bf36219926c8e6de497f9b247301bbf88c5c7593d931426679"}, + {file = "aiohttp-3.9.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:52df73f14ed99cee84865b95a3d9e044f226320a87af208f068ecc33e0c35b96"}, + {file = "aiohttp-3.9.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc9b311743a78043b26ffaeeb9715dc360335e5517832f5a8e339f8a43581e4d"}, + {file = "aiohttp-3.9.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b955ed993491f1a5da7f92e98d5dad3c1e14dc175f74517c4e610b1f2456fb11"}, + {file = "aiohttp-3.9.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:504b6981675ace64c28bf4a05a508af5cde526e36492c98916127f5a02354d53"}, + {file = "aiohttp-3.9.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a6fe5571784af92b6bc2fda8d1925cccdf24642d49546d3144948a6a1ed58ca5"}, + {file = "aiohttp-3.9.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:ba39e9c8627edc56544c8628cc180d88605df3892beeb2b94c9bc857774848ca"}, + {file = "aiohttp-3.9.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:e5e46b578c0e9db71d04c4b506a2121c0cb371dd89af17a0586ff6769d4c58c1"}, + {file = "aiohttp-3.9.3-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:938a9653e1e0c592053f815f7028e41a3062e902095e5a7dc84617c87267ebd5"}, + {file = "aiohttp-3.9.3-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:c3452ea726c76e92f3b9fae4b34a151981a9ec0a4847a627c43d71a15ac32aa6"}, + {file = "aiohttp-3.9.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:ff30218887e62209942f91ac1be902cc80cddb86bf00fbc6783b7a43b2bea26f"}, + {file = "aiohttp-3.9.3-cp312-cp312-win32.whl", hash = "sha256:38f307b41e0bea3294a9a2a87833191e4bcf89bb0365e83a8be3a58b31fb7f38"}, + {file = "aiohttp-3.9.3-cp312-cp312-win_amd64.whl", hash = "sha256:b791a3143681a520c0a17e26ae7465f1b6f99461a28019d1a2f425236e6eedb5"}, + {file = "aiohttp-3.9.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:0ed621426d961df79aa3b963ac7af0d40392956ffa9be022024cd16297b30c8c"}, + {file = "aiohttp-3.9.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7f46acd6a194287b7e41e87957bfe2ad1ad88318d447caf5b090012f2c5bb528"}, + {file = "aiohttp-3.9.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:feeb18a801aacb098220e2c3eea59a512362eb408d4afd0c242044c33ad6d542"}, + {file = "aiohttp-3.9.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f734e38fd8666f53da904c52a23ce517f1b07722118d750405af7e4123933511"}, + {file = "aiohttp-3.9.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b40670ec7e2156d8e57f70aec34a7216407848dfe6c693ef131ddf6e76feb672"}, + {file = "aiohttp-3.9.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fdd215b7b7fd4a53994f238d0f46b7ba4ac4c0adb12452beee724ddd0743ae5d"}, + {file = "aiohttp-3.9.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:017a21b0df49039c8f46ca0971b3a7fdc1f56741ab1240cb90ca408049766168"}, + {file = "aiohttp-3.9.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e99abf0bba688259a496f966211c49a514e65afa9b3073a1fcee08856e04425b"}, + {file = "aiohttp-3.9.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:648056db9a9fa565d3fa851880f99f45e3f9a771dd3ff3bb0c048ea83fb28194"}, + {file = "aiohttp-3.9.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:8aacb477dc26797ee089721536a292a664846489c49d3ef9725f992449eda5a8"}, + {file = "aiohttp-3.9.3-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:522a11c934ea660ff8953eda090dcd2154d367dec1ae3c540aff9f8a5c109ab4"}, + {file = "aiohttp-3.9.3-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:5bce0dc147ca85caa5d33debc4f4d65e8e8b5c97c7f9f660f215fa74fc49a321"}, + {file = "aiohttp-3.9.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:4b4af9f25b49a7be47c0972139e59ec0e8285c371049df1a63b6ca81fdd216a2"}, + {file = "aiohttp-3.9.3-cp38-cp38-win32.whl", hash = "sha256:298abd678033b8571995650ccee753d9458dfa0377be4dba91e4491da3f2be63"}, + {file = "aiohttp-3.9.3-cp38-cp38-win_amd64.whl", hash = "sha256:69361bfdca5468c0488d7017b9b1e5ce769d40b46a9f4a2eed26b78619e9396c"}, + {file = "aiohttp-3.9.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:0fa43c32d1643f518491d9d3a730f85f5bbaedcbd7fbcae27435bb8b7a061b29"}, + {file = "aiohttp-3.9.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:835a55b7ca49468aaaac0b217092dfdff370e6c215c9224c52f30daaa735c1c1"}, + {file = "aiohttp-3.9.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:06a9b2c8837d9a94fae16c6223acc14b4dfdff216ab9b7202e07a9a09541168f"}, + {file = "aiohttp-3.9.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:abf151955990d23f84205286938796c55ff11bbfb4ccfada8c9c83ae6b3c89a3"}, + {file = "aiohttp-3.9.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:59c26c95975f26e662ca78fdf543d4eeaef70e533a672b4113dd888bd2423caa"}, + {file = "aiohttp-3.9.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f95511dd5d0e05fd9728bac4096319f80615aaef4acbecb35a990afebe953b0e"}, + {file = "aiohttp-3.9.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:595f105710293e76b9dc09f52e0dd896bd064a79346234b521f6b968ffdd8e58"}, + {file = "aiohttp-3.9.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c7c8b816c2b5af5c8a436df44ca08258fc1a13b449393a91484225fcb7545533"}, + {file = "aiohttp-3.9.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:f1088fa100bf46e7b398ffd9904f4808a0612e1d966b4aa43baa535d1b6341eb"}, + {file = "aiohttp-3.9.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f59dfe57bb1ec82ac0698ebfcdb7bcd0e99c255bd637ff613760d5f33e7c81b3"}, + {file = "aiohttp-3.9.3-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:361a1026c9dd4aba0109e4040e2aecf9884f5cfe1b1b1bd3d09419c205e2e53d"}, + {file = "aiohttp-3.9.3-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:363afe77cfcbe3a36353d8ea133e904b108feea505aa4792dad6585a8192c55a"}, + {file = "aiohttp-3.9.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8e2c45c208c62e955e8256949eb225bd8b66a4c9b6865729a786f2aa79b72e9d"}, + {file = "aiohttp-3.9.3-cp39-cp39-win32.whl", hash = "sha256:f7217af2e14da0856e082e96ff637f14ae45c10a5714b63c77f26d8884cf1051"}, + {file = "aiohttp-3.9.3-cp39-cp39-win_amd64.whl", hash = "sha256:27468897f628c627230dba07ec65dc8d0db566923c48f29e084ce382119802bc"}, + {file = "aiohttp-3.9.3.tar.gz", hash = "sha256:90842933e5d1ff760fae6caca4b2b3edba53ba8f4b71e95dacf2818a2aca06f7"}, ] [package.dependencies] aiosignal = ">=1.1.2" -async-timeout = ">=4.0.0a3,<5.0" -asynctest = {version = "0.13.0", markers = "python_version < \"3.8\""} +async-timeout = {version = ">=4.0,<5.0", markers = "python_version < \"3.11\""} attrs = ">=17.3.0" -charset-normalizer = ">=2.0,<4.0" frozenlist = ">=1.1.1" multidict = ">=4.5,<7.0" -typing-extensions = {version = ">=3.7.4", markers = "python_version < \"3.8\""} yarl = ">=1.0,<2.0" [package.extras] -speedups = ["Brotli", "aiodns", "cchardet"] +speedups = ["Brotli", "aiodns", "brotlicffi"] [[package]] name = "aiosignal" @@ -135,20 +121,6 @@ files = [ {file = "async_timeout-4.0.3-py3-none-any.whl", hash = "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028"}, ] -[package.dependencies] -typing-extensions = {version = ">=3.6.5", markers = "python_version < \"3.8\""} - -[[package]] -name = "asynctest" -version = "0.13.0" -description = "Enhance the standard unittest package with features for testing asyncio libraries" -optional = false -python-versions = ">=3.5" -files = [ - {file = "asynctest-0.13.0-py3-none-any.whl", hash = "sha256:5da6118a7e6d6b54d83a8f7197769d046922a44d2a99c21382f0a6e4fadae676"}, - {file = "asynctest-0.13.0.tar.gz", hash = "sha256:c27862842d15d83e6a34eb0b2866c323880eb3a75e4485b079ea11748fd77fac"}, -] - [[package]] name = "attrs" version = "23.1.0" @@ -160,9 +132,6 @@ files = [ {file = "attrs-23.1.0.tar.gz", hash = "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"}, ] -[package.dependencies] -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} - [package.extras] cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] dev = ["attrs[docs,tests]", "pre-commit"] @@ -374,26 +343,6 @@ files = [ {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, ] -[[package]] -name = "importlib-metadata" -version = "6.7.0" -description = "Read metadata from Python packages" -optional = false -python-versions = ">=3.7" -files = [ - {file = "importlib_metadata-6.7.0-py3-none-any.whl", hash = "sha256:cb52082e659e97afc5dac71e79de97d8681de3aa07ff18578330904a9d18e5b5"}, - {file = "importlib_metadata-6.7.0.tar.gz", hash = "sha256:1aaf550d4f73e5d6783e7acb77aec43d49da8017410afae93822cc9cca98c4d4"}, -] - -[package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} -zipp = ">=0.5" - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -perf = ["ipython"] -testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] - [[package]] name = "markdown-it-py" version = "2.2.0" @@ -407,7 +356,6 @@ files = [ [package.dependencies] mdurl = ">=0.1,<1.0" -typing_extensions = {version = ">=3.7.4", markers = "python_version < \"3.8\""} [package.extras] benchmarking = ["psutil", "pytest", "pytest-benchmark"] @@ -515,25 +463,25 @@ files = [ [[package]] name = "opensearch-py" -version = "2.4.3" +version = "2.5.0" description = "Python client for OpenSearch" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4" +python-versions = ">=3.8, <4" files = [] develop = true [package.dependencies] -aiohttp = {version = ">=3,<4", optional = true, markers = "extra == \"async\""} +aiohttp = {version = ">=3.9.2,<4", optional = true, markers = "extra == \"async\""} certifi = ">=2022.12.07" python-dateutil = "*" requests = ">=2.4.0,<3.0.0" six = "*" -urllib3 = ">=1.26.18" +urllib3 = ">=1.26.18,<2" [package.extras] -async = ["aiohttp (>=3,<4)"] -develop = ["black", "botocore", "coverage (<8.0.0)", "jinja2", "mock", "myst_parser", "pytest (>=3.0.0)", "pytest-cov", "pytest-mock (<4.0.0)", "pytz", "pyyaml", "requests (>=2.0.0,<3.0.0)", "sphinx", "sphinx_copybutton", "sphinx_rtd_theme"] -docs = ["aiohttp (>=3,<4)", "myst_parser", "sphinx", "sphinx_copybutton", "sphinx_rtd_theme"] +async = ["aiohttp (>=3.9.2,<4)"] +develop = ["black (>=24.3.0)", "botocore", "coverage (<8.0.0)", "jinja2", "mock", "myst_parser", "pytest (>=3.0.0)", "pytest-cov", "pytest-mock (<4.0.0)", "pytz", "pyyaml", "requests (>=2.0.0,<3.0.0)", "sphinx", "sphinx_copybutton", "sphinx_rtd_theme"] +docs = ["aiohttp (>=3.9.2,<4)", "myst_parser", "sphinx", "sphinx_copybutton", "sphinx_rtd_theme"] kerberos = ["requests_kerberos"] [package.source] @@ -723,20 +671,19 @@ files = [ [[package]] name = "urllib3" -version = "2.0.7" +version = "1.26.18" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false -python-versions = ">=3.7" +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" files = [ - {file = "urllib3-2.0.7-py3-none-any.whl", hash = "sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e"}, - {file = "urllib3-2.0.7.tar.gz", hash = "sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84"}, + {file = "urllib3-1.26.18-py2.py3-none-any.whl", hash = "sha256:34b97092d7e0a3a8cf7cd10e386f401b3737364026c45e622aa02903dffe0f07"}, + {file = "urllib3-1.26.18.tar.gz", hash = "sha256:f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0"}, ] [package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] -secure = ["certifi", "cryptography (>=1.9)", "idna (>=2.0.0)", "pyopenssl (>=17.1.0)", "urllib3-secure-extra"] -socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] -zstd = ["zstandard (>=0.18.0)"] +brotli = ["brotli (==1.0.9)", "brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] +secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] +socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] name = "yarl" @@ -824,24 +771,8 @@ files = [ [package.dependencies] idna = ">=2.0" multidict = ">=4.0" -typing-extensions = {version = ">=3.7.4", markers = "python_version < \"3.8\""} - -[[package]] -name = "zipp" -version = "3.15.0" -description = "Backport of pathlib-compatible object wrapper for zip files" -optional = false -python-versions = ">=3.7" -files = [ - {file = "zipp-3.15.0-py3-none-any.whl", hash = "sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556"}, - {file = "zipp-3.15.0.tar.gz", hash = "sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b"}, -] - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] [metadata] lock-version = "2.0" -python-versions = "^3.7" -content-hash = "84953079e0bc825b495f10721d514529becb4fc8eef2b9772562f63b0bd75ef3" +python-versions = "^3.8" +content-hash = "3844cc1d89b25055357e88cada98b196f1ee5c067166a095dd539f50bbb2ced4" diff --git a/benchmarks/pyproject.toml b/benchmarks/pyproject.toml index 0c4019dbf..5ee165525 100644 --- a/benchmarks/pyproject.toml +++ b/benchmarks/pyproject.toml @@ -7,7 +7,7 @@ license = "Apache 2.0" readme = "README.md" [tool.poetry.dependencies] -python = "^3.7" +python = "^3.8" opensearch-py = { path = "..", develop=true, extras=["async"] } richbench = "*" diff --git a/dev-requirements.txt b/dev-requirements.txt index 8285fc7e5..a38158517 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -8,6 +8,8 @@ sphinx_rtd_theme jinja2 pytz deepmerge +Events +setuptools # No wheels for Python 3.10 yet! numpy; python_version<"3.10" @@ -16,10 +18,10 @@ pandas; python_version<"3.10" pyyaml>=5.4 isort -black +black>=24.3.0 twine # Requirements for testing [async] extra -aiohttp -pytest-asyncio<=0.23.4 +aiohttp>=3.9.2, <4 +pytest-asyncio<=0.23.6 unasync diff --git a/docs/source/api-ref/metrics.md b/docs/source/api-ref/metrics.md new file mode 100644 index 000000000..dd40d986c --- /dev/null +++ b/docs/source/api-ref/metrics.md @@ -0,0 +1,14 @@ +# metrics + +```{eval-rst} +.. autoclass:: opensearchpy.Metrics +``` + +```{eval-rst} +.. autoclass:: opensearchpy.MetricsEvents +``` + +```{eval-rst} +.. autoclass:: opensearchpy.MetricsNone +``` + diff --git a/guides/ssl.md b/guides/ssl.md index 8ee739419..5b9267f22 100644 --- a/guides/ssl.md +++ b/guides/ssl.md @@ -1,7 +1,11 @@ - [SSL](#ssl) + - [Establishing a Secure Connection](#establishing-a-secure-connection) + - [Verifying SSL against a Different Host](#verifying-ssl-against-a-different-host) # SSL +## Establishing a Secure Connection + ```python from opensearchpy import OpenSearch @@ -10,7 +14,7 @@ port = 9200 auth = ('admin', 'admin') # For testing only. Don't store credentials in code. # Provide a CA bundle if you use intermediate CAs with your root CA. -# If this is not given, the CA bundle is is discovered from the first available +# If this is not given, the CA bundle is discovered from the first available # following options: # - OpenSSL environment variables SSL_CERT_FILE and SSL_CERT_DIR # - certifi bundle (https://pypi.org/project/certifi/) @@ -21,7 +25,7 @@ ca_certs_path = '/full/path/to/root-ca.pem' # client_cert_path = '/full/path/to/client.pem' # client_key_path = '/full/path/to/client-key.pem' -# Create the client with SSL/TLS enabled, but hostname verification disabled. +# Create the client with SSL/TLS enabled client = OpenSearch( hosts = [{'host': host, 'port': port}], http_compress = True, # enables gzip compression for request bodies @@ -30,7 +34,33 @@ client = OpenSearch( # client_key = client_key_path, use_ssl = True, verify_certs = True, - ssl_assert_hostname = False, + ssl_assert_hostname = False, # Hostname verification is disabled here, but by default, it will remain enabled. + ssl_show_warn = False, + ca_certs = ca_certs_path +) +``` +When `ssl_assert_hostname` is set to None, verification is conducted using server hostname, effectively equivalent to not setting ssl_assert_hostname. + + +## Verifying SSL against a different host + +When the server you’re connecting to presents a different certificate than the hostname, you can use ssl_assert_hostname: + +```python +from opensearchpy import OpenSearch + +host = 'localhost' +port = 9200 +auth = ('admin', 'admin') +ca_certs_path = '/full/path/to/root-ca.pem' + +client = OpenSearch( + hosts = [{'host': host, 'port': port}], + http_compress = True, + http_auth = auth, + use_ssl = True, + verify_certs = True, + ssl_assert_hostname = "ssl.com", # Indicate the host name to assert against. By default, it is equal to the server hostname. ssl_show_warn = False, ca_certs = ca_certs_path ) diff --git a/noxfile.py b/noxfile.py index 1b261fe07..cdbc8a6d7 100644 --- a/noxfile.py +++ b/noxfile.py @@ -41,7 +41,7 @@ ) -@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]) # type: ignore +@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"]) # type: ignore def test(session: Any) -> None: """ runs all tests with a fresh python environment using "python setup.py test" @@ -61,7 +61,7 @@ def test(session: Any) -> None: session.run("python", "setup.py", "test") -@nox.session(python=["3.7"]) # type: ignore +@nox.session(python=["3.8"]) # type: ignore def format(session: Any) -> None: """ runs black and isort to format the files accordingly @@ -77,7 +77,7 @@ def format(session: Any) -> None: session.notify("lint") -@nox.session(python=["3.7"]) # type: ignore +@nox.session(python=["3.8"]) # type: ignore def lint(session: Any) -> None: """ runs isort, black, flake8, pylint, and mypy to check the files according to each utility's function @@ -146,4 +146,5 @@ def generate(session: Any) -> None: """ session.install("-rdev-requirements.txt") session.run("python", "utils/generate_api.py") - session.notify("format") + session.run("nox", "-s", "format", external=True) + session.run("python", "utils/changelog_updater.py") diff --git a/opensearchpy/__init__.py b/opensearchpy/__init__.py index b852272be..4cf251dbc 100644 --- a/opensearchpy/__init__.py +++ b/opensearchpy/__init__.py @@ -133,6 +133,7 @@ from .helpers.update_by_query import UpdateByQuery from .helpers.utils import AttrDict, AttrList, DslBase from .helpers.wrappers import Range +from .metrics import Metrics, MetricsEvents, MetricsNone from .serializer import JSONSerializer from .transport import Transport @@ -240,6 +241,9 @@ "token_filter", "tokenizer", "__versionstr__", + "Metrics", + "MetricsEvents", + "MetricsNone", ] try: diff --git a/opensearchpy/_async/client/__init__.py b/opensearchpy/_async/client/__init__.py index a1e8c80a9..71a4b8c19 100644 --- a/opensearchpy/_async/client/__init__.py +++ b/opensearchpy/_async/client/__init__.py @@ -52,6 +52,7 @@ from .plugins import PluginsClient from .remote import RemoteClient from .remote_store import RemoteStoreClient +from .search_pipeline import SearchPipelineClient from .security import SecurityClient from .snapshot import SnapshotClient from .tasks import TasksClient @@ -215,6 +216,7 @@ class as kwargs, or a string in the format of ``host[:port]`` which will be super().__init__(hosts, transport_class, **kwargs) # namespaced clients for compatibility with API names + self.search_pipeline = SearchPipelineClient(self) self.cat = CatClient(self) self.cluster = ClusterClient(self) self.dangling_indices = DanglingIndicesClient(self) @@ -256,7 +258,7 @@ async def close(self) -> None: await self.transport.close() # AUTO-GENERATED-API-DEFINITIONS # - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def ping( self, params: Any = None, @@ -265,6 +267,17 @@ async def ping( """ Returns whether the cluster is running. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ try: return await self.transport.perform_request( @@ -273,7 +286,7 @@ async def ping( except TransportError: return False - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def info( self, params: Any = None, @@ -282,15 +295,31 @@ async def info( """ Returns basic information about the cluster. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/", params=params, headers=headers ) @query_params( + "error_trace", + "filter_path", + "human", "pipeline", + "pretty", "refresh", "routing", + "source", "timeout", "version", "version_type", @@ -309,25 +338,47 @@ async def create( with a same ID already exists in the index. - :arg index: Index name. - :arg id: Document ID. + :arg index: Name of the data stream or index to target. If the + target doesn’t exist and matches the name or wildcard (`*`) pattern of + an index template with a `data_stream` definition, this request creates + the data stream. If the target doesn’t exist and doesn’t match a data + stream template, this request creates the index. + :arg id: Unique identifier for the document. :arg body: The document - :arg pipeline: The pipeline id to preprocess incoming documents - with. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pipeline: ID of the pipeline to use to preprocess incoming + documents.If the index has a default ingest pipeline specified, then + setting the value to `_none` disables the default ingest pipeline for + this request.If a final pipeline is configured it will always run, + regardless of the value of this parameter. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, Opensearch refreshes the affected + shards to make this operation visible to search, if `wait_for` then wait + for a refresh to make this operation visible to search, if `false` do + nothing with refreshes.Valid values: `true`, `false`, `wait_for`. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period the request waits for the following + operations: automatic index creation, dynamic mapping updates, waiting + for active shards. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. """ for param in (index, id, body): if param in SKIP_IN_PATH: @@ -340,13 +391,18 @@ async def create( ) @query_params( + "error_trace", + "filter_path", + "human", "if_primary_term", "if_seq_no", "op_type", "pipeline", + "pretty", "refresh", "require_alias", "routing", + "source", "timeout", "version", "version_type", @@ -364,34 +420,55 @@ async def index( Creates or updates a document in an index. - :arg index: Index name. + :arg index: Name of the data stream or index to target. :arg body: The document - :arg id: Document ID. - :arg if_primary_term: only perform the operation if the last - operation that has changed the document has the specified primary term. - :arg if_seq_no: only perform the operation if the last operation - that has changed the document has the specified sequence number. - :arg op_type: Explicit operation type. Defaults to `index` for - requests with an explicit document ID, and to `create` for requests - without an explicit document ID. Valid choices are index, create. - :arg pipeline: The pipeline id to preprocess incoming documents - with. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg require_alias: When true, requires destination to be an - alias. Default is false. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + :arg id: Unique identifier for the document. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg if_primary_term: Only perform the operation if the document + has this primary term. + :arg if_seq_no: Only perform the operation if the document has + this sequence number. + :arg op_type: Set to create to only index the document if it + does not already exist (put if absent).If a document with the specified + `_id` already exists, the indexing operation will fail.Same as using the + `/_create` endpoint.Valid values: `index`, `create`.If document + id is specified, it defaults to `index`.Otherwise, it defaults to + `create`. + :arg pipeline: ID of the pipeline to use to preprocess incoming + documents.If the index has a default ingest pipeline specified, then + setting the value to `_none` disables the default ingest pipeline for + this request.If a final pipeline is configured it will always run, + regardless of the value of this parameter. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, Opensearch refreshes the affected + shards to make this operation visible to search, if `wait_for` then wait + for a refresh to make this operation visible to search, if `false` do + nothing with refreshes.Valid values: `true`, `false`, `wait_for`. + :arg require_alias: If `true`, the destination must be an index + alias. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period the request waits for the following + operations: automatic index creation, dynamic mapping updates, waiting + for active shards. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to all or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. """ for param in (index, body): if param in SKIP_IN_PATH: @@ -409,10 +486,15 @@ async def index( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "pipeline", + "pretty", "refresh", "require_alias", "routing", + "source", "timeout", "wait_for_active_shards", ) @@ -429,29 +511,44 @@ async def bulk( :arg body: The operation definition and data (action-data pairs), separated by newlines - :arg index: Default index for items which don't provide one. - :arg _source: True or false to return the _source field or not, - or default list of fields to return, can be overridden on each sub- - request. - :arg _source_excludes: Default list of fields to exclude from - the returned _source field, can be overridden on each sub-request. - :arg _source_includes: Default list of fields to extract and - return from the _source field, can be overridden on each sub-request. - :arg pipeline: The pipeline id to preprocess incoming documents - with. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg require_alias: Sets require_alias for all incoming - documents. Default is false. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + :arg index: Name of the data stream, index, or index alias to + perform bulk actions on. + :arg _source: `true` or `false` to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude from the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pipeline: ID of the pipeline to use to preprocess incoming + documents.If the index has a default ingest pipeline specified, then + setting the value to `_none` disables the default ingest pipeline for + this request.If a final pipeline is configured it will always run, + regardless of the value of this parameter. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, Opensearch refreshes the affected + shards to make this operation visible to search, if `wait_for` then wait + for a refresh to make this operation visible to search, if `false` do + nothing with refreshes.Valid values: `true`, `false`, `wait_for`. + :arg require_alias: If `true`, the request’s actions must target + an index alias. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period each action waits for the following + operations: automatic index creation, dynamic mapping updates, waiting + for active shards. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to all or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -465,7 +562,7 @@ async def bulk( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def clear_scroll( self, body: Any = None, @@ -479,7 +576,18 @@ async def clear_scroll( :arg body: Comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter - :arg scroll_id: Comma-separated list of scroll IDs to clear. + :arg scroll_id: Comma-separated list of scroll IDs to clear. To + clear all scroll IDs, use `_all`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if scroll_id in SKIP_IN_PATH and body in SKIP_IN_PATH: raise ValueError("You need to supply scroll_id or body.") @@ -498,14 +606,19 @@ async def clear_scroll( "analyzer", "default_operator", "df", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_throttled", "ignore_unavailable", "lenient", "min_score", "preference", + "pretty", "q", "routing", + "source", "terminate_after", ) async def count( @@ -521,36 +634,56 @@ async def count( :arg body: Query to restrict the results specified with the Query DSL (optional) - :arg index: Comma-separated list of indices to restrict the - results. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. + :arg index: Comma-separated list of data streams, indices, and + aliases to search. Supports wildcards (`*`). To search all data streams + and indices, omit this parameter or use `*` or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed.This parameter can only be used when the `q` query string + parameter is specified. + :arg analyzer: Analyzer to use for the query string.This + parameter can only be used when the `q` query string parameter is + specified. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg min_score: Include only documents with a specific `_score` - value in the result. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. + query: `AND` or `OR`.This parameter can only be used when the `q` query + string parameter is specified. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string.This parameter can only be used when the `q` query + string parameter is specified. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`. Valid choices are all, open, + closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_throttled: If `true`, concrete, expanded or aliased + indices are ignored when frozen. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg min_score: Sets the minimum `_score` value that documents + must have to be included in the result. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg routing: Comma-separated list of specific routing values. - :arg terminate_after: The maximum number of documents to collect - for each shard, upon reaching which the query execution will terminate - early. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg terminate_after: Maximum number of documents to collect for + each shard.If a query reaches this limit, Opensearch terminates the + query early.Opensearch collects documents before sorting. """ return await self.transport.perform_request( "POST", @@ -561,10 +694,15 @@ async def count( ) @query_params( + "error_trace", + "filter_path", + "human", "if_primary_term", "if_seq_no", + "pretty", "refresh", "routing", + "source", "timeout", "version", "version_type", @@ -581,26 +719,39 @@ async def delete( Removes a document from the index. - :arg index: Index name. - :arg id: Document ID. - :arg if_primary_term: only perform the operation if the last - operation that has changed the document has the specified primary term. - :arg if_seq_no: only perform the operation if the last operation - that has changed the document has the specified sequence number. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + :arg index: Name of the target index. + :arg id: Unique identifier for the document. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg if_primary_term: Only perform the operation if the document + has this primary term. + :arg if_seq_no: Only perform the operation if the document has + this sequence number. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, Opensearch refreshes the affected + shards to make this operation visible to search, if `wait_for` then wait + for a refresh to make this operation visible to search, if `false` do + nothing with refreshes.Valid values: `true`, `false`, `wait_for`. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for active shards. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -620,12 +771,16 @@ async def delete( "conflicts", "default_operator", "df", + "error_trace", "expand_wildcards", + "filter_path", "from_", + "human", "ignore_unavailable", "lenient", "max_docs", "preference", + "pretty", "q", "refresh", "request_cache", @@ -638,6 +793,7 @@ async def delete( "size", "slices", "sort", + "source", "stats", "terminate_after", "timeout", @@ -656,8 +812,9 @@ async def delete_by_query( Deletes documents matching the provided query. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + :arg index: Comma-separated list of data streams, indices, and + aliases to search. Supports wildcards (`*`). To search all data streams + or indices, omit this parameter or use `*` or `_all`. :arg body: The search definition using the Query DSL :arg _source: True or false to return the _source field or not, or a list of fields to return. @@ -665,67 +822,85 @@ async def delete_by_query( returned _source field. :arg _source_includes: List of fields to extract and return from the _source field. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. - :arg conflicts: What to do when the operation encounters version - conflicts?. Valid choices are abort, proceed. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices.For example, a request targeting `foo*,bar*` + returns an error if an index starts with `foo` but no index starts with + `bar`. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed. + :arg analyzer: Analyzer to use for the query string. + :arg conflicts: What to do if delete by query hits version + conflicts: `abort` or `proceed`. Valid choices are abort, proceed. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg from_: Starting offset. Default is 0. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg max_docs: Maximum number of documents to process (default: - all documents). - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. + query: `AND` or `OR`. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`. Valid values are: `all`, + `open`, `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg from_: Starting offset (default: 0) + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg max_docs: Maximum number of documents to process.Defaults + to all documents. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting. + :arg refresh: If `true`, Opensearch refreshes all shards + involved in the delete by query after the request completes. + :arg request_cache: If `true`, the request cache is used for + this request.Defaults to the index-level setting. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. Default is 0. - :arg routing: Comma-separated list of specific routing values. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. - :arg scroll_size: Size on the scroll request powering the - operation. Default is 100. - :arg search_timeout: Explicit timeout for each search request. - Defaults to no timeout. - :arg search_type: Search operation type. Valid choices are + requests per second. + :arg routing: Custom value used to route operations to a + specific shard. + :arg scroll: Period to retain the search context for scrolling. + :arg scroll_size: Size of the scroll request that powers the + operation. + :arg search_timeout: Explicit timeout for each search + request.Defaults to no timeout. + :arg search_type: The type of the search operation.Available + options: `query_then_fetch`, `dfs_query_then_fetch`. Valid choices are query_then_fetch, dfs_query_then_fetch. :arg size: Deprecated, please use `max_docs` instead. :arg slices: The number of slices this task should be divided - into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default is 1. - :arg sort: Comma-separated list of : pairs. - :arg stats: Specific 'tag' of the request for logging and + into. Valid choices are auto. + :arg sort: A comma-separated list of : pairs. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stats: Specific `tag` of the request for logging and statistical purposes. - :arg terminate_after: The maximum number of documents to collect - for each shard, upon reaching which the query execution will terminate - early. - :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default is 1m. - :arg version: Whether to return document version as part of a - hit. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is True. + :arg terminate_after: Maximum number of documents to collect for + each shard.If a query reaches this limit, Opensearch terminates the + query early.Opensearch collects documents before sorting.Use with + caution.Opensearch applies this parameter to each shard handling the + request.When possible, let Opensearch perform early termination + automatically.Avoid specifying this parameter for requests that target + data streams with backing indices across multiple data tiers. + :arg timeout: Period each deletion request waits for active + shards. + :arg version: If `true`, returns the document version as part of + a hit. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to all or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. + :arg wait_for_completion: If `true`, the request blocks until + the operation is complete. """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: @@ -743,7 +918,9 @@ async def delete_by_query( body=body, ) - @query_params("requests_per_second") + @query_params( + "error_trace", "filter_path", "human", "pretty", "requests_per_second", "source" + ) async def delete_by_query_rethrottle( self, task_id: Any, @@ -755,9 +932,19 @@ async def delete_by_query_rethrottle( operation. - :arg task_id: The task id to rethrottle. + :arg task_id: The ID for the task. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. + requests per second. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -769,7 +956,16 @@ async def delete_by_query_rethrottle( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def delete_script( self, id: Any, @@ -780,13 +976,26 @@ async def delete_script( Deletes a script. - :arg id: Script ID. + :arg id: Identifier for the stored script or search template. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'id'.") @@ -799,10 +1008,15 @@ async def delete_script( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "stored_fields", "version", "version_type", @@ -818,26 +1032,42 @@ async def exists( Returns information about whether a document exists in an index. - :arg index: Index name. - :arg id: Document ID. - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. - :arg stored_fields: Comma-separated list of stored fields to - return. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. + :arg index: Comma-separated list of data streams, indices, and + aliases. Supports wildcards (`*`). + :arg id: Identifier of the document. + :arg _source: `true` or `false` to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude in the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If `true`, the request is real-time as opposed to + near-real-time. + :arg refresh: If `true`, Opensearch refreshes all shards + involved in the delete by query after the request completes. + :arg routing: Target the specified primary shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stored_fields: List of stored fields to return as part of a + hit.If no fields are specified, no stored fields are included in the + response.If this field is specified, the `_source` parameter defaults to + false. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -851,10 +1081,15 @@ async def exists( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "version", "version_type", ) @@ -869,24 +1104,38 @@ async def exists_source( Returns information about whether a document source exists in an index. - :arg index: Index name. - :arg id: Document ID. - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. + :arg index: Comma-separated list of data streams, indices, and + aliases. Supports wildcards (`*`). + :arg id: Identifier of the document. + :arg _source: `true` or `false` to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude in the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If true, the request is real-time as opposed to + near-real-time. + :arg refresh: If `true`, Opensearch refreshes all shards + involved in the delete by query after the request completes. + :arg routing: Target the specified primary shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -906,10 +1155,15 @@ async def exists_source( "analyzer", "default_operator", "df", + "error_trace", + "filter_path", + "human", "lenient", "preference", + "pretty", "q", "routing", + "source", "stored_fields", ) async def explain( @@ -924,30 +1178,44 @@ async def explain( Returns information about why a specific matches (or doesn't match) a query. - :arg index: Index name. - :arg id: Document ID. + :arg index: Index names used to limit the request. Only a single + index name can be provided to this parameter. + :arg id: Defines the document ID. :arg body: The query definition using the Query DSL - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg analyze_wildcard: Specify whether wildcards and prefix - queries in the query string query should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. + :arg _source: True or false to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude from the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed. + :arg analyzer: Analyzer to use for the query string.This + parameter can only be used when the `q` query string parameter is + specified. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The default field for query string query. Default is - _all. - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. + query: `AND` or `OR`. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg routing: Routing value. - :arg stored_fields: Comma-separated list of stored fields to - return. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stored_fields: A comma-separated list of stored fields to + return in the response. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -961,10 +1229,15 @@ async def explain( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", "fields", + "filter_path", + "human", "ignore_unavailable", "include_unmapped", + "pretty", + "source", ) async def field_caps( self, @@ -979,19 +1252,36 @@ async def field_caps( :arg body: An index filter specified with the Query DSL - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg fields: Comma-separated list of field names. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg include_unmapped: Indicates whether unmapped fields should - be included in the response. Default is false. + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (*). To target all + data streams and indices, omit this parameter or use * or _all. + :arg allow_no_indices: If false, the request returns an error if + any wildcard expression, index alias,or `_all` value targets only + missing or closed indices. This behavior applies even if the request + targets other open indices. For example, a requesttargeting `foo*,bar*` + returns an error if an index starts with foo but no index starts with + bar. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match. If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams. Supports comma- + separated values, such as `open,hidden`. Valid choices are all, open, + closed, hidden, none. + :arg fields: Comma-separated list of fields to retrieve + capabilities for. Wildcard (`*`) expressions are supported. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `true`, missing or closed indices + are not included in the response. + :arg include_unmapped: If true, unmapped fields are included in + the response. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", @@ -1005,10 +1295,15 @@ async def field_caps( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "stored_fields", "version", "version_type", @@ -1024,26 +1319,41 @@ async def get( Returns a document. - :arg index: Index name. - :arg id: Document ID. + :arg index: Name of the index that contains the document. + :arg id: Unique identifier of the document. :arg _source: True or false to return the _source field or not, or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. - :arg stored_fields: Comma-separated list of stored fields to - return. + :arg _source_excludes: A comma-separated list of source fields + to exclude in the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on. Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If `true`, the request is real-time as opposed to + near-real-time. + :arg refresh: If true, Opensearch refreshes the affected shards + to make this operation visible to search. If false, do nothing with + refreshes. + :arg routing: Target the specified primary shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stored_fields: List of stored fields to return as part of a + hit.If no fields are specified, no stored fields are included in the + response.If this field is specified, the `_source` parameter defaults to + false. :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. + The specified version must match the current version of the document for + the request to succeed. + :arg version_type: Specific version type: internal, external, + external_gte. Valid choices are internal, external, external_gte, force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1053,7 +1363,15 @@ async def get( "GET", _make_path(index, "_doc", id), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) async def get_script( self, id: Any, @@ -1064,12 +1382,22 @@ async def get_script( Returns a script. - :arg id: Script ID. + :arg id: Identifier for the stored script or search template. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'id'.") @@ -1082,10 +1410,15 @@ async def get_script( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "version", "version_type", ) @@ -1100,24 +1433,37 @@ async def get_source( Returns the source of a document. - :arg index: Index name. - :arg id: Document ID. + :arg index: Name of the index that contains the document. + :arg id: Unique identifier of the document. :arg _source: True or false to return the _source field or not, or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. + :arg _source_excludes: A comma-separated list of source fields + to exclude in the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on. Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: Boolean) If true, the request is real-time as + opposed to near-real-time. + :arg refresh: If true, Opensearch refreshes the affected shards + to make this operation visible to search. If false, do nothing with + refreshes. + :arg routing: Target the specified primary shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. + The specified version must match the current version of the document for + the request to succeed. + :arg version_type: Specific version type: internal, external, + external_gte. Valid choices are internal, external, external_gte, force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1133,10 +1479,15 @@ async def get_source( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "stored_fields", ) async def mget( @@ -1153,22 +1504,39 @@ async def mget( :arg body: Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL. - :arg index: Index name. - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. - :arg stored_fields: Comma-separated list of stored fields to - return. + :arg index: Name of the index to retrieve documents from when + `ids` are specified, or when a document in the `docs` array does not + specify an index. + :arg _source: True or false to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude from the response.You can also use this parameter to exclude + fields from the subset specified in `_source_includes` query parameter. + :arg _source_includes: A comma-separated list of source fields + to include in the response.If this parameter is specified, only these + source fields are returned. You can exclude fields from this subset + using the `_source_excludes` query parameter.If the `_source` parameter + is `false`, this parameter is ignored. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on. Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If `true`, the request is real-time as opposed to + near-real-time. + :arg refresh: If `true`, the request refreshes relevant shards + before retrieving documents. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stored_fields: If `true`, retrieves the document fields + stored in the index rather than the document `_source`. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1183,11 +1551,16 @@ async def mget( @query_params( "ccs_minimize_roundtrips", + "error_trace", + "filter_path", + "human", "max_concurrent_searches", "max_concurrent_shard_requests", "pre_filter_shard_size", + "pretty", "rest_total_hits_as_int", "search_type", + "source", "typed_keys", ) async def msearch( @@ -1203,31 +1576,39 @@ async def msearch( :arg body: The request definitions (metadata-search request definition pairs), separated by newlines - :arg index: Comma-separated list of indices to use as default. - :arg ccs_minimize_roundtrips: Indicates whether network round- - trips should be minimized as part of cross-cluster search requests - execution. Default is True. - :arg max_concurrent_searches: Controls the maximum number of - concurrent searches the multi search api will execute. - :arg max_concurrent_shard_requests: The number of concurrent - shard requests each sub search executes concurrently per node. This - value should be used to limit the impact of the search on the cluster in - order to limit the number of concurrent shard requests. Default is 5. - :arg pre_filter_shard_size: Threshold that enforces a pre-filter - round-trip to prefilter search shards based on query rewriting if the - number of shards the search request expands to exceeds the threshold. - This filter round-trip can limit the number of shards significantly if - for instance a shard can not match any documents based on its rewrite - method ie. if date filters are mandatory to match but the shard bounds - and the query are disjoint. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg search_type: Search operation type. Valid choices are - query_then_fetch, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch. - :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response. + :arg index: Comma-separated list of data streams, indices, and + index aliases to search. + :arg ccs_minimize_roundtrips: If true, network roundtrips + between the coordinating node and remote clusters are minimized for + cross-cluster search requests. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg max_concurrent_searches: Maximum number of concurrent + searches the multi search API can execute. + :arg max_concurrent_shard_requests: Maximum number of concurrent + shard requests that each sub-search request executes per node. + :arg pre_filter_shard_size: Defines a threshold that enforces a + pre-filter roundtrip to prefilter search shards based on query rewriting + if the number of shards the search request expands to exceeds the + threshold. This filter roundtrip can limit the number of shards + significantly if for instance a shard can not match any documents based + on its rewrite method i.e., if date filters are mandatory to match but + the shard bounds and the query are disjoint. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg rest_total_hits_as_int: If true, hits.total are returned as + an integer in the response. Defaults to false, which returns an object. + :arg search_type: Indicates whether global term and document + frequencies should be used when scoring returned documents. Valid + choices are query_then_fetch, dfs_query_then_fetch. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg typed_keys: Specifies whether aggregation and suggester + names should be prefixed by their respective types in the response. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1243,9 +1624,14 @@ async def msearch( @query_params( "ccs_minimize_roundtrips", + "error_trace", + "filter_path", + "human", "max_concurrent_searches", + "pretty", "rest_total_hits_as_int", "search_type", + "source", "typed_keys", ) async def msearch_template( @@ -1261,20 +1647,31 @@ async def msearch_template( :arg body: The request definitions (metadata-search request definition pairs), separated by newlines - :arg index: Comma-separated list of indices to use as default. - :arg ccs_minimize_roundtrips: Indicates whether network round- - trips should be minimized as part of cross-cluster search requests - execution. Default is True. - :arg max_concurrent_searches: Controls the maximum number of - concurrent searches the multi search api will execute. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg search_type: Search operation type. Valid choices are - query_then_fetch, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch. - :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response. + :arg index: Comma-separated list of data streams, indices, and + aliases to search. Supports wildcards (`*`). To search all data streams + and indices, omit this parameter or use `*`. + :arg ccs_minimize_roundtrips: If `true`, network round-trips are + minimized for cross-cluster search requests. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg max_concurrent_searches: Maximum number of concurrent + searches the API can run. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg rest_total_hits_as_int: If `true`, the response returns + `hits.total` as an integer.If `false`, it returns `hits.total` as an + object. + :arg search_type: The type of the search operation.Available + options: `query_then_fetch`, `dfs_query_then_fetch`. Valid choices are + query_then_fetch, dfs_query_then_fetch. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg typed_keys: If `true`, the response prefixes aggregation + and suggester names with their respective types. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1289,15 +1686,20 @@ async def msearch_template( ) @query_params( + "error_trace", "field_statistics", "fields", + "filter_path", + "human", "ids", "offsets", "payloads", "positions", "preference", + "pretty", "realtime", "routing", + "source", "term_statistics", "version", "version_type", @@ -1316,36 +1718,39 @@ async def mtermvectors( :arg body: Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation. - :arg index: The index in which the document resides. - :arg field_statistics: Specifies if document count, sum of - document frequencies and sum of total term frequencies should be - returned. Applies to all returned documents unless otherwise specified - in body 'params' or 'docs'. Default is True. - :arg fields: Comma-separated list of fields to return. Applies - to all returned documents unless otherwise specified in body 'params' or - 'docs'. - :arg ids: Comma-separated list of documents ids. You must define - ids as parameter or set 'ids' or 'docs' in the request body. - :arg offsets: Specifies if term offsets should be returned. - Applies to all returned documents unless otherwise specified in body - 'params' or 'docs'. Default is True. - :arg payloads: Specifies if term payloads should be returned. - Applies to all returned documents unless otherwise specified in body - 'params' or 'docs'. Default is True. - :arg positions: Specifies if term positions should be returned. - Applies to all returned documents unless otherwise specified in body - 'params' or 'docs'. Default is True. - :arg preference: Specify the node or shard the operation should - be performed on. Applies to all returned documents unless otherwise - specified in body 'params' or 'docs'. Default is random. - :arg realtime: Specifies if requests are real-time as opposed to - near-real-time. Default is True. - :arg routing: Routing value. Applies to all returned documents - unless otherwise specified in body 'params' or 'docs'. - :arg term_statistics: Specifies if total term frequency and - document frequency should be returned. Applies to all returned documents - unless otherwise specified in body 'params' or 'docs'. Default is false. - :arg version: Explicit version number for concurrency control. + :arg index: Name of the index that contains the documents. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg field_statistics: If `true`, the response includes the + document count, sum of document frequencies, and sum of total term + frequencies. + :arg fields: Comma-separated list or wildcard expressions of + fields to include in the statistics.Used as the default list unless a + specific field list is provided in the `completion_fields` or + `fielddata_fields` parameters. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ids: A comma-separated list of documents ids. You must + define ids as parameter or set "ids" or "docs" in the request body + :arg offsets: If `true`, the response includes term offsets. + :arg payloads: If `true`, the response includes term payloads. + :arg positions: If `true`, the response includes term positions. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If true, the request is real-time as opposed to + near-real-time. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg term_statistics: If true, the response includes term + frequency and document frequency. + :arg version: If `true`, returns the document version as part of + a hit. :arg version_type: Specific version type. Valid choices are internal, external, external_gte, force. """ @@ -1355,7 +1760,16 @@ async def mtermvectors( "POST", path, params=params, headers=headers, body=body ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def put_script( self, id: Any, @@ -1368,15 +1782,31 @@ async def put_script( Creates or updates a script. - :arg id: Script ID. + :arg id: Identifier for the stored script or search template. + Must be unique within the cluster. :arg body: The document - :arg context: Script context. + :arg context: Context in which the script or search template + should run. To prevent errors, the API immediately compiles the script + or template in this context. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ for param in (id, body): if param in SKIP_IN_PATH: @@ -1391,7 +1821,15 @@ async def put_script( ) @query_params( - "allow_no_indices", "expand_wildcards", "ignore_unavailable", "search_type" + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "search_type", + "source", ) async def rank_eval( self, @@ -1407,18 +1845,32 @@ async def rank_eval( :arg body: The ranking evaluation search definition, including search requests, document ratings and ranking metric definition. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg index: Comma-separated list of data streams, indices, and + index aliases used to limit the request. Wildcard (`*`) expressions are + supported. To target all data streams and indices in a cluster, omit + this parameter or use `_all` or `*`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices. This behavior applies even if the request + targets other open indices. For example, a request targeting `foo*,bar*` + returns an error if an index starts with `foo` but no index starts with + `bar`. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg search_type: Search operation type. Valid choices are - query_then_fetch, dfs_query_then_fetch. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `true`, missing or closed indices + are not included in the response. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg search_type: Search operation type + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1432,11 +1884,16 @@ async def rank_eval( ) @query_params( + "error_trace", + "filter_path", + "human", "max_docs", + "pretty", "refresh", "requests_per_second", "scroll", "slices", + "source", "timeout", "wait_for_active_shards", "wait_for_completion", @@ -1455,25 +1912,35 @@ async def reindex( :arg body: The search definition using the Query DSL and the prototype for the index request. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg max_docs: Maximum number of documents to process (default: all documents). - :arg refresh: Should the affected indexes be refreshed?. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, the request refreshes affected shards + to make this operation visible to search. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. Default is 0. - :arg scroll: Specify how long a consistent view of the index + requests per second.Defaults to no throttle. + :arg scroll: Specifies how long a consistent view of the index should be maintained for scrolled search. :arg slices: The number of slices this task should be divided - into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default is 1. - :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default is 1m. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is True. + into.Defaults to 1 slice, meaning the task isn’t sliced into subtasks. + Valid choices are auto. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period each indexing waits for automatic index + creation, dynamic mapping updates, and waiting for active shards. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. + :arg wait_for_completion: If `true`, the request blocks until + the operation is complete. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1482,7 +1949,9 @@ async def reindex( "POST", "/_reindex", params=params, headers=headers, body=body ) - @query_params("requests_per_second") + @query_params( + "error_trace", "filter_path", "human", "pretty", "requests_per_second", "source" + ) async def reindex_rethrottle( self, task_id: Any, @@ -1493,9 +1962,19 @@ async def reindex_rethrottle( Changes the number of requests per second for a particular Reindex operation. - :arg task_id: The task id to rethrottle. + :arg task_id: Identifier for the task. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. + requests per second. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -1507,7 +1986,7 @@ async def reindex_rethrottle( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def render_search_template( self, body: Any = None, @@ -1520,7 +1999,18 @@ async def render_search_template( :arg body: The search definition template and its params - :arg id: The id of the stored search template. + :arg id: ID of the search template to render. If no `source` is + specified, this or the `id` request body parameter is required. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", @@ -1530,7 +2020,7 @@ async def render_search_template( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def scripts_painless_execute( self, body: Any = None, @@ -1542,6 +2032,16 @@ async def scripts_painless_execute( :arg body: The script to execute + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", @@ -1551,7 +2051,15 @@ async def scripts_painless_execute( body=body, ) - @query_params("rest_total_hits_as_int", "scroll") + @query_params( + "error_trace", + "filter_path", + "human", + "pretty", + "rest_total_hits_as_int", + "scroll", + "source", + ) async def scroll( self, body: Any = None, @@ -1565,12 +2073,21 @@ async def scroll( :arg body: The scroll ID if not passed by URL or query parameter. - :arg scroll_id: Scroll ID. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. + :arg scroll_id: The scroll ID for scrolled search + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg rest_total_hits_as_int: If true, the API response’s + hit.total property is returned as an integer. If false, the API + response’s hit.total property is returned as an object. + :arg scroll: Period to retain the search context for scrolling. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if scroll_id in SKIP_IN_PATH and body in SKIP_IN_PATH: raise ValueError("You need to supply scroll_id or body.") @@ -1596,15 +2113,20 @@ async def scroll( "default_operator", "df", "docvalue_fields", + "error_trace", "expand_wildcards", "explain", + "filter_path", "from_", + "human", "ignore_throttled", "ignore_unavailable", + "include_named_queries_score", "lenient", "max_concurrent_shard_requests", "pre_filter_shard_size", "preference", + "pretty", "q", "request_cache", "rest_total_hits_as_int", @@ -1615,6 +2137,7 @@ async def scroll( "seq_no_primary_term", "size", "sort", + "source", "stats", "stored_fields", "suggest_field", @@ -1640,100 +2163,184 @@ async def search( :arg body: The search definition using the Query DSL - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg allow_partial_search_results: Indicate if an error should - be returned if there is a partial search failure or timeout. Default is - True. - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. + :arg index: Comma-separated list of data streams, indices, and + aliases to search. Supports wildcards (`*`). To search all data streams + and indices, omit this parameter or use `*` or `_all`. + :arg _source: Indicates which source fields are returned for + matching documents.These fields are returned in the `hits._source` + property of the search response.Valid values are:`true` to return the + entire document source;`false` to not return the document + source;`` to return the source fields that are specified as a + comma-separated list (supports wildcard (`*`) patterns). + :arg _source_excludes: A comma-separated list of source fields + to exclude from the response.You can also use this parameter to exclude + fields from the subset specified in `_source_includes` query + parameter.If the `_source` parameter is `false`, this parameter is + ignored. + :arg _source_includes: A comma-separated list of source fields + to include in the response.If this parameter is specified, only these + source fields are returned.You can exclude fields from this subset using + the `_source_excludes` query parameter.If the `_source` parameter is + `false`, this parameter is ignored. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices.For example, a request targeting `foo*,bar*` + returns an error if an index starts with `foo` but no index starts with + `bar`. + :arg allow_partial_search_results: If true, returns partial + results if there are shard request timeouts or shard failures. If false, + returns an error with no partial results. + :arg analyze_wildcard: If true, wildcard and prefix queries are + analyzed.This parameter can only be used when the q query string + parameter is specified. + :arg analyzer: Analyzer to use for the query string.This + parameter can only be used when the q query string parameter is + specified. :arg batched_reduce_size: The number of shard results that - should be reduced at once on the coordinating node. This value should be + should be reduced at once on the coordinating node.This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. - Default is 512. - :arg ccs_minimize_roundtrips: Indicates whether network round- - trips should be minimized as part of cross-cluster search requests - execution. Default is True. + :arg ccs_minimize_roundtrips: If true, network round-trips + between the coordinating node and the remote clusters are minimized when + executing cross-cluster search (CCS) requests. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg docvalue_fields: Comma-separated list of fields to return - as the docvalue representation of a field for each hit. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg explain: Specify whether to return detailed information - about score computation as part of a hit. - :arg from_: Starting offset. Default is 0. - :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg max_concurrent_shard_requests: The number of concurrent - shard requests per node this search executes concurrently. This value - should be used to limit the impact of the search on the cluster in order - to limit the number of concurrent shard requests. Default is 5. - :arg pre_filter_shard_size: Threshold that enforces a pre-filter - round-trip to prefilter search shards based on query rewriting if the - number of shards the search request expands to exceeds the threshold. - This filter round-trip can limit the number of shards significantly if - for instance a shard can not match any documents based on its rewrite - method ie. if date filters are mandatory to match but the shard bounds - and the query are disjoint. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg q: Query in the Lucene query string syntax. - :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg routing: Comma-separated list of specific routing values. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. + query: AND or OR.This parameter can only be used when the `q` query + string parameter is specified. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string.This parameter can only be used when the q query + string parameter is specified. + :arg docvalue_fields: A comma-separated list of fields to return + as the docvalue representation for each hit. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`. Valid choices are all, open, + closed, hidden, none. + :arg explain: If `true`, returns detailed information about + score computation as part of a hit. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg from_: Starting document offset.Needs to be non-negative.By + default, you cannot page through more than 10,000 hits using the `from` + and `size` parameters.To page through more hits, use the `search_after` + parameter. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_throttled: If `true`, concrete, expanded or aliased + indices will be ignored when frozen. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg include_named_queries_score: Indicates whether + hit.matched_queries should be rendered as a map that includes the name + of the matched query associated with its score (true) or as an array + containing the name of the matched queries (false) Default is false. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be + ignored.This parameter can only be used when the `q` query string + parameter is specified. + :arg max_concurrent_shard_requests: Defines the number of + concurrent shard requests per node this search executes + concurrently.This value should be used to limit the impact of the search + on the cluster in order to limit the number of concurrent shard + requests. + :arg pre_filter_shard_size: Defines a threshold that enforces a + pre-filter roundtrip to prefilter search shards based on query rewriting + if the number of shards the search request expands to exceeds the + threshold.This filter roundtrip can limit the number of shards + significantly if for instance a shard can not match any documents based + on its rewrite method (if date filters are mandatory to match but the + shard bounds and the query are disjoint).When unspecified, the pre- + filter phase is executed if any of these conditions is met:the request + targets more than 128 shards;the request targets one or more read-only + index;the primary sort of the query targets an indexed field. + :arg preference: Nodes and shards used for the search.By + default, Opensearch selects from eligible nodes and shards using + adaptive replica selection, accounting for allocation awareness. Valid + values are:`_only_local` to run the search only on shards on the local + node;`_local` to, if possible, run the search on shards on the local + node, or if not, select shards using the default + method;`_only_nodes:,` to run the search on only the + specified nodes IDs, where, if suitable shards exist on more than one + selected node, use shards on those nodes using the default method, or if + none of the specified nodes are available, select shards from any + available node using the default method;`_prefer_nodes:,` to if possible, run the search on the specified nodes IDs, or if + not, select shards using the default method;`_shards:,` to + run the search only on the specified shards;`` (any + string that does not start with `_`) to route searches with the same + `` to the same shards in the same order. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg q: Query in the Lucene query string syntax using query + parameter search.Query parameter searches do not support the full + Opensearch Query DSL but are handy for testing. + :arg request_cache: If `true`, the caching of search results is + enabled for requests where `size` is `0`.Defaults to index level + settings. + :arg rest_total_hits_as_int: Indicates whether `hits.total` + should be rendered as an integer or an object in the rest search + response. + :arg routing: Custom value used to route operations to a + specific shard. + :arg scroll: Period to retain the search context for scrolling. + See Scroll search results.By default, this value cannot exceed `1d` (24 + hours).You can change this limit using the `search.max_keep_alive` + cluster-level setting. :arg search_pipeline: Customizable sequence of processing stages applied to search queries. - :arg search_type: Search operation type. Valid choices are - query_then_fetch, dfs_query_then_fetch. - :arg seq_no_primary_term: Specify whether to return sequence - number and primary term of the last modification of each hit. - :arg size: Number of hits to return. Default is 10. - :arg sort: Comma-separated list of : pairs. - :arg stats: Specific 'tag' of the request for logging and + :arg search_type: How distributed term frequencies are + calculated for relevance scoring. Valid choices are query_then_fetch, + dfs_query_then_fetch. + :arg seq_no_primary_term: If `true`, returns sequence number and + primary term of the last modification of each hit. + :arg size: Defines the number of hits to return.By default, you + cannot page through more than 10,000 hits using the `from` and `size` + parameters.To page through more hits, use the `search_after` parameter. + :arg sort: A comma-separated list of : pairs. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stats: Specific `tag` of the request for logging and statistical purposes. - :arg stored_fields: Comma-separated list of stored fields to - return. - :arg suggest_field: Specify which field to use for suggestions. - :arg suggest_mode: Specify suggest mode. Valid choices are - missing, popular, always. - :arg suggest_size: How many suggestions to return in response. + :arg stored_fields: A comma-separated list of stored fields to + return as part of a hit.If no fields are specified, no stored fields are + included in the response.If this field is specified, the `_source` + parameter defaults to `false`.You can pass `_source: true` to return + both source fields and stored fields in the search response. + :arg suggest_field: Specifies which field to use for + suggestions. + :arg suggest_mode: Specifies the suggest mode.This parameter can + only be used when the `suggest_field` and `suggest_text` query string + parameters are specified. Valid choices are missing, popular, always. + :arg suggest_size: Number of suggestions to return.This + parameter can only be used when the `suggest_field` and `suggest_text` + query string parameters are specified. :arg suggest_text: The source text for which the suggestions - should be returned. - :arg terminate_after: The maximum number of documents to collect - for each shard, upon reaching which the query execution will terminate - early. - :arg timeout: Operation timeout. - :arg track_scores: Whether to calculate and return scores even - if they are not used for sorting. - :arg track_total_hits: Indicate if the number of documents that - match the query should be tracked. - :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response. - :arg version: Whether to return document version as part of a + should be returned.This parameter can only be used when the + `suggest_field` and `suggest_text` query string parameters are + specified. + :arg terminate_after: Maximum number of documents to collect for + each shard.If a query reaches this limit, Opensearch terminates the + query early.Opensearch collects documents before sorting.Use with + caution.Opensearch applies this parameter to each shard handling the + request.When possible, let Opensearch perform early termination + automatically.Avoid specifying this parameter for requests that target + data streams with backing indices across multiple data tiers.If set to + `0` (default), the query does not terminate early. + :arg timeout: Specifies the period of time to wait for a + response from each shard.If no response is received before the timeout + expires, the request fails and returns an error. + :arg track_scores: If `true`, calculate and return document + scores, even if the scores are not used for sorting. + :arg track_total_hits: Number of hits matching the query to + count accurately.If `true`, the exact number of hits is returned at the + cost of some performance.If `false`, the response does not include the + total number of hits matching the query. + :arg typed_keys: If `true`, aggregation and suggester names are + be prefixed by their respective types in the response. + :arg version: If `true`, returns document version as part of a hit. """ # from is a reserved word so it cannot be used, use from_ instead @@ -1750,11 +2357,16 @@ async def search( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "local", "preference", + "pretty", "routing", + "source", ) async def search_shards( self, @@ -1767,21 +2379,37 @@ async def search_shards( executed against. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg routing: Routing value. + :arg index: Returns the indices and shards that a search request + would be executed against. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices.For example, a request targeting `foo*,bar*` + returns an error if an index starts with `foo` but no index starts with + `bar`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path(index, "_search_shards"), params=params, headers=headers @@ -1790,16 +2418,21 @@ async def search_shards( @query_params( "allow_no_indices", "ccs_minimize_roundtrips", + "error_trace", "expand_wildcards", "explain", + "filter_path", + "human", "ignore_throttled", "ignore_unavailable", "preference", + "pretty", "profile", "rest_total_hits_as_int", "routing", "scroll", "search_type", + "source", "typed_keys", ) async def search_template( @@ -1814,37 +2447,50 @@ async def search_template( :arg body: The search definition template and its params - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg ccs_minimize_roundtrips: Indicates whether network round- - trips should be minimized as part of cross-cluster search requests - execution. Default is True. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg explain: Specify whether to return detailed information - about score computation as part of a hit. - :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg profile: Specify whether to profile the query execution. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg routing: Comma-separated list of specific routing values. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. - :arg search_type: Search operation type. Valid choices are - query_then_fetch, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch. - :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response. + :arg index: Comma-separated list of data streams, indices, and + aliases to search. Supports wildcards (*). + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices.For example, a request targeting `foo*,bar*` + returns an error if an index starts with `foo` but no index starts with + `bar`. + :arg ccs_minimize_roundtrips: If `true`, network round-trips are + minimized for cross-cluster search requests. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg explain: If `true`, the response includes additional + details about score computation as part of a hit. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_throttled: If `true`, specified concrete, expanded, + or aliased indices are not included in the response when throttled. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg profile: If `true`, the query execution is profiled. + :arg rest_total_hits_as_int: If true, hits.total are rendered as + an integer in the response. + :arg routing: Custom value used to route operations to a + specific shard. + :arg scroll: Specifies how long a consistent view of the + indexshould be maintained for scrolled search. + :arg search_type: The type of the search operation. Valid + choices are query_then_fetch, dfs_query_then_fetch. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg typed_keys: If `true`, the response prefixes aggregation + and suggester names with their respective types. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1858,14 +2504,19 @@ async def search_template( ) @query_params( + "error_trace", "field_statistics", "fields", + "filter_path", + "human", "offsets", "payloads", "positions", "preference", + "pretty", "realtime", "routing", + "source", "term_statistics", "version", "version_type", @@ -1883,29 +2534,40 @@ async def termvectors( document. - :arg index: The index in which the document resides. + :arg index: Name of the index that contains the document. :arg body: Define parameters and or supply a document to get termvectors for. See documentation. - :arg id: Document ID. When not specified a doc param should be - supplied. - :arg field_statistics: Specifies if document count, sum of - document frequencies and sum of total term frequencies should be - returned. Default is True. - :arg fields: Comma-separated list of fields to return. - :arg offsets: Specifies if term offsets should be returned. - Default is True. - :arg payloads: Specifies if term payloads should be returned. - Default is True. - :arg positions: Specifies if term positions should be returned. - Default is True. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specifies if request is real-time as opposed to - near-real-time. Default is True. - :arg routing: Routing value. - :arg term_statistics: Specifies if total term frequency and - document frequency should be returned. Default is false. - :arg version: Explicit version number for concurrency control. + :arg id: Unique identifier of the document. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg field_statistics: If `true`, the response includes the + document count, sum of document frequencies, and sum of total term + frequencies. + :arg fields: Comma-separated list or wildcard expressions of + fields to include in the statistics.Used as the default list unless a + specific field list is provided in the `completion_fields` or + `fielddata_fields` parameters. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg offsets: If `true`, the response includes term offsets. + :arg payloads: If `true`, the response includes term payloads. + :arg positions: If `true`, the response includes term positions. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If true, the request is real-time as opposed to + near-real-time. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg term_statistics: If `true`, the response includes term + frequency and document frequency. + :arg version: If `true`, returns the document version as part of + a hit. :arg version_type: Specific version type. Valid choices are internal, external, external_gte, force. """ @@ -1922,13 +2584,18 @@ async def termvectors( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "if_primary_term", "if_seq_no", "lang", + "pretty", "refresh", "require_alias", "retry_on_conflict", "routing", + "source", "timeout", "wait_for_active_shards", ) @@ -1944,36 +2611,50 @@ async def update( Updates a document with a script or partial document. - :arg index: Index name. - :arg id: Document ID. + :arg index: The name of the index + :arg id: Document ID :arg body: The request definition requires either `script` or partial `doc` - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg if_primary_term: only perform the operation if the last - operation that has changed the document has the specified primary term. - :arg if_seq_no: only perform the operation if the last operation - that has changed the document has the specified sequence number. - :arg lang: The script language. Default is painless. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg require_alias: When true, requires destination to be an - alias. Default is false. + :arg _source: Set to false to disable source retrieval. You can + also specify a comma-separatedlist of the fields you want to retrieve. + :arg _source_excludes: Specify the source fields you want to + exclude. + :arg _source_includes: Specify the source fields you want to + retrieve. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg if_primary_term: Only perform the operation if the document + has this primary term. + :arg if_seq_no: Only perform the operation if the document has + this sequence number. + :arg lang: The script language. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If 'true', Opensearch refreshes the affected + shards to make this operationvisible to search, if 'wait_for' then wait + for a refresh to make this operationvisible to search, if 'false' do + nothing with refreshes. Valid choices are true, false, wait_for. + :arg require_alias: If true, the destination must be an index + alias. :arg retry_on_conflict: Specify how many times should the - operation be retried when a conflict occurs. Default is 0. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + operation be retried when a conflict occurs. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for dynamic mapping updates and + active shards.This guarantees Opensearch waits for at least the timeout + before failing.The actual wait time could be longer, particularly when + multiple waits occur. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operations.Set to 'all' or any + positive integer up to the total number of shards in the + index(number_of_replicas+1). Defaults to 1 meaning the primary shard. + Valid choices are all, index-setting. """ for param in (index, id, body): if param in SKIP_IN_PATH: @@ -1995,13 +2676,17 @@ async def update( "conflicts", "default_operator", "df", + "error_trace", "expand_wildcards", + "filter_path", "from_", + "human", "ignore_unavailable", "lenient", "max_docs", "pipeline", "preference", + "pretty", "q", "refresh", "request_cache", @@ -2014,6 +2699,7 @@ async def update( "size", "slices", "sort", + "source", "stats", "terminate_after", "timeout", @@ -2033,8 +2719,9 @@ async def update_by_query( for example to pick up a mapping change. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + :arg index: Comma-separated list of data streams, indices, and + aliases to search. Supports wildcards (`*`). To search all data streams + or indices, omit this parameter or use `*` or `_all`. :arg body: The search definition using the Query DSL :arg _source: True or false to return the _source field or not, or a list of fields to return. @@ -2042,68 +2729,89 @@ async def update_by_query( returned _source field. :arg _source_includes: List of fields to extract and return from the _source field. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. - :arg conflicts: What to do when the operation encounters version - conflicts?. Valid choices are abort, proceed. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices.For example, a request targeting `foo*,bar*` + returns an error if an index starts with `foo` but no index starts with + `bar`. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed. + :arg analyzer: Analyzer to use for the query string. + :arg conflicts: What to do if update by query hits version + conflicts: `abort` or `proceed`. Valid choices are abort, proceed. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg from_: Starting offset. Default is 0. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg max_docs: Maximum number of documents to process (default: - all documents). - :arg pipeline: The pipeline id to preprocess incoming documents - with. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. + query: `AND` or `OR`. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg from_: Starting offset (default: 0) + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg max_docs: Maximum number of documents to process.Defaults + to all documents. + :arg pipeline: ID of the pipeline to use to preprocess incoming + documents.If the index has a default ingest pipeline specified, then + setting the value to `_none` disables the default ingest pipeline for + this request.If a final pipeline is configured it will always run, + regardless of the value of this parameter. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg refresh: Should the affected indexes be refreshed?. - :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting. + :arg refresh: If `true`, Opensearch refreshes affected shards to + make the operation visible to search. + :arg request_cache: If `true`, the request cache is used for + this request. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. Default is 0. - :arg routing: Comma-separated list of specific routing values. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. - :arg scroll_size: Size on the scroll request powering the - operation. Default is 100. + requests per second. + :arg routing: Custom value used to route operations to a + specific shard. + :arg scroll: Period to retain the search context for scrolling. + :arg scroll_size: Size of the scroll request that powers the + operation. :arg search_timeout: Explicit timeout for each search request. - Defaults to no timeout. - :arg search_type: Search operation type. Valid choices are + :arg search_type: The type of the search operation. Available + options: `query_then_fetch`, `dfs_query_then_fetch`. Valid choices are query_then_fetch, dfs_query_then_fetch. :arg size: Deprecated, please use `max_docs` instead. :arg slices: The number of slices this task should be divided - into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default is 1. - :arg sort: Comma-separated list of : pairs. - :arg stats: Specific 'tag' of the request for logging and + into. Valid choices are auto. + :arg sort: A comma-separated list of : pairs. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stats: Specific `tag` of the request for logging and statistical purposes. - :arg terminate_after: The maximum number of documents to collect - for each shard, upon reaching which the query execution will terminate - early. - :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default is 1m. - :arg version: Whether to return document version as part of a - hit. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is True. + :arg terminate_after: Maximum number of documents to collect for + each shard.If a query reaches this limit, Opensearch terminates the + query early.Opensearch collects documents before sorting.Use with + caution.Opensearch applies this parameter to each shard handling the + request.When possible, let Opensearch perform early termination + automatically.Avoid specifying this parameter for requests that target + data streams with backing indices across multiple data tiers. + :arg timeout: Period each update request waits for the following + operations: dynamic mapping updates, waiting for active shards. + :arg version: If `true`, returns the document version as part of + a hit. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. + :arg wait_for_completion: If `true`, the request blocks until + the operation is complete. """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: @@ -2120,7 +2828,9 @@ async def update_by_query( body=body, ) - @query_params("requests_per_second") + @query_params( + "error_trace", "filter_path", "human", "pretty", "requests_per_second", "source" + ) async def update_by_query_rethrottle( self, task_id: Any, @@ -2132,9 +2842,19 @@ async def update_by_query_rethrottle( operation. - :arg task_id: The task id to rethrottle. + :arg task_id: The ID for the task. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. + requests per second. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -2146,7 +2866,7 @@ async def update_by_query_rethrottle( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_script_context( self, params: Any = None, @@ -2155,12 +2875,23 @@ async def get_script_context( """ Returns all script contexts. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_script_context", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_script_languages( self, params: Any = None, @@ -2169,6 +2900,17 @@ async def get_script_languages( """ Returns available script types, languages and contexts. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_script_language", params=params, headers=headers @@ -2176,10 +2918,15 @@ async def get_script_languages( @query_params( "allow_partial_pit_creation", + "error_trace", "expand_wildcards", + "filter_path", + "human", "keep_alive", "preference", + "pretty", "routing", + "source", ) async def create_pit( self, @@ -2195,13 +2942,23 @@ async def create_pit( string to perform the operation on all indices. :arg allow_partial_pit_creation: Allow if point in time can be created with partial failures. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg keep_alive: Specify the keep alive for point in time. :arg preference: Specify the node or shard the operation should be performed on. Default is random. + :arg pretty: Whether to pretty format the returned JSON + response. :arg routing: Comma-separated list of specific routing values. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -2213,7 +2970,7 @@ async def create_pit( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_all_pits( self, params: Any = None, @@ -2222,12 +2979,23 @@ async def delete_all_pits( """ Deletes all active point in time searches. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "DELETE", "/_search/point_in_time/_all", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_pit( self, body: Any = None, @@ -2239,6 +3007,16 @@ async def delete_pit( :arg body: The point-in-time ids to be deleted + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "DELETE", @@ -2248,7 +3026,7 @@ async def delete_pit( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_all_pits( self, params: Any = None, @@ -2257,6 +3035,17 @@ async def get_all_pits( """ Lists all active point in time searches. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_search/point_in_time/_all", params=params, headers=headers diff --git a/opensearchpy/_async/client/cat.py b/opensearchpy/_async/client/cat.py index 89f7a9a78..a11c237a2 100644 --- a/opensearchpy/_async/client/cat.py +++ b/opensearchpy/_async/client/cat.py @@ -40,7 +40,20 @@ class CatClient(NamespacedClient): - @query_params("expand_wildcards", "format", "h", "help", "local", "s", "v") + @query_params( + "error_trace", + "expand_wildcards", + "filter_path", + "format", + "h", + "help", + "human", + "local", + "pretty", + "s", + "source", + "v", + ) async def aliases( self, name: Any = None, @@ -52,25 +65,49 @@ async def aliases( filter and routing infos. - :arg name: Comma-separated list of alias names. + :arg name: A comma-separated list of aliases to retrieve. + Supports wildcards (`*`). To retrieve all aliases, omit this parameter + or use `*` or `_all`. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "aliases", name), params=params, headers=headers ) - @query_params("bytes", "format", "h", "help", "s", "v") + @query_params( + "bytes", + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "v", + ) async def all_pit_segments( self, params: Any = None, @@ -82,12 +119,22 @@ async def all_pit_segments( :arg bytes: The unit in which to display byte values. Valid choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -97,12 +144,17 @@ async def all_pit_segments( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) async def allocation( @@ -116,23 +168,33 @@ async def allocation( much disk space they are using. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg node_id: Comma-separated list of node identifiers or names + used to limit the returned information. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -144,12 +206,17 @@ async def allocation( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) async def cluster_manager( @@ -163,24 +230,45 @@ async def cluster_manager( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", "/_cat/cluster_manager", params=params, headers=headers ) - @query_params("format", "h", "help", "s", "v") + @query_params( + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "v", + ) async def count( self, index: Any = None, @@ -192,21 +280,44 @@ async def count( individual indices. - :arg index: Comma-separated list of indices to limit the - returned information. + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "count", index), params=params, headers=headers ) - @query_params("bytes", "format", "h", "help", "s", "v") + @query_params( + "bytes", + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "v", + ) async def fielddata( self, fields: Any = None, @@ -218,16 +329,26 @@ async def fielddata( node in the cluster. - :arg fields: Comma-separated list of fields to return in the - output. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg fields: Comma-separated list of fields used to limit + returned information. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -237,7 +358,20 @@ async def fielddata( headers=headers, ) - @query_params("format", "h", "help", "s", "time", "ts", "v") + @query_params( + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "time", + "ts", + "v", + ) async def health( self, params: Any = None, @@ -247,22 +381,34 @@ async def health( Returns a concise representation of the cluster health. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. - :arg ts: Set to false to disable timestamping. Default is True. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg time: The unit used to display time values. Valid choices + are nanos, micros, ms, s, m, h, d. + :arg ts: If true, returns `HH:MM:SS` and Unix epoch timestamps. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", "/_cat/health", params=params, headers=headers ) - @query_params("help", "s") + @query_params( + "error_trace", "filter_path", "help", "human", "pretty", "s", "source" + ) async def help( self, params: Any = None, @@ -272,9 +418,19 @@ async def help( Returns help for the Cat APIs. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_cat", params=params, headers=headers @@ -283,16 +439,21 @@ async def help( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "format", "h", "health", "help", + "human", "include_unloaded_segments", "local", "master_timeout", + "pretty", "pri", "s", + "source", "time", "v", ) @@ -307,36 +468,45 @@ async def indices( counts, disk size, ... - :arg index: Comma-separated list of indices to limit the - returned information. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: The type of index that wildcard patterns + can match. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg health: Health status ('green', 'yellow', or 'red') to - filter only indices matching the specified health status. Valid choices - are green, yellow, red. + :arg health: The health status used to limit returned indices. + By default, the response includes indices of any health status. Valid + choices are green, yellow, red. :arg help: Return help information. Default is false. - :arg include_unloaded_segments: If set to true segment stats - will include stats for segments that are not currently loaded into - memory. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg include_unloaded_segments: If true, the response includes + information from segments that are not loaded into memory. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. - :arg pri: Set to true to return stats only for primary shards. - Default is false. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg pri: If true, the response only includes information from + primary shards. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg time: The unit used to display time values. Valid choices + are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -345,12 +515,17 @@ async def indices( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) async def master( @@ -364,17 +539,27 @@ async def master( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ from warnings import warn @@ -388,12 +573,17 @@ async def master( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) async def nodeattrs( @@ -407,17 +597,27 @@ async def nodeattrs( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -427,13 +627,18 @@ async def nodeattrs( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "full_id", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "time", "v", ) @@ -446,26 +651,35 @@ async def nodes( Returns basic statistics about performance of cluster nodes. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. - :arg full_id: Return the full node ID instead of the shortened - version. Default is false. + :arg full_id: If `true`, return the full node ID. If `false`, + return the shortened node ID. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. - :arg local (Deprecated: This parameter does not cause this API - to act locally.): Return local information, do not retrieve the state + :arg human: Whether to return human readable values for + statistics. + :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -474,12 +688,17 @@ async def nodes( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "time", "v", ) @@ -494,26 +713,48 @@ async def pending_tasks( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", "/_cat/pending_tasks", params=params, headers=headers ) - @query_params("bytes", "format", "h", "help", "s", "v") + @query_params( + "bytes", + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "v", + ) async def pit_segments( self, body: Any = None, @@ -526,12 +767,22 @@ async def pit_segments( :arg bytes: The unit in which to display byte values. Valid choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -540,12 +791,17 @@ async def pit_segments( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) async def plugins( @@ -559,17 +815,27 @@ async def plugins( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -577,7 +843,20 @@ async def plugins( ) @query_params( - "active_only", "bytes", "detailed", "format", "h", "help", "s", "time", "v" + "active_only", + "bytes", + "detailed", + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "time", + "v", ) async def recovery( self, @@ -592,19 +871,29 @@ async def recovery( :arg index: Comma-separated list or wildcard expression of index names to limit the returned information. :arg active_only: If `true`, the response only includes ongoing - shard recoveries. Default is false. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + shard recoveries. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg detailed: If `true`, the response includes detailed - information about shard recoveries. Default is false. + information about shard recoveries. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -613,12 +902,17 @@ async def recovery( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) async def repositories( @@ -632,17 +926,27 @@ async def repositories( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -655,14 +959,19 @@ async def repositories( "bytes", "completed_only", "detailed", + "error_trace", "expand_wildcards", + "filter_path", "format", "h", "help", + "human", "ignore_throttled", "ignore_unavailable", + "pretty", "s", "shards", + "source", "time", "timeout", "v", @@ -691,22 +1000,32 @@ async def segment_replication( latest completed segment replication events. Default is false. :arg detailed: If `true`, the response includes detailed information about segment replications. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg ignore_throttled: Whether specified concrete, expanded or aliased indices should be ignored when throttled. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. :arg shards: Comma-separated list of shards to display. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg timeout: Operation timeout. :arg v: Verbose mode. Display column headers. Default is false. """ @@ -720,11 +1039,16 @@ async def segment_replication( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "master_timeout", + "pretty", "s", + "source", "v", ) async def segments( @@ -737,21 +1061,32 @@ async def segments( Provides low-level information about the segments in the shards of an index. - :arg index: Comma-separated list of indices to limit the - returned information. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg index: A comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -761,12 +1096,17 @@ async def segments( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "time", "v", ) @@ -780,25 +1120,36 @@ async def shards( Provides a detailed view of shard allocation on nodes. - :arg index: Comma-separated list of indices to limit the - returned information. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg index: A comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -807,13 +1158,18 @@ async def shards( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", "size", + "source", "v", ) async def thread_pool( @@ -827,22 +1183,32 @@ async def thread_pool( queue and rejected statistics are returned for all thread pools. - :arg thread_pool_patterns: Comma-separated list of regular- - expressions to filter the thread pools in the output. + :arg thread_pool_patterns: A comma-separated list of thread pool + names used to limit the request. Accepts wildcard expressions. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. :arg size: The multiplier in which to display values. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -854,12 +1220,17 @@ async def thread_pool( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "ignore_unavailable", "master_timeout", + "pretty", "s", + "source", "time", "v", ) @@ -873,23 +1244,35 @@ async def snapshots( Returns all snapshots in a specific repository. - :arg repository: Comma-separated list of repository names. + :arg repository: A comma-separated list of snapshot repositories + used to limit the request. Accepts wildcard expressions. `_all` returns + all repositories. If any repository fails during the request, Opensearch + returns an error. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). Default is - false. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `true`, the response does not + include information from unavailable snapshots. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -902,12 +1285,17 @@ async def snapshots( @query_params( "actions", "detailed", + "error_trace", + "filter_path", "format", "h", "help", + "human", "nodes", "parent_task_id", + "pretty", "s", + "source", "time", "v", ) @@ -921,24 +1309,34 @@ async def tasks( the cluster. - :arg actions: Comma-separated list of actions that should be - returned. Leave empty to return all. - :arg detailed: Return detailed task information. Default is - false. + :arg actions: The task action names, which are used to limit the + response. + :arg detailed: If `true`, the response includes detailed + information about shard recoveries. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg nodes: Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. - :arg parent_task_id: Return tasks with specified parent task id - (node_id:task_number). Set to -1 to return all. + :arg parent_task_id: The parent task identifier, which is used + to limit the response. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -947,12 +1345,17 @@ async def tasks( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) async def templates( @@ -965,20 +1368,31 @@ async def templates( Returns information about existing templates. - :arg name: The name of the template. + :arg name: The name of the template to return. Accepts wildcard + expressions. If omitted, all templates are returned. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( diff --git a/opensearchpy/_async/client/cluster.py b/opensearchpy/_async/client/cluster.py index 70d93cf8e..71c6ee28d 100644 --- a/opensearchpy/_async/client/cluster.py +++ b/opensearchpy/_async/client/cluster.py @@ -43,10 +43,15 @@ class ClusterClient(NamespacedClient): @query_params( "awareness_attribute", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "level", "local", "master_timeout", + "pretty", + "source", "timeout", "wait_for_active_shards", "wait_for_events", @@ -65,36 +70,63 @@ async def health( Returns basic information about the health of the cluster. - :arg index: Limit the information returned to specific indicies. + :arg index: Comma-separated list of data streams, indices, and + index aliases used to limit the request. Wildcard expressions (*) are + supported. To target all data streams and indices in a cluster, omit + this parameter or use `_all` or `*`. :arg awareness_attribute: The awareness attribute for which the health is required. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. - :arg level: Specify the level of detail for returned - information. Valid choices are cluster, indices, shards, - awareness_attributes. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg level: Can be one of cluster, indices or shards. Controls + the details level of the health information returned. Valid choices are + cluster, indices, shards, awareness_attributes. + :arg local: If true, the request retrieves information from the + local node only. Defaults to false, which means information is retrieved + from the master node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Wait until the specified number of - shards is active. - :arg wait_for_events: Wait until all currently queued events - with the given priority are processed. Valid choices are immediate, - urgent, high, normal, low, languid. - :arg wait_for_no_initializing_shards: Whether to wait until - there are no initializing shards in the cluster. - :arg wait_for_no_relocating_shards: Whether to wait until there - are no relocating shards in the cluster. - :arg wait_for_nodes: Wait until the specified number of nodes is - available. - :arg wait_for_status: Wait until cluster is in a specific state. - Valid choices are green, yellow, red. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: A number controlling to how many + active shards to wait for, all to wait for all shards in the cluster to + be active, or 0 to not wait. Valid choices are all, index-setting. + :arg wait_for_events: Can be one of immediate, urgent, high, + normal, low, languid. Wait until all currently queued events with the + given priority are processed. Valid choices are immediate, urgent, high, + normal, low, languid. + :arg wait_for_no_initializing_shards: A boolean value which + controls whether to wait (until the timeout provided) for the cluster to + have no shard initializations. Defaults to false, which means it will + not wait for initializing shards. + :arg wait_for_no_relocating_shards: A boolean value which + controls whether to wait (until the timeout provided) for the cluster to + have no shard relocations. Defaults to false, which means it will not + wait for relocating shards. + :arg wait_for_nodes: The request waits until the specified + number N of nodes is available. It also accepts >=N, <=N, >N and yellow > red. By default, will + not wait for any status. Valid choices are green, yellow, red. """ return await self.transport.perform_request( "GET", @@ -103,7 +135,16 @@ async def health( headers=headers, ) - @query_params("cluster_manager_timeout", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) async def pending_tasks( self, params: Any = None, @@ -116,11 +157,23 @@ async def pending_tasks( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg local: If `true`, the request retrieves information from + the local node only.If `false`, information is retrieved from the master + node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_cluster/pending_tasks", params=params, headers=headers @@ -129,11 +182,16 @@ async def pending_tasks( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "local", "master_timeout", + "pretty", + "source", "wait_for_metadata_version", "wait_for_timeout", ) @@ -149,31 +207,40 @@ async def state( :arg metric: Limit the information returned to the specified - metrics. Valid choices are _all, blocks, metadata, nodes, routing_table, - routing_nodes, master_node, cluster_manager_node, version. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + metrics + :arg index: A comma-separated list of index names; use `_all` or + empty string to perform the operation on all indices :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + string or when no indices have been specified) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: Return settings in flat format (default: + false) + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + should be ignored when unavailable (missing or closed) :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + from cluster-manager node (default: false) :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_metadata_version: Wait for the metadata version to - be equal or greater than the specified metadata version. + be equal or greater than the specified metadata version :arg wait_for_timeout: The maximum time to wait for - wait_for_metadata_version before timing out. + wait_for_metadata_version before timing out """ if index and metric in SKIP_IN_PATH: metric = "_all" @@ -185,7 +252,15 @@ async def state( headers=headers, ) - @query_params("flat_settings", "timeout") + @query_params( + "error_trace", + "filter_path", + "flat_settings", + "human", + "pretty", + "source", + "timeout", + ) async def stats( self, node_id: Any = None, @@ -196,19 +271,31 @@ async def stats( Returns high-level overview of cluster statistics. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg timeout: Operation timeout. + :arg node_id: Comma-separated list of node filters used to limit + returned information. Defaults to all nodes in the cluster. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for each node to respond.If a node + does not respond before its timeout expires, the response does not + include its stats.However, timed out nodes are included in the + response’s `_nodes.failed` property. Defaults to no timeout. """ return await self.transport.perform_request( "GET", - "/_cluster/stats" - if node_id in SKIP_IN_PATH - else _make_path("_cluster", "stats", "nodes", node_id), + ( + "/_cluster/stats" + if node_id in SKIP_IN_PATH + else _make_path("_cluster", "stats", "nodes", node_id) + ), params=params, headers=headers, ) @@ -216,10 +303,15 @@ async def stats( @query_params( "cluster_manager_timeout", "dry_run", + "error_trace", "explain", + "filter_path", + "human", "master_timeout", "metric", + "pretty", "retry_failed", + "source", "timeout", ) async def reroute( @@ -236,18 +328,31 @@ async def reroute( `cancel`, `allocate`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg dry_run: Simulate the operation only and return the - resulting state. - :arg explain: Return an explanation of why the commands can or - cannot be executed. + :arg dry_run: If true, then the request simulates the operation + only and returns the resulting state. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg explain: If true, then the response contains an explanation + of why the commands can or cannot be executed. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg metric: Limit the information returned to the specified - metrics. Defaults to all but metadata. - :arg retry_failed: Retries allocation of shards that are blocked - due to too many subsequent allocation failures. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg metric: Limits the information returned to the specified + metrics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg retry_failed: If true, then retries allocation of shards + that are blocked due to too many subsequent allocation failures. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ return await self.transport.perform_request( "POST", "/_cluster/reroute", params=params, headers=headers, body=body @@ -255,9 +360,14 @@ async def reroute( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "flat_settings", + "human", "include_defaults", "master_timeout", + "pretty", + "source", "timeout", ) async def get_settings( @@ -271,21 +381,41 @@ async def get_settings( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg include_defaults: Whether to return all default clusters - setting. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg include_defaults: If `true`, returns default cluster + settings from the local node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ return await self.transport.perform_request( "GET", "/_cluster/settings", params=params, headers=headers ) @query_params( - "cluster_manager_timeout", "flat_settings", "master_timeout", "timeout" + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "master_timeout", + "pretty", + "source", + "timeout", ) async def put_settings( self, @@ -301,12 +431,22 @@ async def put_settings( or `persistent` (survives cluster restart). :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: Return settings in flat format (default: + false) + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -315,7 +455,7 @@ async def put_settings( "PUT", "/_cluster/settings", params=params, headers=headers, body=body ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def remote_info( self, params: Any = None, @@ -324,12 +464,31 @@ async def remote_info( """ Returns the information about configured remote clusters. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_remote/info", params=params, headers=headers ) - @query_params("include_disk_info", "include_yes_decisions") + @query_params( + "error_trace", + "filter_path", + "human", + "include_disk_info", + "include_yes_decisions", + "pretty", + "source", + ) async def allocation_explain( self, body: Any = None, @@ -342,10 +501,20 @@ async def allocation_explain( :arg body: The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' - :arg include_disk_info: Return information about disk usage and - shard sizes. Default is false. - :arg include_yes_decisions: Return 'YES' decisions in - explanation. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg include_disk_info: If true, returns information about disk + usage and shard sizes. + :arg include_yes_decisions: If true, returns YES decisions in + explanation. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", @@ -355,7 +524,16 @@ async def allocation_explain( body=body, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def delete_component_template( self, name: Any, @@ -366,13 +544,27 @@ async def delete_component_template( Deletes a component template. - :arg name: The name of the template. + :arg name: Name of the component template to delete. Wildcard + (*) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -384,7 +576,16 @@ async def delete_component_template( headers=headers, ) - @query_params("cluster_manager_timeout", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) async def get_component_template( self, name: Any = None, @@ -395,14 +596,27 @@ async def get_component_template( Returns one or more component templates. - :arg name: The Comma-separated names of the component templates. + :arg name: Name of the component template to retrieve. Wildcard + (`*`) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg local: If `true`, the request retrieves information from + the local node only.If `false`, information is retrieved from the master + node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", @@ -411,7 +625,17 @@ async def get_component_template( headers=headers, ) - @query_params("cluster_manager_timeout", "create", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def put_component_template( self, name: Any, @@ -423,15 +647,35 @@ async def put_component_template( Creates or updates a component template. - :arg name: The name of the template. + :arg name: Name of the component template to create. Opensearch + includes the following built-in component templates: `logs-mappings`; + 'logs-settings`; `metrics-mappings`; `metrics-settings`;`synthetics- + mapping`; `synthetics-settings`. Opensearch Agent uses these templates + to configure backing indices for its data streams. If you use Opensearch + Agent and want to overwrite one of these templates, set the `version` + for your replacement template higher than the current version. If you + don’t use Opensearch Agent and want to disable all built-in component + and index templates, set `stack.templates.enabled` to `false` using the + cluster update settings API. :arg body: The template definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template should only be added if - new or can also replace an existing one. Default is false. + :arg create: If `true`, this request cannot replace or update + existing component templates. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg timeout: Operation timeout. """ for param in (name, body): @@ -446,7 +690,16 @@ async def put_component_template( body=body, ) - @query_params("cluster_manager_timeout", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) async def exists_component_template( self, name: Any, @@ -457,14 +710,27 @@ async def exists_component_template( Returns information about whether a particular component template exist. - :arg name: The name of the template. + :arg name: Name of the component template to check existence of. + Wildcard (*) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg local: If true, the request retrieves information from the + local node only.Defaults to false, which means information is retrieved + from the master node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response isreceived before the timeout + expires, the request fails and returns anerror. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -476,7 +742,9 @@ async def exists_component_template( headers=headers, ) - @query_params("wait_for_removal") + @query_params( + "error_trace", "filter_path", "human", "pretty", "source", "wait_for_removal" + ) async def delete_voting_config_exclusions( self, params: Any = None, @@ -486,9 +754,22 @@ async def delete_voting_config_exclusions( Clears cluster voting config exclusions. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_removal: Specifies whether to wait for all - excluded nodes to be removed from the cluster before clearing the voting - configuration exclusions list. Default is True. + excluded nodes to be removed from thecluster before clearing the voting + configuration exclusions list.Defaults to true, meaning that all + excluded nodes must be removed fromthe cluster before this API takes any + action. If set to false then thevoting configuration exclusions list is + cleared even if some excludednodes are still in the cluster. """ return await self.transport.perform_request( "DELETE", @@ -497,7 +778,16 @@ async def delete_voting_config_exclusions( headers=headers, ) - @query_params("node_ids", "node_names", "timeout") + @query_params( + "error_trace", + "filter_path", + "human", + "node_ids", + "node_names", + "pretty", + "source", + "timeout", + ) async def post_voting_config_exclusions( self, params: Any = None, @@ -507,19 +797,33 @@ async def post_voting_config_exclusions( Updates the cluster voting config exclusions by node ids or node names. - :arg node_ids: Comma-separated list of the persistent ids of the - nodes to exclude from the voting configuration. If specified, you may - not also specify ?node_names. - :arg node_names: Comma-separated list of the names of the nodes - to exclude from the voting configuration. If specified, you may not also - specify ?node_ids. - :arg timeout: Operation timeout. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg node_ids: A comma-separated list of the persistent ids of + the nodes to excludefrom the voting configuration. If specified, you may + not also specify node_names. + :arg node_names: A comma-separated list of the names of the + nodes to exclude from thevoting configuration. If specified, you may not + also specify node_ids. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: When adding a voting configuration exclusion, the + API waits for thespecified nodes to be excluded from the voting + configuration beforereturning. If the timeout expires before the + appropriate conditionis satisfied, the request fails and returns an + error. """ return await self.transport.perform_request( "POST", "/_cluster/voting_config_exclusions", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_decommission_awareness( self, params: Any = None, @@ -528,15 +832,23 @@ async def delete_decommission_awareness( """ Delete any existing decommission. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( - "DELETE", - "/_cluster/decommission/awareness/", - params=params, - headers=headers, + "DELETE", "/_cluster/decommission/awareness", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_weighted_routing( self, params: Any = None, @@ -545,6 +857,17 @@ async def delete_weighted_routing( """ Delete weighted shard routing weights. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "DELETE", @@ -553,7 +876,7 @@ async def delete_weighted_routing( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_decommission_awareness( self, awareness_attribute_name: Any, @@ -565,6 +888,16 @@ async def get_decommission_awareness( :arg awareness_attribute_name: Awareness attribute name. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if awareness_attribute_name in SKIP_IN_PATH: raise ValueError( @@ -584,7 +917,7 @@ async def get_decommission_awareness( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_weighted_routing( self, attribute: Any, @@ -596,6 +929,16 @@ async def get_weighted_routing( :arg attribute: Awareness attribute name. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if attribute in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'attribute'.") @@ -607,7 +950,7 @@ async def get_weighted_routing( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def put_decommission_awareness( self, awareness_attribute_name: Any, @@ -621,6 +964,16 @@ async def put_decommission_awareness( :arg awareness_attribute_name: Awareness attribute name. :arg awareness_attribute_value: Awareness attribute value. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (awareness_attribute_name, awareness_attribute_value): if param in SKIP_IN_PATH: @@ -639,7 +992,7 @@ async def put_decommission_awareness( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def put_weighted_routing( self, attribute: Any, @@ -651,6 +1004,16 @@ async def put_weighted_routing( :arg attribute: Awareness attribute name. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if attribute in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'attribute'.") diff --git a/opensearchpy/_async/client/dangling_indices.py b/opensearchpy/_async/client/dangling_indices.py index beb242474..75e64013d 100644 --- a/opensearchpy/_async/client/dangling_indices.py +++ b/opensearchpy/_async/client/dangling_indices.py @@ -41,7 +41,15 @@ class DanglingIndicesClient(NamespacedClient): @query_params( - "accept_data_loss", "cluster_manager_timeout", "master_timeout", "timeout" + "accept_data_loss", + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", ) async def delete_dangling_index( self, @@ -53,15 +61,25 @@ async def delete_dangling_index( Deletes the specified dangling index. - :arg index_uuid: The UUID of the dangling index. + :arg index_uuid: The UUID of the dangling index :arg accept_data_loss: Must be set to true in order to delete - the dangling index. + the dangling index :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if index_uuid in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index_uuid'.") @@ -74,7 +92,15 @@ async def delete_dangling_index( ) @query_params( - "accept_data_loss", "cluster_manager_timeout", "master_timeout", "timeout" + "accept_data_loss", + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", ) async def import_dangling_index( self, @@ -86,15 +112,25 @@ async def import_dangling_index( Imports the specified dangling index. - :arg index_uuid: The UUID of the dangling index. + :arg index_uuid: The UUID of the dangling index :arg accept_data_loss: Must be set to true in order to import - the dangling index. + the dangling index :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if index_uuid in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index_uuid'.") @@ -103,7 +139,7 @@ async def import_dangling_index( "POST", _make_path("_dangling", index_uuid), params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def list_dangling_indices( self, params: Any = None, @@ -112,6 +148,17 @@ async def list_dangling_indices( """ Returns all dangling indices. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_dangling", params=params, headers=headers diff --git a/opensearchpy/_async/client/indices.py b/opensearchpy/_async/client/indices.py index cf86b46fa..6ee29c1d4 100644 --- a/opensearchpy/_async/client/indices.py +++ b/opensearchpy/_async/client/indices.py @@ -40,7 +40,7 @@ class IndicesClient(NamespacedClient): - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def analyze( self, body: Any = None, @@ -56,6 +56,16 @@ async def analyze( :arg body: Define analyzer/tokenizer parameters and the text on which the analysis should be performed :arg index: The name of the index to scope the operation. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", @@ -65,7 +75,16 @@ async def analyze( body=body, ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") + @query_params( + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "source", + ) async def refresh( self, index: Any = None, @@ -76,16 +95,30 @@ async def refresh( Performs the refresh operation in one or more indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", _make_path(index, "_refresh"), params=params, headers=headers @@ -93,9 +126,14 @@ async def refresh( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", "force", + "human", "ignore_unavailable", + "pretty", + "source", "wait_if_ongoing", ) async def flush( @@ -108,32 +146,51 @@ async def flush( Performs the flush operation on one or more indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg force: Whether a flush should be forced even if it is not - necessarily needed ie. if no changes will be committed to the index. - This is useful if transaction log IDs should be incremented even if no - uncommitted changes are present. (This setting can be considered as - internal). - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg wait_if_ongoing: If set to true the flush operation will - block until the flush can be executed if another flush operation is - already executing. If set to false the flush will be skipped iff if - another flush operation is already running. Default is True. + :arg index: Comma-separated list of data streams, indices, and + aliases to flush. Supports wildcards (`*`). To flush all data streams + and indices, omit this parameter or use `*` or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg force: If `true`, the request forces a flush even if there + are no changes to commit to the index. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg wait_if_ongoing: If `true`, the flush operation blocks + until execution when another flush operation is running.If `false`, + Opensearch returns an error if you request a flush when another flush + operation is running. """ return await self.transport.perform_request( "POST", _make_path(index, "_flush"), params=params, headers=headers ) @query_params( - "cluster_manager_timeout", "master_timeout", "timeout", "wait_for_active_shards" + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + "wait_for_active_shards", ) async def create( self, @@ -146,17 +203,32 @@ async def create( Creates an index with optional settings and mappings. - :arg index: Index name. + :arg index: Name of the index you wish to create. :arg body: The configuration for the index (`settings` and `mappings`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for before the operation returns. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation. Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -167,7 +239,12 @@ async def create( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", "master_timeout", + "pretty", + "source", "task_execution_timeout", "timeout", "wait_for_active_shards", @@ -185,20 +262,35 @@ async def clone( Clones an index. - :arg index: The name of the source index to clone. - :arg target: The name of the target index. + :arg index: Name of the source index to clone. + :arg target: Name of the target index to create. :arg body: The configuration for the target index (`settings` and `aliases`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg task_execution_timeout: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for on the cloned index before the operation returns. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -217,12 +309,17 @@ async def clone( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "include_defaults", "local", "master_timeout", + "pretty", + "source", ) async def get( self, @@ -234,27 +331,43 @@ async def get( Returns information about one or more indices. - :arg index: Comma-separated list of indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). Default is false. + :arg index: Comma-separated list of data streams, indices, and + index aliases used to limit the request. Wildcard expressions (*) are + supported. + :arg allow_no_indices: If false, the request returns an error if + any wildcard expression, index alias, or _all value targets onlymissing + or closed indices. This behavior applies even if the request targets + other open indices. For example,a request targeting foo*,bar* returns an + error if an index starts with foo but no index starts with bar. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). Default is - false. - :arg include_defaults: Whether to return all default setting for - each of the indices. Default is false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard expressions + can match. If the request can target data streams, this + argumentdetermines whether wildcard expressions match hidden data + streams. Supports comma-separated values,such as open,hidden. Valid + choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If true, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If false, requests that target a + missing index return an error. + :arg include_defaults: If true, return all default settings in + the response. + :arg local: If true, the request retrieves information from the + local node only. Defaults to false, which means information is retrieved + from the master node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -266,9 +379,14 @@ async def get( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "task_execution_timeout", "timeout", "wait_for_active_shards", @@ -284,25 +402,49 @@ async def open( Opens an index. - :arg index: Comma-separated list of indices to open. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). By default, + you must explicitly name the indices you using to limit the request. To + limit a request using `_all`, `*`, or other wildcard expressions, change + the `action.destructive_requires_name` setting to false. You can update + this setting in the `opensearch.yml` file or using the cluster update + settings API. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg task_execution_timeout: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Sets the number of active shards to - wait for before the operation returns. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -316,9 +458,14 @@ async def open( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "timeout", "wait_for_active_shards", ) @@ -332,23 +479,42 @@ async def close( Closes an index. - :arg index: Comma-separated list of indices to close. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg index: Comma-separated list or wildcard expression of index + names used to limit the request. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Sets the number of active shards to - wait for before the operation returns. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -360,9 +526,14 @@ async def close( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "timeout", ) async def delete( @@ -375,23 +546,40 @@ async def delete( Deletes an index. - :arg index: Comma-separated list of indices to delete; use - `_all` or `*` string to delete all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). Default is false. + :arg index: Comma-separated list of indices to delete. You + cannot specify index aliases. By default, this parameter does not + support wildcards (`*`) or `_all`. To use wildcards or `_all`, set the + `action.destructive_requires_name` cluster setting to `false`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). Default is - false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -402,11 +590,16 @@ async def delete( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "include_defaults", "local", + "pretty", + "source", ) async def exists( self, @@ -418,22 +611,34 @@ async def exists( Returns information about whether a particular index exists. - :arg index: Comma-separated list of indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). Default is false. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). Default is - false. - :arg include_defaults: Whether to return all default setting for - each of the indices. Default is false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg index: Comma-separated list of data streams, indices, and + aliases. Supports wildcards (`*`). + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg include_defaults: If `true`, return all default settings in + the response. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -445,9 +650,14 @@ async def exists( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "timeout", "write_index_only", ) @@ -465,22 +675,38 @@ async def put_mapping( :arg body: The mapping definition :arg index: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg write_index_only: When true, applies mappings only to the - write index of an alias or data stream. Default is false. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg write_index_only: If `true`, the mappings are applied only + to the current write index for the target. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -499,10 +725,15 @@ async def put_mapping( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "local", "master_timeout", + "pretty", + "source", ) async def get_mapping( self, @@ -514,23 +745,38 @@ async def get_mapping( Returns mappings for one or more indices. - :arg index: Comma-separated list of indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg local (Deprecated: This parameter is a no-op and field - mappings are always retrieved locally.): Return local information, do - not retrieve the state from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg local: If `true`, the request retrieves information from + the local node only. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path(index, "_mapping"), params=params, headers=headers @@ -538,10 +784,15 @@ async def get_mapping( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "include_defaults", "local", + "pretty", + "source", ) async def get_field_mapping( self, @@ -554,20 +805,36 @@ async def get_field_mapping( Returns mapping for one or more fields. - :arg fields: Comma-separated list of fields. - :arg index: Comma-separated list of indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg include_defaults: Whether the default mapping values should - be returned as well. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg fields: Comma-separated list or wildcard expression of + fields used to limit returned information. + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg include_defaults: If `true`, return all default settings in + the response. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if fields in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'fields'.") @@ -579,7 +846,16 @@ async def get_field_mapping( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def put_alias( self, index: Any, @@ -592,17 +868,32 @@ async def put_alias( Creates or updates an alias. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg name: The name of the alias to be created or updated. + :arg index: Comma-separated list of data streams or indices to + add. Supports wildcards (`*`). Wildcard patterns that match both data + streams and indices return an error. + :arg name: Alias to update. If the alias doesn’t exist, the + request creates it. Index alias names support date math. :arg body: The settings for the alias, such as `routing` or `filter` :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ for param in (index, name): if param in SKIP_IN_PATH: @@ -616,7 +907,17 @@ async def put_alias( body=body, ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable", "local") + @query_params( + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "local", + "pretty", + "source", + ) async def exists_alias( self, name: Any, @@ -628,18 +929,35 @@ async def exists_alias( Returns information about whether a particular alias exists. - :arg name: Comma-separated list of alias names. - :arg index: Comma-separated list of indices to filter aliases. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg name: Comma-separated list of aliases to check. Supports + wildcards (`*`). + :arg index: Comma-separated list of data streams or indices used + to limit the request. Supports wildcards (`*`). To target all data + streams and indices, omit this parameter or use `*` or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, requests that include a + missing data stream or index in the target indices or data streams + return an error. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -648,7 +966,17 @@ async def exists_alias( "HEAD", _make_path(index, "_alias", name), params=params, headers=headers ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable", "local") + @query_params( + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "local", + "pretty", + "source", + ) async def get_alias( self, index: Any = None, @@ -660,24 +988,50 @@ async def get_alias( Returns an alias. - :arg index: Comma-separated list of indices to filter aliases. - :arg name: Comma-separated list of alias names. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg index: Comma-separated list of data streams or indices used + to limit the request. Supports wildcards (`*`). To target all data + streams and indices, omit this parameter or use `*` or `_all`. + :arg name: Comma-separated list of aliases to retrieve. Supports + wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` + or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path(index, "_alias", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def update_aliases( self, body: Any, @@ -691,10 +1045,23 @@ async def update_aliases( :arg body: The definition of `actions` to perform :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -703,7 +1070,16 @@ async def update_aliases( "POST", "/_aliases", params=params, headers=headers, body=body ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def delete_alias( self, index: Any, @@ -715,16 +1091,29 @@ async def delete_alias( Deletes an alias. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg name: Comma-separated list of aliases to delete (supports - wildcards); use `_all` to delete all aliases for the specified indices. + :arg index: Comma-separated list of data streams or indices used + to limit the request. Supports wildcards (`*`). + :arg name: Comma-separated list of aliases to remove. Supports + wildcards (`*`). To remove all aliases, use `*` or `_all`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ for param in (index, name): if param in SKIP_IN_PATH: @@ -734,7 +1123,17 @@ async def delete_alias( "DELETE", _make_path(index, "_alias", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "create", "master_timeout", "order") + @query_params( + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "order", + "pretty", + "source", + ) async def put_template( self, name: Any, @@ -746,18 +1145,30 @@ async def put_template( Creates or updates an index template. - :arg name: The name of the template. + :arg name: The name of the template :arg body: The template definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template should only be added if - new or can also replace an existing one. Default is false. + :arg create: If true, this request cannot replace or update + existing index templates. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg order: The order for this template when merging multiple - matching ones (higher numbers are merged later, overriding the lower - numbers). + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response isreceived before the timeout + expires, the request fails and returns an error. + :arg order: Order in which Opensearch applies this template if + indexmatches multiple templates.Templates with lower 'order' values are + merged first. Templates with higher'order' values are merged later, + overriding templates with lower values. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (name, body): if param in SKIP_IN_PATH: @@ -771,7 +1182,17 @@ async def put_template( body=body, ) - @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) async def exists_template( self, name: Any, @@ -782,16 +1203,26 @@ async def exists_template( Returns information about whether a particular index template exists. - :arg name: Comma-separated names of the index templates. + :arg name: The comma separated names of the index templates :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: Return settings in flat format (default: + false) + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + from cluster-manager node (default: false) :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -800,7 +1231,17 @@ async def exists_template( "HEAD", _make_path("_template", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) async def get_template( self, name: Any = None, @@ -811,22 +1252,44 @@ async def get_template( Returns an index template. - :arg name: Comma-separated names of the index templates. + :arg name: Comma-separated list of index template names used to + limit the request. Wildcard (`*`) expressions are supported. To return + all index templates, omit this parameter or use a value of `_all` or + `*`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg local: If `true`, the request retrieves information from + the local node only. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path("_template", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def delete_template( self, name: Any, @@ -837,13 +1300,27 @@ async def delete_template( Deletes an index template. - :arg name: The name of the template. + :arg name: The name of the legacy index template to delete. + Wildcard (`*`) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -855,12 +1332,17 @@ async def delete_template( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "include_defaults", "local", "master_timeout", + "pretty", + "source", ) async def get_settings( self, @@ -873,28 +1355,46 @@ async def get_settings( Returns settings for one or more indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg name: Comma-separated list of settings. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg name: Comma-separated list or wildcard expression of + settings to retrieve. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, indexalias, or `_all` value targets only + missing or closed indices. Thisbehavior applies even if the request + targets other open indices. Forexample, a request targeting `foo*,bar*` + returns an error if an indexstarts with foo but no index starts with + `bar`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg include_defaults: Whether to return all default setting for - each of the indices. Default is false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`. Valid choices are all, open, + closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg include_defaults: If `true`, return all default settings in + the response. + :arg local: If `true`, the request retrieves information from + the local node only. If`false`, information is retrieved from the master + node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response isreceived before the timeout + expires, the request fails and returns anerror. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path(index, "_settings", name), params=params, headers=headers @@ -903,11 +1403,16 @@ async def get_settings( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "master_timeout", "preserve_existing", + "pretty", + "source", "timeout", ) async def put_settings( @@ -921,28 +1426,44 @@ async def put_settings( Updates the index settings. - :arg body: The index settings to be updated - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, indexalias, or `_all` value targets only + missing or closed indices. Thisbehavior applies even if the request + targets other open indices. Forexample, a request targeting `foo*,bar*` + returns an error if an indexstarts with `foo` but no index starts with + `bar`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match. If the request can targetdata streams, this argument determines + whether wildcard expressions matchhidden data streams. Supports comma- + separated values, such as`open,hidden`. Valid choices are all, open, + closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg preserve_existing: Whether to update existing settings. If - set to `true` existing settings on an index remain unchanged. Default is - false. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response isreceived before the timeout + expires, the request fails and returns anerror. + :arg preserve_existing: If `true`, existing index settings + remain unchanged. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -957,14 +1478,19 @@ async def put_settings( @query_params( "completion_fields", + "error_trace", "expand_wildcards", "fielddata_fields", "fields", + "filter_path", "forbid_closed_indices", "groups", + "human", "include_segment_file_sizes", "include_unloaded_segments", "level", + "pretty", + "source", ) async def stats( self, @@ -977,41 +1503,58 @@ async def stats( Provides statistics on operations happening in an index. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + :arg index: A comma-separated list of index names; use `_all` or + empty string to perform the operation on all indices :arg metric: Limit the information returned the specific - metrics. Valid choices are _all, store, indexing, get, search, merge, - flush, refresh, query_cache, fielddata, docs, warmer, completion, - segments, translog, suggest, request_cache, recovery. - :arg completion_fields: Comma-separated list of fields for - `fielddata` and `suggest` index metric (supports wildcards). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg fielddata_fields: Comma-separated list of fields for - `fielddata` index metric (supports wildcards). - :arg fields: Comma-separated list of fields for `fielddata` and - `completion` index metric (supports wildcards). - :arg forbid_closed_indices: If set to false stats will also - collected from closed indices if explicitly specified or if - expand_wildcards expands to closed indices. Default is True. - :arg groups: Comma-separated list of search groups for `search` - index metric. - :arg include_segment_file_sizes: Whether to report the + metrics. + :arg completion_fields: Comma-separated list or wildcard + expressions of fields to include in fielddata and suggest statistics. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match. If the request can target data streams, this argumentdetermines + whether wildcard expressions match hidden data streams. Supports comma- + separated values,such as `open,hidden`. Valid choices are all, open, + closed, hidden, none. + :arg fielddata_fields: Comma-separated list or wildcard + expressions of fields to include in fielddata statistics. + :arg fields: Comma-separated list or wildcard expressions of + fields to include in the statistics. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg forbid_closed_indices: If true, statistics are not + collected from closed indices. + :arg groups: Comma-separated list of search groups to include in + the search statistics. + :arg human: Whether to return human readable values for + statistics. + :arg include_segment_file_sizes: If true, the call reports the aggregated disk usage of each one of the Lucene index files (only - applies if segment stats are requested). Default is false. - :arg include_unloaded_segments: If set to true segment stats - will include stats for segments that are not currently loaded into - memory. Default is false. - :arg level: Return stats aggregated at cluster, index or shard - level. Valid choices are cluster, indices, shards. + applies if segment stats are requested). + :arg include_unloaded_segments: If true, the response includes + information from segments that are not loaded into memory. + :arg level: Indicates whether statistics are aggregated at the + cluster, index, or shard level. Valid choices are cluster, indices, + shards. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path(index, "_stats", metric), params=params, headers=headers ) @query_params( - "allow_no_indices", "expand_wildcards", "ignore_unavailable", "verbose" + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "source", + "verbose", ) async def segments( self, @@ -1023,18 +1566,31 @@ async def segments( Provides low-level information about segments in a Lucene index. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg verbose: Includes detailed memory usage by Lucene. Default - is false. + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg verbose: If `true`, the request returns a verbose response. """ return await self.transport.perform_request( "GET", _make_path(index, "_segments"), params=params, headers=headers @@ -1047,12 +1603,17 @@ async def segments( "analyzer", "default_operator", "df", + "error_trace", "expand_wildcards", "explain", + "filter_path", + "human", "ignore_unavailable", "lenient", + "pretty", "q", "rewrite", + "source", ) async def validate_query( self, @@ -1066,31 +1627,49 @@ async def validate_query( :arg body: The query definition specified with the Query DSL - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg all_shards: Execute validation on all shards instead of one - random shard per index. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. + :arg index: Comma-separated list of data streams, indices, and + aliases to search. Supports wildcards (`*`). To search all data streams + or indices, omit this parameter or use `*` or `_all`. + :arg all_shards: If `true`, the validation is executed on all + shards instead of one random shard per index. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed. + :arg analyzer: Analyzer to use for the query string.This + parameter can only be used when the `q` query string parameter is + specified. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg explain: Return detailed information about the error. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. + query: `AND` or `OR`. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string.This parameter can only be used when the `q` query + string parameter is specified. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg explain: If `true`, the response returns detailed + information if an error has occurred. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg rewrite: Provide a more detailed explanation showing the - actual Lucene query that will be executed. + :arg rewrite: If `true`, returns a more detailed explanation + showing the actual Lucene query that will be executed. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", @@ -1102,12 +1681,17 @@ async def validate_query( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", "fielddata", "fields", + "filter_path", + "human", "ignore_unavailable", + "pretty", "query", "request", + "source", ) async def clear_cache( self, @@ -1121,25 +1705,47 @@ async def clear_cache( :arg index: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg fielddata: Clear field data. - :arg fields: Comma-separated list of fields to clear when using - the `fielddata` parameter (default: all). - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg query: Clear query caches. - :arg request: Clear request cache. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg fielddata: If `true`, clears the fields cache.Use the + `fields` parameter to clear the cache of specific fields only. + :arg fields: Comma-separated list of field names used to limit + the `fielddata` parameter. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg query: If `true`, clears the query cache. + :arg request: If `true`, clears the request cache. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", _make_path(index, "_cache", "clear"), params=params, headers=headers ) - @query_params("active_only", "detailed") + @query_params( + "active_only", + "detailed", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + ) async def recovery( self, index: Any = None, @@ -1150,12 +1756,23 @@ async def recovery( Returns information about ongoing index shard recoveries. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg active_only: Display only those recoveries that are - currently on-going. Default is false. - :arg detailed: Whether to display detailed information about - shard recovery. Default is false. + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg active_only: If `true`, the response only includes ongoing + shard recoveries. + :arg detailed: If `true`, the response includes detailed + information about shard recoveries. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path(index, "_recovery"), params=params, headers=headers @@ -1163,9 +1780,14 @@ async def recovery( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "only_ancient_segments", + "pretty", + "source", "wait_for_completion", ) async def upgrade( @@ -1183,13 +1805,23 @@ async def upgrade( :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified). + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). :arg only_ancient_segments: If true, only ancient (an older Lucene major release) segments will be upgraded. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is false. """ @@ -1197,7 +1829,16 @@ async def upgrade( "POST", _make_path(index, "_upgrade"), params=params, headers=headers ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") + @query_params( + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "source", + ) async def get_upgrade( self, index: Any = None, @@ -1213,18 +1854,36 @@ async def get_upgrade( :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified). + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path(index, "_upgrade"), params=params, headers=headers ) @query_params( - "allow_no_indices", "expand_wildcards", "ignore_unavailable", "status" + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "source", + "status", ) async def shard_stores( self, @@ -1236,18 +1895,30 @@ async def shard_stores( Provides store information for shard copies of indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg status: Comma-separated list of statuses used to filter on - shards to get store information for. + :arg index: List of data streams, indices, and aliases used to + limit the request. + :arg allow_no_indices: If false, the request returns an error if + any wildcard expression, index alias, or _allvalue targets only missing + or closed indices. This behavior applies even if the requesttargets + other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match. If the request can target data streams,this argument determines + whether wildcard expressions match hidden data streams. Valid choices + are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If true, missing or closed indices are + not included in the response. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg status: List of shard health statuses used to limit the + request. """ return await self.transport.perform_request( "GET", _make_path(index, "_shard_stores"), params=params, headers=headers @@ -1255,11 +1926,17 @@ async def shard_stores( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", "flush", + "human", "ignore_unavailable", "max_num_segments", "only_expunge_deletes", + "pretty", + "primary_only", + "source", "wait_for_completion", ) async def forcemerge( @@ -1272,24 +1949,36 @@ async def forcemerge( Performs the force merge operation on one or more indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + :arg index: A comma-separated list of index names; use `_all` or + empty string to perform the operation on all indices :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + string or when no indices have been specified) + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg flush: Specify whether the index should be flushed after - performing the operation. Default is True. + performing the operation (default: true) + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + should be ignored when unavailable (missing or closed) :arg max_num_segments: The number of segments the index should - be merged into (default: dynamic). + be merged into (default: dynamic) :arg only_expunge_deletes: Specify whether the operation should - only expunge deleted documents. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is True. + only expunge deleted documents + :arg pretty: Whether to pretty format the returned JSON + response. + :arg primary_only: Specify whether the operation should only + perform on primary shards. Defaults to false. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg wait_for_completion: Should the request wait until the + force merge is completed. """ return await self.transport.perform_request( "POST", _make_path(index, "_forcemerge"), params=params, headers=headers @@ -1298,7 +1987,12 @@ async def forcemerge( @query_params( "cluster_manager_timeout", "copy_settings", + "error_trace", + "filter_path", + "human", "master_timeout", + "pretty", + "source", "task_execution_timeout", "timeout", "wait_for_active_shards", @@ -1316,22 +2010,37 @@ async def shrink( 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. + :arg index: Name of the source index to shrink. + :arg target: Name of the target index to create. :arg body: The configuration for the target index (`settings` and `aliases`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg copy_settings: whether or not to copy settings from the source index. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg task_execution_timeout: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for on the shrunken index before the operation returns. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -1350,7 +2059,12 @@ async def shrink( @query_params( "cluster_manager_timeout", "copy_settings", + "error_trace", + "filter_path", + "human", "master_timeout", + "pretty", + "source", "task_execution_timeout", "timeout", "wait_for_active_shards", @@ -1369,22 +2083,37 @@ async def split( shards. - :arg index: The name of the source index to split. - :arg target: The name of the target index. + :arg index: Name of the source index to split. + :arg target: Name of the target index to create. :arg body: The configuration for the target index (`settings` and `aliases`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg copy_settings: whether or not to copy settings from the source index. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg task_execution_timeout: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for on the shrunken index before the operation returns. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -1403,7 +2132,12 @@ async def split( @query_params( "cluster_manager_timeout", "dry_run", + "error_trace", + "filter_path", + "human", "master_timeout", + "pretty", + "source", "timeout", "wait_for_active_shards", ) @@ -1420,22 +2154,36 @@ async def rollover( to be too large or too old. - :arg alias: The name of the alias to rollover. + :arg alias: Name of the data stream or index alias to roll over. :arg body: The conditions that needs to be met for executing rollover - :arg new_index: The name of the rollover index. + :arg new_index: Name of the index to create. Supports date math. + Data streams do not support this parameter. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg dry_run: If set to true the rollover action will only be - validated but not actually performed even if a condition matches. - Default is false. + :arg dry_run: If `true`, checks whether the current index + satisfies the specified conditions but does not perform a rollover. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for on the newly created rollover index before the operation - returns. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to all or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. """ if alias in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'alias'.") @@ -1448,7 +2196,7 @@ async def rollover( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def create_data_stream( self, name: Any, @@ -1460,8 +2208,23 @@ async def create_data_stream( Creates or updates a data stream. - :arg name: The name of the data stream. + :arg name: Name of the data stream, which must meet the + following criteria: Lowercase only; Cannot include `/`, `*`, `?`, `"`, + `<`, `>`, `|`, `,`, `#`, `:`, backslash, or a space character; Cannot + start with `-`, `_`, `+`, or `.ds-`; Cannot be `.` or `..`; Cannot be + longer than 255 bytes. Multi-byte characters count towards this limit + faster. :arg body: The data stream definition + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1474,7 +2237,7 @@ async def create_data_stream( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_data_stream( self, name: Any, @@ -1485,8 +2248,18 @@ async def delete_data_stream( Deletes a data stream. - :arg name: Comma-separated list of data streams; use `_all` or - empty string to perform the operation on all data streams. + :arg name: Comma-separated list of data streams to delete. + Wildcard (`*`) expressions are supported. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1495,7 +2268,16 @@ async def delete_data_stream( "DELETE", _make_path("_data_stream", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def delete_index_template( self, name: Any, @@ -1506,13 +2288,27 @@ async def delete_index_template( Deletes an index template. - :arg name: The name of the template. + :arg name: Name of the index template to delete. Wildcard (*) + expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1524,7 +2320,17 @@ async def delete_index_template( headers=headers, ) - @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) async def exists_index_template( self, name: Any, @@ -1535,16 +2341,28 @@ async def exists_index_template( Returns information about whether a particular index template exists. - :arg name: The name of the template. + :arg name: Name of the index template to check existence of. + Wildcard (*) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg flat_settings: Return settings in flat format. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1553,7 +2371,17 @@ async def exists_index_template( "HEAD", _make_path("_index_template", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) async def get_index_template( self, name: Any = None, @@ -1564,22 +2392,44 @@ async def get_index_template( Returns an index template. - :arg name: Comma-separated names of the index templates. + :arg name: Name of the index template to retrieve. Wildcard (*) + expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If true, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg local: If true, the request retrieves information from the + local node only. Defaults to false, which means information is retrieved + from the master node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path("_index_template", name), params=params, headers=headers ) - @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") + @query_params( + "cause", + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) async def put_index_template( self, name: Any, @@ -1591,17 +2441,27 @@ async def put_index_template( Creates or updates an index template. - :arg name: The name of the template. + :arg name: Index or template name :arg body: The template definition :arg cause: User defined reason for creating/updating the index template. Default is false. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template should only be added if - new or can also replace an existing one. Default is false. + :arg create: If `true`, this request cannot replace or update + existing index templates. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (name, body): if param in SKIP_IN_PATH: @@ -1615,7 +2475,17 @@ async def put_index_template( body=body, ) - @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") + @query_params( + "cause", + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) async def simulate_index_template( self, name: Any, @@ -1628,20 +2498,32 @@ async def simulate_index_template( system. - :arg name: The name of the index (it must be a concrete index - name). + :arg name: Index or template name to simulate :arg body: New index template definition, which will be included in the simulation, as if it already exists in the system :arg cause: User defined reason for dry-run creating the new template for simulation purposes. Default is false. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template we optionally defined in - the body should only be dry-run added if new or can also replace an - existing one. Default is false. + :arg create: If `true`, the template passed in the body is only + used if no existingtemplates match the same index patterns. If `false`, + the simulation usesthe template with the highest priority. Note that the + template is notpermanently added or updated in either case; it is only + used for thesimulation. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is receivedbefore the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1654,7 +2536,7 @@ async def simulate_index_template( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_data_stream( self, name: Any = None, @@ -1665,14 +2547,35 @@ async def get_data_stream( Returns data streams. - :arg name: Comma-separated list of data streams; use `_all` or - empty string to perform the operation on all data streams. + :arg name: Comma-separated list of data stream names used to + limit the request. Wildcard (`*`) expressions are supported. If omitted, + all data streams are returned. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path("_data_stream", name), params=params, headers=headers ) - @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") + @query_params( + "cause", + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) async def simulate_template( self, body: Any = None, @@ -1684,19 +2587,32 @@ async def simulate_template( Simulate resolving the given template name or body. - :arg body: New index template definition to be simulated, if no - index template name is specified - :arg name: The name of the template. + :arg name: Name of the index template to simulate. To test a + template configuration before you add it to the cluster, omit this + parameter and specify the template configuration in the request body. :arg cause: User defined reason for dry-run creating the new template for simulation purposes. Default is false. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template we optionally defined in - the body should only be dry-run added if new or can also replace an - existing one. Default is false. + :arg create: If true, the template passed in the body is only + used if no existing templates match the same index patterns. If false, + the simulation uses the template with the highest priority. Note that + the template is not permanently added or updated in either case; it is + only used for the simulation. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", @@ -1706,7 +2622,9 @@ async def simulate_template( body=body, ) - @query_params("expand_wildcards") + @query_params( + "error_trace", "expand_wildcards", "filter_path", "human", "pretty", "source" + ) async def resolve_index( self, name: Any, @@ -1717,11 +2635,24 @@ async def resolve_index( Returns information about any matching indices, aliases, and data streams. - :arg name: Comma-separated list of names or wildcard - expressions. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. + :arg name: Comma-separated name(s) or index pattern(s) of the + indices, aliases, and data streams to resolve. Resources on remote + clusters can be specified using the ``:`` syntax. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1733,9 +2664,14 @@ async def resolve_index( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "timeout", ) async def add_block( @@ -1749,23 +2685,33 @@ async def add_block( Adds a block to an index. - :arg index: Comma-separated list of indices to add a block to. + :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 - metadata). + metadata) :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + string or when no indices have been specified) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + should be ignored when unavailable (missing or closed) :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ for param in (index, block): if param in SKIP_IN_PATH: @@ -1775,7 +2721,7 @@ async def add_block( "PUT", _make_path(index, "_block", block), params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def data_streams_stats( self, name: Any = None, @@ -1786,8 +2732,19 @@ async def data_streams_stats( Provides statistics on operations happening in a data stream. - :arg name: Comma-separated list of data streams; use `_all` or - empty string to perform the operation on all data streams. + :arg name: Comma-separated list of data streams used to limit + the request. Wildcard expressions (`*`) are supported. To target all + data streams in a cluster, omit this parameter or use `*`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", diff --git a/opensearchpy/_async/client/ingest.py b/opensearchpy/_async/client/ingest.py index 9702a3463..45f926043 100644 --- a/opensearchpy/_async/client/ingest.py +++ b/opensearchpy/_async/client/ingest.py @@ -40,7 +40,15 @@ class IngestClient(NamespacedClient): - @query_params("cluster_manager_timeout", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) async def get_pipeline( self, id: Any = None, @@ -51,19 +59,40 @@ async def get_pipeline( Returns a pipeline. - :arg id: Comma-separated list of pipeline ids. Wildcards - supported. + :arg id: Comma-separated list of pipeline IDs to retrieve. + Wildcard (`*`) expressions are supported. To get all ingest pipelines, + omit this parameter or use `*`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path("_ingest", "pipeline", id), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def put_pipeline( self, id: Any, @@ -75,14 +104,27 @@ async def put_pipeline( Creates or updates a pipeline. - :arg id: Pipeline ID. + :arg id: ID of the ingest pipeline to create or update. :arg body: The ingest definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ for param in (id, body): if param in SKIP_IN_PATH: @@ -96,7 +138,16 @@ async def put_pipeline( body=body, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def delete_pipeline( self, id: Any, @@ -107,13 +158,28 @@ async def delete_pipeline( Deletes a pipeline. - :arg id: Pipeline ID. + :arg id: Pipeline ID or wildcard expression of pipeline IDs used + to limit the request. To delete all ingest pipelines in a cluster, use a + value of `*`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'id'.") @@ -125,7 +191,7 @@ async def delete_pipeline( headers=headers, ) - @query_params("verbose") + @query_params("error_trace", "filter_path", "human", "pretty", "source", "verbose") async def simulate( self, body: Any, @@ -138,9 +204,20 @@ async def simulate( :arg body: The simulate definition - :arg id: Pipeline ID. - :arg verbose: Verbose mode. Display data output for each - processor in executed pipeline. Default is false. + :arg id: Pipeline to test. If you don’t specify a `pipeline` in + the request body, this parameter is required. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg verbose: If `true`, the response includes output data for + each processor in the executed pipeline. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -153,7 +230,7 @@ async def simulate( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def processor_grok( self, params: Any = None, @@ -162,6 +239,17 @@ async def processor_grok( """ Returns a list of the built-in patterns. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_ingest/processor/grok", params=params, headers=headers diff --git a/opensearchpy/_async/client/nodes.py b/opensearchpy/_async/client/nodes.py index f060bd5ff..3cb5b6342 100644 --- a/opensearchpy/_async/client/nodes.py +++ b/opensearchpy/_async/client/nodes.py @@ -40,7 +40,7 @@ class NodesClient(NamespacedClient): - @query_params("timeout") + @query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout") async def reload_secure_settings( self, body: Any = None, @@ -54,10 +54,21 @@ async def reload_secure_settings( :arg body: An object containing the password for the opensearch keystore - :arg node_id: Comma-separated list of node IDs to span the - reload/reinit call. Should stay empty because reloading usually involves - all cluster nodes. - :arg timeout: Operation timeout. + :arg node_id: The names of particular nodes in the cluster to + target. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ return await self.transport.perform_request( "POST", @@ -67,7 +78,15 @@ async def reload_secure_settings( body=body, ) - @query_params("flat_settings", "timeout") + @query_params( + "error_trace", + "filter_path", + "flat_settings", + "human", + "pretty", + "source", + "timeout", + ) async def info( self, node_id: Any = None, @@ -79,16 +98,24 @@ async def info( Returns information about nodes in the cluster. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. - :arg metric: Comma-separated list of metrics you wish returned. - Leave empty to return all. Valid choices are settings, os, process, jvm, - thread_pool, transport, http, plugins, ingest. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg timeout: Operation timeout. + :arg node_id: Comma-separated list of node IDs or names used to + limit returned information. + :arg metric: Limits the information returned to the specific + metrics. Supports a comma-separated list, such as http,ingest. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If true, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ return await self.transport.perform_request( "GET", _make_path("_nodes", node_id, metric), params=params, headers=headers @@ -96,11 +123,16 @@ async def info( @query_params( "completion_fields", + "error_trace", "fielddata_fields", "fields", + "filter_path", "groups", + "human", "include_segment_file_sizes", "level", + "pretty", + "source", "timeout", "types", ) @@ -116,35 +148,42 @@ async def stats( Returns statistical information about nodes in the cluster. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. + :arg node_id: Comma-separated list of node IDs or names used to + limit returned information. :arg metric: Limit the information returned to the specified - metrics. Valid choices are _all, breaker, fs, http, indices, jvm, os, - process, thread_pool, transport, discovery, indexing_pressure, - search_pipeline. - :arg index_metric: Limit the information returned for `indices` - metric to the specific index metrics. Isn't used if `indices` (or `all`) - metric isn't specified. Valid choices are _all, store, indexing, get, - search, merge, flush, refresh, query_cache, fielddata, docs, warmer, - completion, segments, translog, suggest, request_cache, recovery. - :arg completion_fields: Comma-separated list of fields for - `fielddata` and `suggest` index metric (supports wildcards). - :arg fielddata_fields: Comma-separated list of fields for - `fielddata` index metric (supports wildcards). - :arg fields: Comma-separated list of fields for `fielddata` and - `completion` index metric (supports wildcards). - :arg groups: Comma-separated list of search groups for `search` - index metric. - :arg include_segment_file_sizes: Whether to report the + metrics + :arg index_metric: Limit the information returned for indices + metric to the specific index metrics. It can be used only if indices (or + all) metric is specified. + :arg completion_fields: Comma-separated list or wildcard + expressions of fields to include in fielddata and suggest statistics. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg fielddata_fields: Comma-separated list or wildcard + expressions of fields to include in fielddata statistics. + :arg fields: Comma-separated list or wildcard expressions of + fields to include in the statistics. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg groups: Comma-separated list of search groups to include in + the search statistics. + :arg human: Whether to return human readable values for + statistics. + :arg include_segment_file_sizes: If true, the call reports the aggregated disk usage of each one of the Lucene index files (only - applies if segment stats are requested). Default is false. - :arg level: Return indices stats aggregated at index, node or - shard level. Valid choices are indices, node, shards. - :arg timeout: Operation timeout. - :arg types: Comma-separated list of document types for the - `indexing` index metric. + applies if segment stats are requested). + :arg level: Indicates whether statistics are aggregated at the + cluster, index, or shard level. Valid choices are cluster, indices, + shards. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. + :arg types: A comma-separated list of document types for the + indexing index metric. """ return await self.transport.perform_request( "GET", @@ -154,7 +193,17 @@ async def stats( ) @query_params( - "doc_type", "ignore_idle_threads", "interval", "snapshots", "threads", "timeout" + "doc_type", + "error_trace", + "filter_path", + "human", + "ignore_idle_threads", + "interval", + "pretty", + "snapshots", + "source", + "threads", + "timeout", ) async def hot_threads( self, @@ -172,12 +221,22 @@ async def hot_threads( nodes. :arg doc_type: The type to sample. Valid choices are cpu, wait, block. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_idle_threads: Don't show threads that are in known- idle places, such as waiting on a socket select or pulling from an empty task queue. Default is True. :arg interval: The interval for the second sampling of threads. + :arg pretty: Whether to pretty format the returned JSON + response. :arg snapshots: Number of samples of thread stacktrace. Default is 10. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg threads: Specify the number of threads to provide information for. Default is 3. :arg timeout: Operation timeout. @@ -193,7 +252,7 @@ async def hot_threads( headers=headers, ) - @query_params("timeout") + @query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout") async def usage( self, node_id: Any = None, @@ -205,13 +264,26 @@ async def usage( Returns low-level information about REST actions usage on nodes. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. - :arg metric: Limit the information returned to the specified - metrics. Valid choices are _all, rest_actions. - :arg timeout: Operation timeout. + :arg node_id: A comma-separated list of node IDs or names to + limit the returned information; use `_local` to return information from + the node you're connecting to, leave empty to get information from all + nodes + :arg metric: Limits the information returned to the specific + metrics. A comma-separated list of the following options: `_all`, + `rest_actions`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ return await self.transport.perform_request( "GET", diff --git a/opensearchpy/_async/client/plugins.py b/opensearchpy/_async/client/plugins.py index 5bf662889..fe82ff87b 100644 --- a/opensearchpy/_async/client/plugins.py +++ b/opensearchpy/_async/client/plugins.py @@ -12,6 +12,8 @@ from ..plugins.alerting import AlertingClient from ..plugins.index_management import IndexManagementClient +from ..plugins.knn import KnnClient +from ..plugins.notifications import NotificationsClient from .client import Client from .utils import NamespacedClient @@ -22,6 +24,8 @@ class PluginsClient(NamespacedClient): def __init__(self, client: Client) -> None: super(PluginsClient, self).__init__(client) + self.notifications = NotificationsClient(client) + self.knn = KnnClient(client) # self.query_workbench = QueryWorkbenchClient(client) # self.reporting = ReportingClient(client) # self.notebooks = NotebooksClient(client) diff --git a/opensearchpy/_async/client/remote_store.py b/opensearchpy/_async/client/remote_store.py index 7b97513c3..143ce0b3d 100644 --- a/opensearchpy/_async/client/remote_store.py +++ b/opensearchpy/_async/client/remote_store.py @@ -22,7 +22,15 @@ class RemoteStoreClient(NamespacedClient): - @query_params("cluster_manager_timeout", "wait_for_completion") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + "wait_for_completion", + ) async def restore( self, body: Any, @@ -36,6 +44,16 @@ async def restore( :arg body: Comma-separated list of index IDs :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is false. """ diff --git a/opensearchpy/_async/client/search_pipeline.py b/opensearchpy/_async/client/search_pipeline.py new file mode 100644 index 000000000..9225085fb --- /dev/null +++ b/opensearchpy/_async/client/search_pipeline.py @@ -0,0 +1,151 @@ +# 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. + +# ------------------------------------------------------------------------------------------ +# THIS CODE IS AUTOMATICALLY GENERATED AND MANUAL EDITS WILL BE LOST +# +# To contribute, kindly make modifications in the opensearch-py client generator +# or in the OpenSearch API specification, and run `nox -rs generate`. See DEVELOPER_GUIDE.md +# and https://github.com/opensearch-project/opensearch-api-specification for details. +# -----------------------------------------------------------------------------------------+ + + +from typing import Any + +from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params + + +class SearchPipelineClient(NamespacedClient): + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + ) + async def get( + self, + id: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves information about a specified search pipeline. + + + :arg id: Comma-separated list of search pipeline ids. Wildcards + supported. + :arg cluster_manager_timeout: operation timeout for connection + to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + return await self.transport.perform_request( + "GET", _make_path("_search", "pipeline", id), params=params, headers=headers + ) + + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + "timeout", + ) + async def delete( + self, + id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Deletes the specified search pipeline. + + + :arg id: Pipeline ID. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Operation timeout. + """ + if id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'id'.") + + return await self.transport.perform_request( + "DELETE", + _make_path("_search", "pipeline", id), + params=params, + headers=headers, + ) + + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + "timeout", + ) + async def put( + self, + id: Any, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Creates or replaces the specified search pipeline. + + + :arg id: Pipeline ID. + :arg cluster_manager_timeout: operation timeout for connection + to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Operation timeout. + """ + for param in (id, body): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return await self.transport.perform_request( + "PUT", + _make_path("_search", "pipeline", id), + params=params, + headers=headers, + body=body, + ) diff --git a/opensearchpy/_async/client/security.py b/opensearchpy/_async/client/security.py index c5b9f2ca1..e24e293f2 100644 --- a/opensearchpy/_async/client/security.py +++ b/opensearchpy/_async/client/security.py @@ -24,7 +24,7 @@ class SecurityClient(NamespacedClient): from ._patch import health_check, update_audit_config # type: ignore - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_account_details( self, params: Any = None, @@ -33,12 +33,23 @@ async def get_account_details( """ Returns account details for the current user. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_plugins/_security/api/account", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def change_password( self, body: Any, @@ -49,6 +60,16 @@ async def change_password( Changes the password for the current user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -61,7 +82,7 @@ async def change_password( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_action_group( self, action_group: Any, @@ -73,6 +94,16 @@ async def get_action_group( :arg action_group: Action group to retrieve. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if action_group in SKIP_IN_PATH: raise ValueError( @@ -86,7 +117,7 @@ async def get_action_group( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_action_groups( self, params: Any = None, @@ -95,15 +126,26 @@ async def get_action_groups( """ Retrieves all action groups. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", - "/_plugins/_security/api/actiongroups/", + "/_plugins/_security/api/actiongroups", params=params, headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_action_group( self, action_group: Any, @@ -115,6 +157,16 @@ async def delete_action_group( :arg action_group: Action group to delete. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if action_group in SKIP_IN_PATH: raise ValueError( @@ -128,7 +180,7 @@ async def delete_action_group( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def create_action_group( self, action_group: Any, @@ -142,6 +194,16 @@ async def create_action_group( :arg action_group: The name of the action group to create or replace + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (action_group, body): if param in SKIP_IN_PATH: @@ -155,7 +217,7 @@ async def create_action_group( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_action_group( self, action_group: Any, @@ -167,6 +229,16 @@ async def patch_action_group( Updates individual attributes of an action group. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (action_group, body): if param in SKIP_IN_PATH: @@ -180,7 +252,7 @@ async def patch_action_group( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_action_groups( self, body: Any, @@ -191,6 +263,16 @@ async def patch_action_groups( Creates, updates, or deletes multiple action groups in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -203,7 +285,7 @@ async def patch_action_groups( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_user( self, username: Any, @@ -214,6 +296,16 @@ async def get_user( Retrieve one internal user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'username'.") @@ -225,7 +317,7 @@ async def get_user( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_users( self, params: Any = None, @@ -234,6 +326,17 @@ async def get_users( """ Retrieve all internal users. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", @@ -242,7 +345,7 @@ async def get_users( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_user( self, username: Any, @@ -253,6 +356,16 @@ async def delete_user( Delete the specified user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'username'.") @@ -264,7 +377,7 @@ async def delete_user( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def create_user( self, username: Any, @@ -276,6 +389,16 @@ async def create_user( Creates or replaces the specified user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (username, body): if param in SKIP_IN_PATH: @@ -289,7 +412,7 @@ async def create_user( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_user( self, username: Any, @@ -301,6 +424,16 @@ async def patch_user( Updates individual attributes of an internal user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (username, body): if param in SKIP_IN_PATH: @@ -314,7 +447,7 @@ async def patch_user( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_users( self, body: Any, @@ -325,6 +458,16 @@ async def patch_users( Creates, updates, or deletes multiple internal users in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -337,7 +480,7 @@ async def patch_users( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_role( self, role: Any, @@ -348,6 +491,16 @@ async def get_role( Retrieves one role. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -359,7 +512,7 @@ async def get_role( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_roles( self, params: Any = None, @@ -368,12 +521,23 @@ async def get_roles( """ Retrieves all roles. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_plugins/_security/api/roles/", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_role( self, role: Any, @@ -384,6 +548,16 @@ async def delete_role( Delete the specified role. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -395,7 +569,7 @@ async def delete_role( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def create_role( self, role: Any, @@ -407,6 +581,16 @@ async def create_role( Creates or replaces the specified role. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (role, body): if param in SKIP_IN_PATH: @@ -420,7 +604,7 @@ async def create_role( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_role( self, role: Any, @@ -432,6 +616,16 @@ async def patch_role( Updates individual attributes of a role. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (role, body): if param in SKIP_IN_PATH: @@ -445,7 +639,7 @@ async def patch_role( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_roles( self, body: Any, @@ -456,6 +650,16 @@ async def patch_roles( Creates, updates, or deletes multiple roles in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -468,7 +672,7 @@ async def patch_roles( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_role_mapping( self, role: Any, @@ -479,6 +683,16 @@ async def get_role_mapping( Retrieves one role mapping. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -490,7 +704,7 @@ async def get_role_mapping( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_role_mappings( self, params: Any = None, @@ -499,6 +713,17 @@ async def get_role_mappings( """ Retrieves all role mappings. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", @@ -507,7 +732,7 @@ async def get_role_mappings( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_role_mapping( self, role: Any, @@ -518,6 +743,16 @@ async def delete_role_mapping( Deletes the specified role mapping. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -529,7 +764,7 @@ async def delete_role_mapping( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def create_role_mapping( self, role: Any, @@ -541,6 +776,16 @@ async def create_role_mapping( Creates or replaces the specified role mapping. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (role, body): if param in SKIP_IN_PATH: @@ -554,7 +799,7 @@ async def create_role_mapping( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_role_mapping( self, role: Any, @@ -566,6 +811,16 @@ async def patch_role_mapping( Updates individual attributes of a role mapping. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (role, body): if param in SKIP_IN_PATH: @@ -579,7 +834,7 @@ async def patch_role_mapping( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_role_mappings( self, body: Any, @@ -590,6 +845,16 @@ async def patch_role_mappings( Creates or updates multiple role mappings in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -602,7 +867,7 @@ async def patch_role_mappings( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_tenant( self, tenant: Any, @@ -613,6 +878,16 @@ async def get_tenant( Retrieves one tenant. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if tenant in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'tenant'.") @@ -624,7 +899,7 @@ async def get_tenant( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_tenants( self, params: Any = None, @@ -633,12 +908,23 @@ async def get_tenants( """ Retrieves all tenants. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_plugins/_security/api/tenants/", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_tenant( self, tenant: Any, @@ -649,6 +935,16 @@ async def delete_tenant( Delete the specified tenant. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if tenant in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'tenant'.") @@ -660,7 +956,7 @@ async def delete_tenant( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def create_tenant( self, tenant: Any, @@ -672,6 +968,16 @@ async def create_tenant( Creates or replaces the specified tenant. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (tenant, body): if param in SKIP_IN_PATH: @@ -685,7 +991,7 @@ async def create_tenant( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_tenant( self, tenant: Any, @@ -697,6 +1003,16 @@ async def patch_tenant( Add, delete, or modify a single tenant. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (tenant, body): if param in SKIP_IN_PATH: @@ -710,7 +1026,7 @@ async def patch_tenant( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_tenants( self, body: Any, @@ -721,6 +1037,16 @@ async def patch_tenants( Add, delete, or modify multiple tenants in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -733,7 +1059,7 @@ async def patch_tenants( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_configuration( self, params: Any = None, @@ -742,6 +1068,17 @@ async def get_configuration( """ Returns the current Security plugin configuration in JSON format. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", @@ -750,7 +1087,7 @@ async def get_configuration( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def update_configuration( self, body: Any, @@ -761,6 +1098,16 @@ async def update_configuration( Adds or updates the existing configuration using the REST API. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -773,7 +1120,7 @@ async def update_configuration( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_configuration( self, body: Any, @@ -784,6 +1131,16 @@ async def patch_configuration( A PATCH call is used to update the existing configuration using the REST API. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -796,7 +1153,7 @@ async def patch_configuration( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_distinguished_names( self, cluster_name: Any = None, @@ -804,9 +1161,19 @@ async def get_distinguished_names( headers: Any = None, ) -> Any: """ - Retrieves all distinguished names in the allow list. + Retrieves distinguished names. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", @@ -815,7 +1182,7 @@ async def get_distinguished_names( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def update_distinguished_names( self, cluster_name: Any, @@ -828,6 +1195,16 @@ async def update_distinguished_names( allow list. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if cluster_name in SKIP_IN_PATH: raise ValueError( @@ -842,7 +1219,7 @@ async def update_distinguished_names( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_distinguished_names( self, cluster_name: Any, @@ -854,6 +1231,16 @@ async def delete_distinguished_names( list. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if cluster_name in SKIP_IN_PATH: raise ValueError( @@ -867,7 +1254,7 @@ async def delete_distinguished_names( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_certificates( self, params: Any = None, @@ -876,12 +1263,23 @@ async def get_certificates( """ Retrieves the cluster’s security certificates. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_plugins/_security/api/ssl/certs", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def reload_transport_certificates( self, params: Any = None, @@ -890,6 +1288,17 @@ async def reload_transport_certificates( """ Reload transport layer communication certificates. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "PUT", @@ -898,7 +1307,7 @@ async def reload_transport_certificates( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def reload_http_certificates( self, params: Any = None, @@ -907,6 +1316,17 @@ async def reload_http_certificates( """ Reload HTTP layer communication certificates. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "PUT", @@ -915,7 +1335,7 @@ async def reload_http_certificates( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def flush_cache( self, params: Any = None, @@ -924,12 +1344,23 @@ async def flush_cache( """ Flushes the Security plugin user, authentication, and authorization cache. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "DELETE", "/_plugins/_security/api/cache", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def health( self, params: Any = None, @@ -938,12 +1369,23 @@ async def health( """ Checks to see if the Security plugin is up and running. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_plugins/_security/health", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_audit_configuration( self, params: Any = None, @@ -952,12 +1394,23 @@ async def get_audit_configuration( """ Retrieves the audit configuration. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_plugins/_security/api/audit", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def update_audit_configuration( self, body: Any, @@ -968,6 +1421,16 @@ async def update_audit_configuration( Updates the audit configuration. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -980,7 +1443,7 @@ async def update_audit_configuration( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_audit_configuration( self, body: Any, @@ -991,6 +1454,16 @@ async def patch_audit_configuration( A PATCH call is used to update specified fields in the audit configuration. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1003,7 +1476,7 @@ async def patch_audit_configuration( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_distinguished_names( self, body: Any, @@ -1014,6 +1487,16 @@ async def patch_distinguished_names( Bulk update of distinguished names. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") diff --git a/opensearchpy/_async/client/snapshot.py b/opensearchpy/_async/client/snapshot.py index c21ea2548..4f7d7bad4 100644 --- a/opensearchpy/_async/client/snapshot.py +++ b/opensearchpy/_async/client/snapshot.py @@ -40,7 +40,16 @@ class SnapshotClient(NamespacedClient): - @query_params("cluster_manager_timeout", "master_timeout", "wait_for_completion") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "wait_for_completion", + ) async def create( self, repository: Any, @@ -53,16 +62,29 @@ async def create( Creates a snapshot in a repository. - :arg repository: Repository name. - :arg snapshot: Snapshot name. + :arg repository: Repository for the snapshot. + :arg snapshot: Name of the snapshot. Must be unique in the + repository. :arg body: The snapshot definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg wait_for_completion: If `true`, the request returns a + response when the snapshot is complete. If `false`, the request returns + a response when the snapshot initializes. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -76,7 +98,15 @@ async def create( body=body, ) - @query_params("cluster_manager_timeout", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) async def delete( self, repository: Any, @@ -88,13 +118,23 @@ async def delete( Deletes a snapshot. - :arg repository: Repository name. - :arg snapshot: Snapshot name. + :arg repository: A repository name + :arg snapshot: A comma-separated list of snapshot names :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -108,7 +148,15 @@ async def delete( ) @query_params( - "cluster_manager_timeout", "ignore_unavailable", "master_timeout", "verbose" + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "ignore_unavailable", + "master_timeout", + "pretty", + "source", + "verbose", ) async def get( self, @@ -121,18 +169,35 @@ async def get( Returns information about a snapshot. - :arg repository: Repository name. - :arg snapshot: Comma-separated list of snapshot names. + :arg repository: Comma-separated list of snapshot repository + names used to limit the request. Wildcard (*) expressions are supported. + :arg snapshot: Comma-separated list of snapshot names to + retrieve. Also accepts wildcards (*). - To get information about all + snapshots in a registered repository, use a wildcard (*) or _all. - To + get information about any snapshots that are currently running, use + _current. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg ignore_unavailable: Whether to ignore unavailable - snapshots, defaults to false which means a SnapshotMissingException is - thrown. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If false, the request returns an error + for any snapshots that are unavailable. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg verbose: Whether to show verbose snapshot info or only show - the basic info found in the repository index blob. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg verbose: If true, returns additional information about each + snapshot such as the version of Opensearch which took the snapshot, the + start and end times of the snapshot, and the number of shards + snapshotted. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -145,7 +210,16 @@ async def get( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def delete_repository( self, repository: Any, @@ -160,10 +234,20 @@ async def delete_repository( Wildcard (`*`) patterns are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -175,7 +259,16 @@ async def delete_repository( headers=headers, ) - @query_params("cluster_manager_timeout", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) async def get_repository( self, repository: Any = None, @@ -186,20 +279,40 @@ async def get_repository( Returns information about a repository. - :arg repository: Comma-separated list of repository names. + :arg repository: A comma-separated list of repository names :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + from cluster-manager node (default: false) :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path("_snapshot", repository), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout", "verify") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + "verify", + ) async def create_repository( self, repository: Any, @@ -211,15 +324,25 @@ async def create_repository( Creates a repository. - :arg repository: Repository name. + :arg repository: A repository name :arg body: The repository definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg verify: Whether to verify the repository after creation. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout + :arg verify: Whether to verify the repository after creation """ for param in (repository, body): if param in SKIP_IN_PATH: @@ -233,7 +356,16 @@ async def create_repository( body=body, ) - @query_params("cluster_manager_timeout", "master_timeout", "wait_for_completion") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "wait_for_completion", + ) async def restore( self, repository: Any, @@ -246,16 +378,26 @@ async def restore( Restores a snapshot. - :arg repository: Repository name. - :arg snapshot: Snapshot name. + :arg repository: A repository name + :arg snapshot: A snapshot name :arg body: Details of what to restore :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + operation has completed before returning """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -269,7 +411,16 @@ async def restore( body=body, ) - @query_params("cluster_manager_timeout", "ignore_unavailable", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "ignore_unavailable", + "master_timeout", + "pretty", + "source", + ) async def status( self, repository: Any = None, @@ -281,16 +432,26 @@ async def status( Returns information about the status of a snapshot. - :arg repository: Repository name. - :arg snapshot: Comma-separated list of snapshot names. + :arg repository: A repository name + :arg snapshot: A comma-separated list of snapshot names :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is - thrown. Default is false. + thrown :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", @@ -299,7 +460,16 @@ async def status( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def verify_repository( self, repository: Any, @@ -310,13 +480,23 @@ async def verify_repository( Verifies a repository. - :arg repository: Repository name. + :arg repository: A repository name :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -328,7 +508,16 @@ async def verify_repository( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def cleanup_repository( self, repository: Any, @@ -339,13 +528,23 @@ async def cleanup_repository( Removes stale data from repository. - :arg repository: Repository name. + :arg repository: Snapshot repository to clean up. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -357,7 +556,15 @@ async def cleanup_repository( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) async def clone( self, repository: Any, @@ -371,15 +578,25 @@ async def clone( Clones indices from one snapshot into another snapshot in the same repository. - :arg repository: Repository name. - :arg snapshot: Snapshot name. - :arg target_snapshot: The name of the cloned snapshot to create. + :arg repository: A repository name + :arg snapshot: The name of the snapshot to clone from + :arg target_snapshot: The name of the cloned snapshot to create :arg body: The snapshot clone definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (repository, snapshot, target_snapshot, body): if param in SKIP_IN_PATH: diff --git a/opensearchpy/_async/client/tasks.py b/opensearchpy/_async/client/tasks.py index aad58c997..3cbfdfec0 100644 --- a/opensearchpy/_async/client/tasks.py +++ b/opensearchpy/_async/client/tasks.py @@ -44,9 +44,14 @@ class TasksClient(NamespacedClient): @query_params( "actions", "detailed", + "error_trace", + "filter_path", "group_by", + "human", "nodes", "parent_task_id", + "pretty", + "source", "timeout", "wait_for_completion", ) @@ -59,27 +64,50 @@ async def list( Returns a list of tasks. - :arg actions: Comma-separated list of actions that should be - returned. Leave empty to return all. - :arg detailed: Return detailed task information. Default is - false. - :arg group_by: Group tasks by nodes or parent/child - relationships. Valid choices are nodes, parents, none. + :arg actions: Comma-separated list or wildcard expression of + actions used to limit the request. + :arg detailed: If `true`, the response includes detailed + information about shard recoveries. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg group_by: Key used to group tasks in the response. Valid + choices are nodes, parents, none. + :arg human: Whether to return human readable values for + statistics. :arg nodes: Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. - :arg parent_task_id: Return tasks with specified parent task id - (node_id:task_number). Set to -1 to return all. - :arg timeout: Operation timeout. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + :arg parent_task_id: Parent task ID used to limit returned + information. To return all tasks, omit this parameter or use a value of + `-1`. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_completion: If `true`, the request blocks until + the operation is complete. """ return await self.transport.perform_request( "GET", "/_tasks", params=params, headers=headers ) - @query_params("actions", "nodes", "parent_task_id", "wait_for_completion") + @query_params( + "actions", + "error_trace", + "filter_path", + "human", + "nodes", + "parent_task_id", + "pretty", + "source", + "wait_for_completion", + ) async def cancel( self, task_id: Any = None, @@ -90,18 +118,25 @@ async def cancel( Cancels a task, if it can be cancelled through an API. - :arg task_id: Cancel the task with specified task id - (node_id:task_number). - :arg actions: Comma-separated list of actions that should be - cancelled. Leave empty to cancel all. - :arg nodes: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. - :arg parent_task_id: Cancel tasks with specified parent task id - (node_id:task_number). Set to -1 to cancel all. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + :arg task_id: ID of the task. + :arg actions: Comma-separated list or wildcard expression of + actions used to limit the request. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg nodes: Comma-separated list of node IDs or names used to + limit the request. + :arg parent_task_id: Parent task ID used to limit the tasks. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg wait_for_completion: Should the request block until the + cancellation of the task and its descendant tasks is completed. Defaults + to false """ return await self.transport.perform_request( "POST", @@ -110,7 +145,15 @@ async def cancel( headers=headers, ) - @query_params("timeout", "wait_for_completion") + @query_params( + "error_trace", + "filter_path", + "human", + "pretty", + "source", + "timeout", + "wait_for_completion", + ) async def get( self, task_id: Any = None, @@ -121,11 +164,22 @@ async def get( Returns information about a task. - :arg task_id: Return the task with specified id - (node_id:task_number). - :arg timeout: Operation timeout. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + :arg task_id: ID of the task. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_completion: If `true`, the request blocks until + the task has completed. """ if task_id in SKIP_IN_PATH: warnings.warn( diff --git a/opensearchpy/_async/compat.py b/opensearchpy/_async/compat.py index 5dbbf4f52..319cf8192 100644 --- a/opensearchpy/_async/compat.py +++ b/opensearchpy/_async/compat.py @@ -25,24 +25,8 @@ # under the License. -import asyncio +from asyncio import get_running_loop from ..compat import * # noqa -# Hack supporting Python 3.6 asyncio which didn't have 'get_running_loop()'. -# Essentially we want to get away from having users pass in a loop to us. -# Instead we should call 'get_running_loop()' whenever we need -# the currently running loop. -# See: https://aiopg.readthedocs.io/en/stable/run_loop.html#implementation -try: - from asyncio import get_running_loop -except ImportError: - - def get_running_loop() -> asyncio.AbstractEventLoop: - loop = asyncio.get_event_loop() - if not loop.is_running(): - raise RuntimeError("no running event loop") - return loop - - __all__ = ["get_running_loop"] diff --git a/opensearchpy/_async/plugins/alerting.py b/opensearchpy/_async/plugins/alerting.py index 20818f113..bf1d4eee7 100644 --- a/opensearchpy/_async/plugins/alerting.py +++ b/opensearchpy/_async/plugins/alerting.py @@ -147,9 +147,11 @@ async def get_destination( """ return await self.transport.perform_request( "GET", - _make_path("_plugins", "_alerting", "destinations", destination_id) - if destination_id - else _make_path("_plugins", "_alerting", "destinations"), + ( + _make_path("_plugins", "_alerting", "destinations", destination_id) + if destination_id + else _make_path("_plugins", "_alerting", "destinations") + ), params=params, headers=headers, ) diff --git a/opensearchpy/_async/plugins/knn.py b/opensearchpy/_async/plugins/knn.py new file mode 100644 index 000000000..8129bd0a6 --- /dev/null +++ b/opensearchpy/_async/plugins/knn.py @@ -0,0 +1,383 @@ +# 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. + +# ------------------------------------------------------------------------------------------ +# THIS CODE IS AUTOMATICALLY GENERATED AND MANUAL EDITS WILL BE LOST +# +# To contribute, kindly make modifications in the opensearch-py client generator +# or in the OpenSearch API specification, and run `nox -rs generate`. See DEVELOPER_GUIDE.md +# and https://github.com/opensearch-project/opensearch-api-specification for details. +# -----------------------------------------------------------------------------------------+ + + +from typing import Any + +from ..client.utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params + + +class KnnClient(NamespacedClient): + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def delete_model( + self, + model_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Used to delete a particular model in the cluster. + + + :arg model_id: The id of the model. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if model_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'model_id'.") + + return await self.transport.perform_request( + "DELETE", + _make_path("_plugins", "_knn", "models", model_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_model( + self, + model_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Used to retrieve information about models present in the cluster. + + + :arg model_id: The id of the model. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if model_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'model_id'.") + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_knn", "models", model_id), + params=params, + headers=headers, + ) + + @query_params( + "_source", + "_source_excludes", + "_source_includes", + "allow_no_indices", + "allow_partial_search_results", + "analyze_wildcard", + "analyzer", + "batched_reduce_size", + "ccs_minimize_roundtrips", + "default_operator", + "df", + "docvalue_fields", + "error_trace", + "expand_wildcards", + "explain", + "filter_path", + "from_", + "human", + "ignore_throttled", + "ignore_unavailable", + "lenient", + "max_concurrent_shard_requests", + "pre_filter_shard_size", + "preference", + "pretty", + "q", + "request_cache", + "rest_total_hits_as_int", + "routing", + "scroll", + "search_type", + "seq_no_primary_term", + "size", + "sort", + "source", + "stats", + "stored_fields", + "suggest_field", + "suggest_mode", + "suggest_size", + "suggest_text", + "terminate_after", + "timeout", + "track_scores", + "track_total_hits", + "typed_keys", + "version", + ) + async def search_models( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Use an OpenSearch query to search for models in the index. + + + :arg _source: True or false to return the _source field or not, + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. + :arg allow_no_indices: Whether to ignore if a wildcard indices + expression resolves into no concrete indices. (This includes `_all` + string or when no indices have been specified). + :arg allow_partial_search_results: Indicate if an error should + be returned if there is a partial search failure or timeout. Default is + True. + :arg analyze_wildcard: Specify whether wildcard and prefix + queries should be analyzed. Default is false. + :arg analyzer: The analyzer to use for the query string. + :arg batched_reduce_size: The number of shard results that + should be reduced at once on the coordinating node. This value should be + used as a protection mechanism to reduce the memory overhead per search + request if the potential number of shards in the request can be large. + Default is 512. + :arg ccs_minimize_roundtrips: Indicates whether network round- + trips should be minimized as part of cross-cluster search requests + execution. Default is True. + :arg default_operator: The default operator for query string + query (AND or OR). Valid choices are AND, OR. + :arg df: The field to use as default where no field prefix is + given in the query string. + :arg docvalue_fields: Comma-separated list of fields to return + as the docvalue representation of a field for each hit. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Whether to expand wildcard expression to + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg explain: Specify whether to return detailed information + about score computation as part of a hit. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg from_: Starting offset. Default is 0. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_throttled: Whether specified concrete, expanded or + aliased indices should be ignored when throttled. + :arg ignore_unavailable: Whether specified concrete indices + should be ignored when unavailable (missing or closed). + :arg lenient: Specify whether format-based query failures (such + as providing text to a numeric field) should be ignored. + :arg max_concurrent_shard_requests: The number of concurrent + shard requests per node this search executes concurrently. This value + should be used to limit the impact of the search on the cluster in order + to limit the number of concurrent shard requests. Default is 5. + :arg pre_filter_shard_size: Threshold that enforces a pre-filter + round-trip to prefilter search shards based on query rewriting if the + number of shards the search request expands to exceeds the threshold. + This filter round-trip can limit the number of shards significantly if + for instance a shard can not match any documents based on its rewrite + method ie. if date filters are mandatory to match but the shard bounds + and the query are disjoint. + :arg preference: Specify the node or shard the operation should + be performed on. Default is random. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg q: Query in the Lucene query string syntax. + :arg request_cache: Specify if request cache should be used for + this request or not, defaults to index level setting. + :arg rest_total_hits_as_int: Indicates whether hits.total should + be rendered as an integer or an object in the rest search response. + Default is false. + :arg routing: Comma-separated list of specific routing values. + :arg scroll: Specify how long a consistent view of the index + should be maintained for scrolled search. + :arg search_type: Search operation type. Valid choices are + query_then_fetch, dfs_query_then_fetch. + :arg seq_no_primary_term: Specify whether to return sequence + number and primary term of the last modification of each hit. + :arg size: Number of hits to return. Default is 10. + :arg sort: Comma-separated list of : pairs. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stats: Specific 'tag' of the request for logging and + statistical purposes. + :arg stored_fields: Comma-separated list of stored fields to + return. + :arg suggest_field: Specify which field to use for suggestions. + :arg suggest_mode: Specify suggest mode. Valid choices are + missing, popular, always. + :arg suggest_size: How many suggestions to return in response. + :arg suggest_text: The source text for which the suggestions + should be returned. + :arg terminate_after: The maximum number of documents to collect + for each shard, upon reaching which the query execution will terminate + early. + :arg timeout: Operation timeout. + :arg track_scores: Whether to calculate and return scores even + if they are not used for sorting. + :arg track_total_hits: Indicate if the number of documents that + match the query should be tracked. + :arg typed_keys: Specify whether aggregation and suggester names + should be prefixed by their respective types in the response. + :arg version: Whether to return document version as part of a + hit. + """ + # from is a reserved word so it cannot be used, use from_ instead + if "from_" in params: + params["from"] = params.pop("from_") + + return await self.transport.perform_request( + "POST", + "/_plugins/_knn/models/_search", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout") + async def stats( + self, + node_id: Any = None, + stat: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Provides information about the current status of the k-NN plugin. + + + :arg node_id: Comma-separated list of node IDs or names to limit + the returned information; use `_local` to return information from the + node you're connecting to, leave empty to get information from all + nodes. + :arg stat: Comma-separated list of stats to retrieve; use `_all` + or empty string to retrieve all stats. Valid choices are + circuit_breaker_triggered, total_load_time, eviction_count, hit_count, + miss_count, graph_memory_usage, graph_memory_usage_percentage, + graph_index_requests, graph_index_errors, graph_query_requests, + graph_query_errors, knn_query_requests, cache_capacity_reached, + load_success_count, load_exception_count, indices_in_cache, + script_compilations, script_compilation_errors, script_query_requests, + script_query_errors, nmslib_initialized, faiss_initialized, + model_index_status, indexing_from_model_degraded, training_requests, + training_errors, training_memory_usage, + training_memory_usage_percentage. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Operation timeout. + """ + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_knn", node_id, "stats", stat), + params=params, + headers=headers, + ) + + @query_params( + "error_trace", "filter_path", "human", "preference", "pretty", "source" + ) + async def train_model( + self, + body: Any, + model_id: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Create and train a model that can be used for initializing k-NN native library + indexes during indexing. + + + :arg model_id: The id of the model. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Preferred node to execute training. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if body in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'body'.") + + return await self.transport.perform_request( + "POST", + _make_path("_plugins", "_knn", "models", model_id, "_train"), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def warmup( + self, + index: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Preloads native library files into memory, reducing initial search latency for + specified indexes. + + + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if index in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'index'.") + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_knn", "warmup", index), + params=params, + headers=headers, + ) diff --git a/opensearchpy/_async/plugins/notifications.py b/opensearchpy/_async/plugins/notifications.py new file mode 100644 index 000000000..9c66c64e6 --- /dev/null +++ b/opensearchpy/_async/plugins/notifications.py @@ -0,0 +1,326 @@ +# 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. + +# ------------------------------------------------------------------------------------------ +# THIS CODE IS AUTOMATICALLY GENERATED AND MANUAL EDITS WILL BE LOST +# +# To contribute, kindly make modifications in the opensearch-py client generator +# or in the OpenSearch API specification, and run `nox -rs generate`. See DEVELOPER_GUIDE.md +# and https://github.com/opensearch-project/opensearch-api-specification for details. +# -----------------------------------------------------------------------------------------+ + + +from typing import Any + +from ..client.utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params + + +class NotificationsClient(NamespacedClient): + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def create_config( + self, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Create channel configuration. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if body in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'body'.") + + return await self.transport.perform_request( + "POST", + "/_plugins/_notifications/configs", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def delete_config( + self, + config_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Delete a channel configuration. + + + :arg config_id: The ID of the channel configuration to delete. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if config_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'config_id'.") + + return await self.transport.perform_request( + "DELETE", + _make_path("_plugins", "_notifications", "configs", config_id), + params=params, + headers=headers, + ) + + @query_params( + "config_id", + "config_id_list", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + ) + async def delete_configs( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Delete multiple channel configurations. + + + :arg config_id: The ID of the channel configuration to delete. + :arg config_id_list: A comma-separated list of channel IDs to + delete. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + return await self.transport.perform_request( + "DELETE", "/_plugins/_notifications/configs", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_config( + self, + config_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get a specific channel configuration. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if config_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'config_id'.") + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_notifications", "configs", config_id), + params=params, + headers=headers, + ) + + @query_params( + "chime.url", + "chime.url.keyword", + "config_type", + "created_time_ms", + "description", + "description.keyword", + "email.email_account_id", + "email.email_group_id_list", + "email.recipient_list.recipient", + "email.recipient_list.recipient.keyword", + "email_group.recipient_list.recipient", + "email_group.recipient_list.recipient.keyword", + "error_trace", + "filter_path", + "human", + "is_enabled", + "last_updated_time_ms", + "microsoft_teams.url", + "microsoft_teams.url.keyword", + "name", + "name.keyword", + "pretty", + "query", + "ses_account.from_address", + "ses_account.from_address.keyword", + "ses_account.region", + "ses_account.role_arn", + "ses_account.role_arn.keyword", + "slack.url", + "slack.url.keyword", + "smtp_account.from_address", + "smtp_account.from_address.keyword", + "smtp_account.host", + "smtp_account.host.keyword", + "smtp_account.method", + "sns.role_arn", + "sns.role_arn.keyword", + "sns.topic_arn", + "sns.topic_arn.keyword", + "source", + "text_query", + "webhook.url", + "webhook.url.keyword", + ) + async def get_configs( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get multiple channel configurations with filtering. + + + :arg config_type: Type of notification configuration. Valid + choices are slack, chime, microsoft_teams, webhook, email, sns, + ses_account, smtp_account, email_group. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + return await self.transport.perform_request( + "GET", + "/_plugins/_notifications/configs", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def list_features( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + List supported channel configurations. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + return await self.transport.perform_request( + "GET", "/_plugins/_notifications/features", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def send_test( + self, + config_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Send a test notification. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if config_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'config_id'.") + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_notifications", "feature", "test", config_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def update_config( + self, + config_id: Any, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Update channel configuration. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + for param in (config_id, body): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return await self.transport.perform_request( + "PUT", + _make_path("_plugins", "_notifications", "configs", config_id), + params=params, + headers=headers, + body=body, + ) diff --git a/opensearchpy/_async/transport.py b/opensearchpy/_async/transport.py index e8b172528..69db28d9b 100644 --- a/opensearchpy/_async/transport.py +++ b/opensearchpy/_async/transport.py @@ -27,7 +27,6 @@ import asyncio import logging -import sys from itertools import chain from typing import Any, Collection, Mapping, Optional, Type, Union @@ -251,13 +250,10 @@ def _sniff_request(conn: Any) -> Any: done: Any = () try: while tasks: - # The 'loop' keyword is deprecated in 3.8+ so don't - # pass it to asyncio.wait() unless we're on <=3.7 - wait_kwargs = {"loop": self.loop} if sys.version_info < (3, 8) else {} # execute sniff requests in parallel, wait for first to return done, tasks = await asyncio.wait( - tasks, return_when=asyncio.FIRST_COMPLETED, **wait_kwargs + tasks, return_when=asyncio.FIRST_COMPLETED ) # go through all the finished tasks for t in done: diff --git a/opensearchpy/_version.py b/opensearchpy/_version.py index b9ad64ce6..0d011cb0d 100644 --- a/opensearchpy/_version.py +++ b/opensearchpy/_version.py @@ -24,4 +24,4 @@ # specific language governing permissions and limitations # under the License. -__versionstr__: str = "2.4.3" +__versionstr__: str = "2.5.0" diff --git a/opensearchpy/client/__init__.py b/opensearchpy/client/__init__.py index 0dfafab71..f480daf54 100644 --- a/opensearchpy/client/__init__.py +++ b/opensearchpy/client/__init__.py @@ -52,6 +52,7 @@ from .plugins import PluginsClient from .remote import RemoteClient from .remote_store import RemoteStoreClient +from .search_pipeline import SearchPipelineClient from .security import SecurityClient from .snapshot import SnapshotClient from .tasks import TasksClient @@ -215,6 +216,7 @@ class as kwargs, or a string in the format of ``host[:port]`` which will be super().__init__(hosts, transport_class, **kwargs) # namespaced clients for compatibility with API names + self.search_pipeline = SearchPipelineClient(self) self.cat = CatClient(self) self.cluster = ClusterClient(self) self.dangling_indices = DanglingIndicesClient(self) @@ -256,7 +258,7 @@ def close(self) -> None: self.transport.close() # AUTO-GENERATED-API-DEFINITIONS # - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def ping( self, params: Any = None, @@ -265,6 +267,17 @@ def ping( """ Returns whether the cluster is running. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ try: return self.transport.perform_request( @@ -273,7 +286,7 @@ def ping( except TransportError: return False - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def info( self, params: Any = None, @@ -282,15 +295,31 @@ def info( """ Returns basic information about the cluster. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/", params=params, headers=headers ) @query_params( + "error_trace", + "filter_path", + "human", "pipeline", + "pretty", "refresh", "routing", + "source", "timeout", "version", "version_type", @@ -309,25 +338,47 @@ def create( with a same ID already exists in the index. - :arg index: Index name. - :arg id: Document ID. + :arg index: Name of the data stream or index to target. If the + target doesn’t exist and matches the name or wildcard (`*`) pattern of + an index template with a `data_stream` definition, this request creates + the data stream. If the target doesn’t exist and doesn’t match a data + stream template, this request creates the index. + :arg id: Unique identifier for the document. :arg body: The document - :arg pipeline: The pipeline id to preprocess incoming documents - with. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pipeline: ID of the pipeline to use to preprocess incoming + documents.If the index has a default ingest pipeline specified, then + setting the value to `_none` disables the default ingest pipeline for + this request.If a final pipeline is configured it will always run, + regardless of the value of this parameter. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, Opensearch refreshes the affected + shards to make this operation visible to search, if `wait_for` then wait + for a refresh to make this operation visible to search, if `false` do + nothing with refreshes.Valid values: `true`, `false`, `wait_for`. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period the request waits for the following + operations: automatic index creation, dynamic mapping updates, waiting + for active shards. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. """ for param in (index, id, body): if param in SKIP_IN_PATH: @@ -340,13 +391,18 @@ def create( ) @query_params( + "error_trace", + "filter_path", + "human", "if_primary_term", "if_seq_no", "op_type", "pipeline", + "pretty", "refresh", "require_alias", "routing", + "source", "timeout", "version", "version_type", @@ -364,34 +420,55 @@ def index( Creates or updates a document in an index. - :arg index: Index name. + :arg index: Name of the data stream or index to target. :arg body: The document - :arg id: Document ID. - :arg if_primary_term: only perform the operation if the last - operation that has changed the document has the specified primary term. - :arg if_seq_no: only perform the operation if the last operation - that has changed the document has the specified sequence number. - :arg op_type: Explicit operation type. Defaults to `index` for - requests with an explicit document ID, and to `create` for requests - without an explicit document ID. Valid choices are index, create. - :arg pipeline: The pipeline id to preprocess incoming documents - with. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg require_alias: When true, requires destination to be an - alias. Default is false. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + :arg id: Unique identifier for the document. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg if_primary_term: Only perform the operation if the document + has this primary term. + :arg if_seq_no: Only perform the operation if the document has + this sequence number. + :arg op_type: Set to create to only index the document if it + does not already exist (put if absent).If a document with the specified + `_id` already exists, the indexing operation will fail.Same as using the + `/_create` endpoint.Valid values: `index`, `create`.If document + id is specified, it defaults to `index`.Otherwise, it defaults to + `create`. + :arg pipeline: ID of the pipeline to use to preprocess incoming + documents.If the index has a default ingest pipeline specified, then + setting the value to `_none` disables the default ingest pipeline for + this request.If a final pipeline is configured it will always run, + regardless of the value of this parameter. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, Opensearch refreshes the affected + shards to make this operation visible to search, if `wait_for` then wait + for a refresh to make this operation visible to search, if `false` do + nothing with refreshes.Valid values: `true`, `false`, `wait_for`. + :arg require_alias: If `true`, the destination must be an index + alias. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period the request waits for the following + operations: automatic index creation, dynamic mapping updates, waiting + for active shards. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to all or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. """ for param in (index, body): if param in SKIP_IN_PATH: @@ -409,10 +486,15 @@ def index( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "pipeline", + "pretty", "refresh", "require_alias", "routing", + "source", "timeout", "wait_for_active_shards", ) @@ -429,29 +511,44 @@ def bulk( :arg body: The operation definition and data (action-data pairs), separated by newlines - :arg index: Default index for items which don't provide one. - :arg _source: True or false to return the _source field or not, - or default list of fields to return, can be overridden on each sub- - request. - :arg _source_excludes: Default list of fields to exclude from - the returned _source field, can be overridden on each sub-request. - :arg _source_includes: Default list of fields to extract and - return from the _source field, can be overridden on each sub-request. - :arg pipeline: The pipeline id to preprocess incoming documents - with. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg require_alias: Sets require_alias for all incoming - documents. Default is false. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + :arg index: Name of the data stream, index, or index alias to + perform bulk actions on. + :arg _source: `true` or `false` to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude from the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pipeline: ID of the pipeline to use to preprocess incoming + documents.If the index has a default ingest pipeline specified, then + setting the value to `_none` disables the default ingest pipeline for + this request.If a final pipeline is configured it will always run, + regardless of the value of this parameter. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, Opensearch refreshes the affected + shards to make this operation visible to search, if `wait_for` then wait + for a refresh to make this operation visible to search, if `false` do + nothing with refreshes.Valid values: `true`, `false`, `wait_for`. + :arg require_alias: If `true`, the request’s actions must target + an index alias. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period each action waits for the following + operations: automatic index creation, dynamic mapping updates, waiting + for active shards. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to all or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -465,7 +562,7 @@ def bulk( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def clear_scroll( self, body: Any = None, @@ -479,7 +576,18 @@ def clear_scroll( :arg body: Comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter - :arg scroll_id: Comma-separated list of scroll IDs to clear. + :arg scroll_id: Comma-separated list of scroll IDs to clear. To + clear all scroll IDs, use `_all`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if scroll_id in SKIP_IN_PATH and body in SKIP_IN_PATH: raise ValueError("You need to supply scroll_id or body.") @@ -498,14 +606,19 @@ def clear_scroll( "analyzer", "default_operator", "df", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_throttled", "ignore_unavailable", "lenient", "min_score", "preference", + "pretty", "q", "routing", + "source", "terminate_after", ) def count( @@ -521,36 +634,56 @@ def count( :arg body: Query to restrict the results specified with the Query DSL (optional) - :arg index: Comma-separated list of indices to restrict the - results. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. + :arg index: Comma-separated list of data streams, indices, and + aliases to search. Supports wildcards (`*`). To search all data streams + and indices, omit this parameter or use `*` or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed.This parameter can only be used when the `q` query string + parameter is specified. + :arg analyzer: Analyzer to use for the query string.This + parameter can only be used when the `q` query string parameter is + specified. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg min_score: Include only documents with a specific `_score` - value in the result. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. + query: `AND` or `OR`.This parameter can only be used when the `q` query + string parameter is specified. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string.This parameter can only be used when the `q` query + string parameter is specified. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`. Valid choices are all, open, + closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_throttled: If `true`, concrete, expanded or aliased + indices are ignored when frozen. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg min_score: Sets the minimum `_score` value that documents + must have to be included in the result. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg routing: Comma-separated list of specific routing values. - :arg terminate_after: The maximum number of documents to collect - for each shard, upon reaching which the query execution will terminate - early. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg terminate_after: Maximum number of documents to collect for + each shard.If a query reaches this limit, Opensearch terminates the + query early.Opensearch collects documents before sorting. """ return self.transport.perform_request( "POST", @@ -561,10 +694,15 @@ def count( ) @query_params( + "error_trace", + "filter_path", + "human", "if_primary_term", "if_seq_no", + "pretty", "refresh", "routing", + "source", "timeout", "version", "version_type", @@ -581,26 +719,39 @@ def delete( Removes a document from the index. - :arg index: Index name. - :arg id: Document ID. - :arg if_primary_term: only perform the operation if the last - operation that has changed the document has the specified primary term. - :arg if_seq_no: only perform the operation if the last operation - that has changed the document has the specified sequence number. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + :arg index: Name of the target index. + :arg id: Unique identifier for the document. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg if_primary_term: Only perform the operation if the document + has this primary term. + :arg if_seq_no: Only perform the operation if the document has + this sequence number. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, Opensearch refreshes the affected + shards to make this operation visible to search, if `wait_for` then wait + for a refresh to make this operation visible to search, if `false` do + nothing with refreshes.Valid values: `true`, `false`, `wait_for`. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for active shards. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -620,12 +771,16 @@ def delete( "conflicts", "default_operator", "df", + "error_trace", "expand_wildcards", + "filter_path", "from_", + "human", "ignore_unavailable", "lenient", "max_docs", "preference", + "pretty", "q", "refresh", "request_cache", @@ -638,6 +793,7 @@ def delete( "size", "slices", "sort", + "source", "stats", "terminate_after", "timeout", @@ -656,8 +812,9 @@ def delete_by_query( Deletes documents matching the provided query. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + :arg index: Comma-separated list of data streams, indices, and + aliases to search. Supports wildcards (`*`). To search all data streams + or indices, omit this parameter or use `*` or `_all`. :arg body: The search definition using the Query DSL :arg _source: True or false to return the _source field or not, or a list of fields to return. @@ -665,67 +822,85 @@ def delete_by_query( returned _source field. :arg _source_includes: List of fields to extract and return from the _source field. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. - :arg conflicts: What to do when the operation encounters version - conflicts?. Valid choices are abort, proceed. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices.For example, a request targeting `foo*,bar*` + returns an error if an index starts with `foo` but no index starts with + `bar`. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed. + :arg analyzer: Analyzer to use for the query string. + :arg conflicts: What to do if delete by query hits version + conflicts: `abort` or `proceed`. Valid choices are abort, proceed. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg from_: Starting offset. Default is 0. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg max_docs: Maximum number of documents to process (default: - all documents). - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. + query: `AND` or `OR`. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`. Valid values are: `all`, + `open`, `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg from_: Starting offset (default: 0) + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg max_docs: Maximum number of documents to process.Defaults + to all documents. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting. + :arg refresh: If `true`, Opensearch refreshes all shards + involved in the delete by query after the request completes. + :arg request_cache: If `true`, the request cache is used for + this request.Defaults to the index-level setting. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. Default is 0. - :arg routing: Comma-separated list of specific routing values. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. - :arg scroll_size: Size on the scroll request powering the - operation. Default is 100. - :arg search_timeout: Explicit timeout for each search request. - Defaults to no timeout. - :arg search_type: Search operation type. Valid choices are + requests per second. + :arg routing: Custom value used to route operations to a + specific shard. + :arg scroll: Period to retain the search context for scrolling. + :arg scroll_size: Size of the scroll request that powers the + operation. + :arg search_timeout: Explicit timeout for each search + request.Defaults to no timeout. + :arg search_type: The type of the search operation.Available + options: `query_then_fetch`, `dfs_query_then_fetch`. Valid choices are query_then_fetch, dfs_query_then_fetch. :arg size: Deprecated, please use `max_docs` instead. :arg slices: The number of slices this task should be divided - into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default is 1. - :arg sort: Comma-separated list of : pairs. - :arg stats: Specific 'tag' of the request for logging and + into. Valid choices are auto. + :arg sort: A comma-separated list of : pairs. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stats: Specific `tag` of the request for logging and statistical purposes. - :arg terminate_after: The maximum number of documents to collect - for each shard, upon reaching which the query execution will terminate - early. - :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default is 1m. - :arg version: Whether to return document version as part of a - hit. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is True. + :arg terminate_after: Maximum number of documents to collect for + each shard.If a query reaches this limit, Opensearch terminates the + query early.Opensearch collects documents before sorting.Use with + caution.Opensearch applies this parameter to each shard handling the + request.When possible, let Opensearch perform early termination + automatically.Avoid specifying this parameter for requests that target + data streams with backing indices across multiple data tiers. + :arg timeout: Period each deletion request waits for active + shards. + :arg version: If `true`, returns the document version as part of + a hit. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to all or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. + :arg wait_for_completion: If `true`, the request blocks until + the operation is complete. """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: @@ -743,7 +918,9 @@ def delete_by_query( body=body, ) - @query_params("requests_per_second") + @query_params( + "error_trace", "filter_path", "human", "pretty", "requests_per_second", "source" + ) def delete_by_query_rethrottle( self, task_id: Any, @@ -755,9 +932,19 @@ def delete_by_query_rethrottle( operation. - :arg task_id: The task id to rethrottle. + :arg task_id: The ID for the task. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. + requests per second. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -769,7 +956,16 @@ def delete_by_query_rethrottle( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def delete_script( self, id: Any, @@ -780,13 +976,26 @@ def delete_script( Deletes a script. - :arg id: Script ID. + :arg id: Identifier for the stored script or search template. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'id'.") @@ -799,10 +1008,15 @@ def delete_script( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "stored_fields", "version", "version_type", @@ -818,26 +1032,42 @@ def exists( Returns information about whether a document exists in an index. - :arg index: Index name. - :arg id: Document ID. - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. - :arg stored_fields: Comma-separated list of stored fields to - return. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. + :arg index: Comma-separated list of data streams, indices, and + aliases. Supports wildcards (`*`). + :arg id: Identifier of the document. + :arg _source: `true` or `false` to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude in the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If `true`, the request is real-time as opposed to + near-real-time. + :arg refresh: If `true`, Opensearch refreshes all shards + involved in the delete by query after the request completes. + :arg routing: Target the specified primary shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stored_fields: List of stored fields to return as part of a + hit.If no fields are specified, no stored fields are included in the + response.If this field is specified, the `_source` parameter defaults to + false. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -851,10 +1081,15 @@ def exists( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "version", "version_type", ) @@ -869,24 +1104,38 @@ def exists_source( Returns information about whether a document source exists in an index. - :arg index: Index name. - :arg id: Document ID. - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. + :arg index: Comma-separated list of data streams, indices, and + aliases. Supports wildcards (`*`). + :arg id: Identifier of the document. + :arg _source: `true` or `false` to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude in the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If true, the request is real-time as opposed to + near-real-time. + :arg refresh: If `true`, Opensearch refreshes all shards + involved in the delete by query after the request completes. + :arg routing: Target the specified primary shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -906,10 +1155,15 @@ def exists_source( "analyzer", "default_operator", "df", + "error_trace", + "filter_path", + "human", "lenient", "preference", + "pretty", "q", "routing", + "source", "stored_fields", ) def explain( @@ -924,30 +1178,44 @@ def explain( Returns information about why a specific matches (or doesn't match) a query. - :arg index: Index name. - :arg id: Document ID. + :arg index: Index names used to limit the request. Only a single + index name can be provided to this parameter. + :arg id: Defines the document ID. :arg body: The query definition using the Query DSL - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg analyze_wildcard: Specify whether wildcards and prefix - queries in the query string query should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. + :arg _source: True or false to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude from the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed. + :arg analyzer: Analyzer to use for the query string.This + parameter can only be used when the `q` query string parameter is + specified. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The default field for query string query. Default is - _all. - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. + query: `AND` or `OR`. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg routing: Routing value. - :arg stored_fields: Comma-separated list of stored fields to - return. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stored_fields: A comma-separated list of stored fields to + return in the response. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -961,10 +1229,15 @@ def explain( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", "fields", + "filter_path", + "human", "ignore_unavailable", "include_unmapped", + "pretty", + "source", ) def field_caps( self, @@ -979,19 +1252,36 @@ def field_caps( :arg body: An index filter specified with the Query DSL - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg fields: Comma-separated list of field names. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg include_unmapped: Indicates whether unmapped fields should - be included in the response. Default is false. + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (*). To target all + data streams and indices, omit this parameter or use * or _all. + :arg allow_no_indices: If false, the request returns an error if + any wildcard expression, index alias,or `_all` value targets only + missing or closed indices. This behavior applies even if the request + targets other open indices. For example, a requesttargeting `foo*,bar*` + returns an error if an index starts with foo but no index starts with + bar. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match. If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams. Supports comma- + separated values, such as `open,hidden`. Valid choices are all, open, + closed, hidden, none. + :arg fields: Comma-separated list of fields to retrieve + capabilities for. Wildcard (`*`) expressions are supported. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `true`, missing or closed indices + are not included in the response. + :arg include_unmapped: If true, unmapped fields are included in + the response. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", @@ -1005,10 +1295,15 @@ def field_caps( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "stored_fields", "version", "version_type", @@ -1024,26 +1319,41 @@ def get( Returns a document. - :arg index: Index name. - :arg id: Document ID. + :arg index: Name of the index that contains the document. + :arg id: Unique identifier of the document. :arg _source: True or false to return the _source field or not, or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. - :arg stored_fields: Comma-separated list of stored fields to - return. + :arg _source_excludes: A comma-separated list of source fields + to exclude in the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on. Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If `true`, the request is real-time as opposed to + near-real-time. + :arg refresh: If true, Opensearch refreshes the affected shards + to make this operation visible to search. If false, do nothing with + refreshes. + :arg routing: Target the specified primary shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stored_fields: List of stored fields to return as part of a + hit.If no fields are specified, no stored fields are included in the + response.If this field is specified, the `_source` parameter defaults to + false. :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. + The specified version must match the current version of the document for + the request to succeed. + :arg version_type: Specific version type: internal, external, + external_gte. Valid choices are internal, external, external_gte, force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1053,7 +1363,15 @@ def get( "GET", _make_path(index, "_doc", id), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) def get_script( self, id: Any, @@ -1064,12 +1382,22 @@ def get_script( Returns a script. - :arg id: Script ID. + :arg id: Identifier for the stored script or search template. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'id'.") @@ -1082,10 +1410,15 @@ def get_script( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "version", "version_type", ) @@ -1100,24 +1433,37 @@ def get_source( Returns the source of a document. - :arg index: Index name. - :arg id: Document ID. + :arg index: Name of the index that contains the document. + :arg id: Unique identifier of the document. :arg _source: True or false to return the _source field or not, or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. + :arg _source_excludes: A comma-separated list of source fields + to exclude in the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on. Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: Boolean) If true, the request is real-time as + opposed to near-real-time. + :arg refresh: If true, Opensearch refreshes the affected shards + to make this operation visible to search. If false, do nothing with + refreshes. + :arg routing: Target the specified primary shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. + The specified version must match the current version of the document for + the request to succeed. + :arg version_type: Specific version type: internal, external, + external_gte. Valid choices are internal, external, external_gte, force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1133,10 +1479,15 @@ def get_source( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "stored_fields", ) def mget( @@ -1153,22 +1504,39 @@ def mget( :arg body: Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL. - :arg index: Index name. - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. - :arg stored_fields: Comma-separated list of stored fields to - return. + :arg index: Name of the index to retrieve documents from when + `ids` are specified, or when a document in the `docs` array does not + specify an index. + :arg _source: True or false to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude from the response.You can also use this parameter to exclude + fields from the subset specified in `_source_includes` query parameter. + :arg _source_includes: A comma-separated list of source fields + to include in the response.If this parameter is specified, only these + source fields are returned. You can exclude fields from this subset + using the `_source_excludes` query parameter.If the `_source` parameter + is `false`, this parameter is ignored. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on. Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If `true`, the request is real-time as opposed to + near-real-time. + :arg refresh: If `true`, the request refreshes relevant shards + before retrieving documents. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stored_fields: If `true`, retrieves the document fields + stored in the index rather than the document `_source`. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1183,11 +1551,16 @@ def mget( @query_params( "ccs_minimize_roundtrips", + "error_trace", + "filter_path", + "human", "max_concurrent_searches", "max_concurrent_shard_requests", "pre_filter_shard_size", + "pretty", "rest_total_hits_as_int", "search_type", + "source", "typed_keys", ) def msearch( @@ -1203,31 +1576,39 @@ def msearch( :arg body: The request definitions (metadata-search request definition pairs), separated by newlines - :arg index: Comma-separated list of indices to use as default. - :arg ccs_minimize_roundtrips: Indicates whether network round- - trips should be minimized as part of cross-cluster search requests - execution. Default is True. - :arg max_concurrent_searches: Controls the maximum number of - concurrent searches the multi search api will execute. - :arg max_concurrent_shard_requests: The number of concurrent - shard requests each sub search executes concurrently per node. This - value should be used to limit the impact of the search on the cluster in - order to limit the number of concurrent shard requests. Default is 5. - :arg pre_filter_shard_size: Threshold that enforces a pre-filter - round-trip to prefilter search shards based on query rewriting if the - number of shards the search request expands to exceeds the threshold. - This filter round-trip can limit the number of shards significantly if - for instance a shard can not match any documents based on its rewrite - method ie. if date filters are mandatory to match but the shard bounds - and the query are disjoint. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg search_type: Search operation type. Valid choices are - query_then_fetch, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch. - :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response. + :arg index: Comma-separated list of data streams, indices, and + index aliases to search. + :arg ccs_minimize_roundtrips: If true, network roundtrips + between the coordinating node and remote clusters are minimized for + cross-cluster search requests. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg max_concurrent_searches: Maximum number of concurrent + searches the multi search API can execute. + :arg max_concurrent_shard_requests: Maximum number of concurrent + shard requests that each sub-search request executes per node. + :arg pre_filter_shard_size: Defines a threshold that enforces a + pre-filter roundtrip to prefilter search shards based on query rewriting + if the number of shards the search request expands to exceeds the + threshold. This filter roundtrip can limit the number of shards + significantly if for instance a shard can not match any documents based + on its rewrite method i.e., if date filters are mandatory to match but + the shard bounds and the query are disjoint. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg rest_total_hits_as_int: If true, hits.total are returned as + an integer in the response. Defaults to false, which returns an object. + :arg search_type: Indicates whether global term and document + frequencies should be used when scoring returned documents. Valid + choices are query_then_fetch, dfs_query_then_fetch. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg typed_keys: Specifies whether aggregation and suggester + names should be prefixed by their respective types in the response. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1243,9 +1624,14 @@ def msearch( @query_params( "ccs_minimize_roundtrips", + "error_trace", + "filter_path", + "human", "max_concurrent_searches", + "pretty", "rest_total_hits_as_int", "search_type", + "source", "typed_keys", ) def msearch_template( @@ -1261,20 +1647,31 @@ def msearch_template( :arg body: The request definitions (metadata-search request definition pairs), separated by newlines - :arg index: Comma-separated list of indices to use as default. - :arg ccs_minimize_roundtrips: Indicates whether network round- - trips should be minimized as part of cross-cluster search requests - execution. Default is True. - :arg max_concurrent_searches: Controls the maximum number of - concurrent searches the multi search api will execute. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg search_type: Search operation type. Valid choices are - query_then_fetch, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch. - :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response. + :arg index: Comma-separated list of data streams, indices, and + aliases to search. Supports wildcards (`*`). To search all data streams + and indices, omit this parameter or use `*`. + :arg ccs_minimize_roundtrips: If `true`, network round-trips are + minimized for cross-cluster search requests. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg max_concurrent_searches: Maximum number of concurrent + searches the API can run. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg rest_total_hits_as_int: If `true`, the response returns + `hits.total` as an integer.If `false`, it returns `hits.total` as an + object. + :arg search_type: The type of the search operation.Available + options: `query_then_fetch`, `dfs_query_then_fetch`. Valid choices are + query_then_fetch, dfs_query_then_fetch. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg typed_keys: If `true`, the response prefixes aggregation + and suggester names with their respective types. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1289,15 +1686,20 @@ def msearch_template( ) @query_params( + "error_trace", "field_statistics", "fields", + "filter_path", + "human", "ids", "offsets", "payloads", "positions", "preference", + "pretty", "realtime", "routing", + "source", "term_statistics", "version", "version_type", @@ -1316,36 +1718,39 @@ def mtermvectors( :arg body: Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation. - :arg index: The index in which the document resides. - :arg field_statistics: Specifies if document count, sum of - document frequencies and sum of total term frequencies should be - returned. Applies to all returned documents unless otherwise specified - in body 'params' or 'docs'. Default is True. - :arg fields: Comma-separated list of fields to return. Applies - to all returned documents unless otherwise specified in body 'params' or - 'docs'. - :arg ids: Comma-separated list of documents ids. You must define - ids as parameter or set 'ids' or 'docs' in the request body. - :arg offsets: Specifies if term offsets should be returned. - Applies to all returned documents unless otherwise specified in body - 'params' or 'docs'. Default is True. - :arg payloads: Specifies if term payloads should be returned. - Applies to all returned documents unless otherwise specified in body - 'params' or 'docs'. Default is True. - :arg positions: Specifies if term positions should be returned. - Applies to all returned documents unless otherwise specified in body - 'params' or 'docs'. Default is True. - :arg preference: Specify the node or shard the operation should - be performed on. Applies to all returned documents unless otherwise - specified in body 'params' or 'docs'. Default is random. - :arg realtime: Specifies if requests are real-time as opposed to - near-real-time. Default is True. - :arg routing: Routing value. Applies to all returned documents - unless otherwise specified in body 'params' or 'docs'. - :arg term_statistics: Specifies if total term frequency and - document frequency should be returned. Applies to all returned documents - unless otherwise specified in body 'params' or 'docs'. Default is false. - :arg version: Explicit version number for concurrency control. + :arg index: Name of the index that contains the documents. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg field_statistics: If `true`, the response includes the + document count, sum of document frequencies, and sum of total term + frequencies. + :arg fields: Comma-separated list or wildcard expressions of + fields to include in the statistics.Used as the default list unless a + specific field list is provided in the `completion_fields` or + `fielddata_fields` parameters. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ids: A comma-separated list of documents ids. You must + define ids as parameter or set "ids" or "docs" in the request body + :arg offsets: If `true`, the response includes term offsets. + :arg payloads: If `true`, the response includes term payloads. + :arg positions: If `true`, the response includes term positions. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If true, the request is real-time as opposed to + near-real-time. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg term_statistics: If true, the response includes term + frequency and document frequency. + :arg version: If `true`, returns the document version as part of + a hit. :arg version_type: Specific version type. Valid choices are internal, external, external_gte, force. """ @@ -1355,7 +1760,16 @@ def mtermvectors( "POST", path, params=params, headers=headers, body=body ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def put_script( self, id: Any, @@ -1368,15 +1782,31 @@ def put_script( Creates or updates a script. - :arg id: Script ID. + :arg id: Identifier for the stored script or search template. + Must be unique within the cluster. :arg body: The document - :arg context: Script context. + :arg context: Context in which the script or search template + should run. To prevent errors, the API immediately compiles the script + or template in this context. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ for param in (id, body): if param in SKIP_IN_PATH: @@ -1391,7 +1821,15 @@ def put_script( ) @query_params( - "allow_no_indices", "expand_wildcards", "ignore_unavailable", "search_type" + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "search_type", + "source", ) def rank_eval( self, @@ -1407,18 +1845,32 @@ def rank_eval( :arg body: The ranking evaluation search definition, including search requests, document ratings and ranking metric definition. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg index: Comma-separated list of data streams, indices, and + index aliases used to limit the request. Wildcard (`*`) expressions are + supported. To target all data streams and indices in a cluster, omit + this parameter or use `_all` or `*`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices. This behavior applies even if the request + targets other open indices. For example, a request targeting `foo*,bar*` + returns an error if an index starts with `foo` but no index starts with + `bar`. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg search_type: Search operation type. Valid choices are - query_then_fetch, dfs_query_then_fetch. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `true`, missing or closed indices + are not included in the response. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg search_type: Search operation type + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1432,11 +1884,16 @@ def rank_eval( ) @query_params( + "error_trace", + "filter_path", + "human", "max_docs", + "pretty", "refresh", "requests_per_second", "scroll", "slices", + "source", "timeout", "wait_for_active_shards", "wait_for_completion", @@ -1455,25 +1912,35 @@ def reindex( :arg body: The search definition using the Query DSL and the prototype for the index request. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg max_docs: Maximum number of documents to process (default: all documents). - :arg refresh: Should the affected indexes be refreshed?. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, the request refreshes affected shards + to make this operation visible to search. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. Default is 0. - :arg scroll: Specify how long a consistent view of the index + requests per second.Defaults to no throttle. + :arg scroll: Specifies how long a consistent view of the index should be maintained for scrolled search. :arg slices: The number of slices this task should be divided - into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default is 1. - :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default is 1m. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is True. + into.Defaults to 1 slice, meaning the task isn’t sliced into subtasks. + Valid choices are auto. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period each indexing waits for automatic index + creation, dynamic mapping updates, and waiting for active shards. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. + :arg wait_for_completion: If `true`, the request blocks until + the operation is complete. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1482,7 +1949,9 @@ def reindex( "POST", "/_reindex", params=params, headers=headers, body=body ) - @query_params("requests_per_second") + @query_params( + "error_trace", "filter_path", "human", "pretty", "requests_per_second", "source" + ) def reindex_rethrottle( self, task_id: Any, @@ -1493,9 +1962,19 @@ def reindex_rethrottle( Changes the number of requests per second for a particular Reindex operation. - :arg task_id: The task id to rethrottle. + :arg task_id: Identifier for the task. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. + requests per second. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -1507,7 +1986,7 @@ def reindex_rethrottle( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def render_search_template( self, body: Any = None, @@ -1520,7 +1999,18 @@ def render_search_template( :arg body: The search definition template and its params - :arg id: The id of the stored search template. + :arg id: ID of the search template to render. If no `source` is + specified, this or the `id` request body parameter is required. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", @@ -1530,7 +2020,7 @@ def render_search_template( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def scripts_painless_execute( self, body: Any = None, @@ -1542,6 +2032,16 @@ def scripts_painless_execute( :arg body: The script to execute + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", @@ -1551,7 +2051,15 @@ def scripts_painless_execute( body=body, ) - @query_params("rest_total_hits_as_int", "scroll") + @query_params( + "error_trace", + "filter_path", + "human", + "pretty", + "rest_total_hits_as_int", + "scroll", + "source", + ) def scroll( self, body: Any = None, @@ -1565,12 +2073,21 @@ def scroll( :arg body: The scroll ID if not passed by URL or query parameter. - :arg scroll_id: Scroll ID. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. + :arg scroll_id: The scroll ID for scrolled search + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg rest_total_hits_as_int: If true, the API response’s + hit.total property is returned as an integer. If false, the API + response’s hit.total property is returned as an object. + :arg scroll: Period to retain the search context for scrolling. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if scroll_id in SKIP_IN_PATH and body in SKIP_IN_PATH: raise ValueError("You need to supply scroll_id or body.") @@ -1596,15 +2113,20 @@ def scroll( "default_operator", "df", "docvalue_fields", + "error_trace", "expand_wildcards", "explain", + "filter_path", "from_", + "human", "ignore_throttled", "ignore_unavailable", + "include_named_queries_score", "lenient", "max_concurrent_shard_requests", "pre_filter_shard_size", "preference", + "pretty", "q", "request_cache", "rest_total_hits_as_int", @@ -1615,6 +2137,7 @@ def scroll( "seq_no_primary_term", "size", "sort", + "source", "stats", "stored_fields", "suggest_field", @@ -1640,100 +2163,184 @@ def search( :arg body: The search definition using the Query DSL - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg allow_partial_search_results: Indicate if an error should - be returned if there is a partial search failure or timeout. Default is - True. - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. + :arg index: Comma-separated list of data streams, indices, and + aliases to search. Supports wildcards (`*`). To search all data streams + and indices, omit this parameter or use `*` or `_all`. + :arg _source: Indicates which source fields are returned for + matching documents.These fields are returned in the `hits._source` + property of the search response.Valid values are:`true` to return the + entire document source;`false` to not return the document + source;`` to return the source fields that are specified as a + comma-separated list (supports wildcard (`*`) patterns). + :arg _source_excludes: A comma-separated list of source fields + to exclude from the response.You can also use this parameter to exclude + fields from the subset specified in `_source_includes` query + parameter.If the `_source` parameter is `false`, this parameter is + ignored. + :arg _source_includes: A comma-separated list of source fields + to include in the response.If this parameter is specified, only these + source fields are returned.You can exclude fields from this subset using + the `_source_excludes` query parameter.If the `_source` parameter is + `false`, this parameter is ignored. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices.For example, a request targeting `foo*,bar*` + returns an error if an index starts with `foo` but no index starts with + `bar`. + :arg allow_partial_search_results: If true, returns partial + results if there are shard request timeouts or shard failures. If false, + returns an error with no partial results. + :arg analyze_wildcard: If true, wildcard and prefix queries are + analyzed.This parameter can only be used when the q query string + parameter is specified. + :arg analyzer: Analyzer to use for the query string.This + parameter can only be used when the q query string parameter is + specified. :arg batched_reduce_size: The number of shard results that - should be reduced at once on the coordinating node. This value should be + should be reduced at once on the coordinating node.This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. - Default is 512. - :arg ccs_minimize_roundtrips: Indicates whether network round- - trips should be minimized as part of cross-cluster search requests - execution. Default is True. + :arg ccs_minimize_roundtrips: If true, network round-trips + between the coordinating node and the remote clusters are minimized when + executing cross-cluster search (CCS) requests. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg docvalue_fields: Comma-separated list of fields to return - as the docvalue representation of a field for each hit. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg explain: Specify whether to return detailed information - about score computation as part of a hit. - :arg from_: Starting offset. Default is 0. - :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg max_concurrent_shard_requests: The number of concurrent - shard requests per node this search executes concurrently. This value - should be used to limit the impact of the search on the cluster in order - to limit the number of concurrent shard requests. Default is 5. - :arg pre_filter_shard_size: Threshold that enforces a pre-filter - round-trip to prefilter search shards based on query rewriting if the - number of shards the search request expands to exceeds the threshold. - This filter round-trip can limit the number of shards significantly if - for instance a shard can not match any documents based on its rewrite - method ie. if date filters are mandatory to match but the shard bounds - and the query are disjoint. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg q: Query in the Lucene query string syntax. - :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg routing: Comma-separated list of specific routing values. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. + query: AND or OR.This parameter can only be used when the `q` query + string parameter is specified. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string.This parameter can only be used when the q query + string parameter is specified. + :arg docvalue_fields: A comma-separated list of fields to return + as the docvalue representation for each hit. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`. Valid choices are all, open, + closed, hidden, none. + :arg explain: If `true`, returns detailed information about + score computation as part of a hit. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg from_: Starting document offset.Needs to be non-negative.By + default, you cannot page through more than 10,000 hits using the `from` + and `size` parameters.To page through more hits, use the `search_after` + parameter. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_throttled: If `true`, concrete, expanded or aliased + indices will be ignored when frozen. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg include_named_queries_score: Indicates whether + hit.matched_queries should be rendered as a map that includes the name + of the matched query associated with its score (true) or as an array + containing the name of the matched queries (false) Default is false. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be + ignored.This parameter can only be used when the `q` query string + parameter is specified. + :arg max_concurrent_shard_requests: Defines the number of + concurrent shard requests per node this search executes + concurrently.This value should be used to limit the impact of the search + on the cluster in order to limit the number of concurrent shard + requests. + :arg pre_filter_shard_size: Defines a threshold that enforces a + pre-filter roundtrip to prefilter search shards based on query rewriting + if the number of shards the search request expands to exceeds the + threshold.This filter roundtrip can limit the number of shards + significantly if for instance a shard can not match any documents based + on its rewrite method (if date filters are mandatory to match but the + shard bounds and the query are disjoint).When unspecified, the pre- + filter phase is executed if any of these conditions is met:the request + targets more than 128 shards;the request targets one or more read-only + index;the primary sort of the query targets an indexed field. + :arg preference: Nodes and shards used for the search.By + default, Opensearch selects from eligible nodes and shards using + adaptive replica selection, accounting for allocation awareness. Valid + values are:`_only_local` to run the search only on shards on the local + node;`_local` to, if possible, run the search on shards on the local + node, or if not, select shards using the default + method;`_only_nodes:,` to run the search on only the + specified nodes IDs, where, if suitable shards exist on more than one + selected node, use shards on those nodes using the default method, or if + none of the specified nodes are available, select shards from any + available node using the default method;`_prefer_nodes:,` to if possible, run the search on the specified nodes IDs, or if + not, select shards using the default method;`_shards:,` to + run the search only on the specified shards;`` (any + string that does not start with `_`) to route searches with the same + `` to the same shards in the same order. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg q: Query in the Lucene query string syntax using query + parameter search.Query parameter searches do not support the full + Opensearch Query DSL but are handy for testing. + :arg request_cache: If `true`, the caching of search results is + enabled for requests where `size` is `0`.Defaults to index level + settings. + :arg rest_total_hits_as_int: Indicates whether `hits.total` + should be rendered as an integer or an object in the rest search + response. + :arg routing: Custom value used to route operations to a + specific shard. + :arg scroll: Period to retain the search context for scrolling. + See Scroll search results.By default, this value cannot exceed `1d` (24 + hours).You can change this limit using the `search.max_keep_alive` + cluster-level setting. :arg search_pipeline: Customizable sequence of processing stages applied to search queries. - :arg search_type: Search operation type. Valid choices are - query_then_fetch, dfs_query_then_fetch. - :arg seq_no_primary_term: Specify whether to return sequence - number and primary term of the last modification of each hit. - :arg size: Number of hits to return. Default is 10. - :arg sort: Comma-separated list of : pairs. - :arg stats: Specific 'tag' of the request for logging and + :arg search_type: How distributed term frequencies are + calculated for relevance scoring. Valid choices are query_then_fetch, + dfs_query_then_fetch. + :arg seq_no_primary_term: If `true`, returns sequence number and + primary term of the last modification of each hit. + :arg size: Defines the number of hits to return.By default, you + cannot page through more than 10,000 hits using the `from` and `size` + parameters.To page through more hits, use the `search_after` parameter. + :arg sort: A comma-separated list of : pairs. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stats: Specific `tag` of the request for logging and statistical purposes. - :arg stored_fields: Comma-separated list of stored fields to - return. - :arg suggest_field: Specify which field to use for suggestions. - :arg suggest_mode: Specify suggest mode. Valid choices are - missing, popular, always. - :arg suggest_size: How many suggestions to return in response. + :arg stored_fields: A comma-separated list of stored fields to + return as part of a hit.If no fields are specified, no stored fields are + included in the response.If this field is specified, the `_source` + parameter defaults to `false`.You can pass `_source: true` to return + both source fields and stored fields in the search response. + :arg suggest_field: Specifies which field to use for + suggestions. + :arg suggest_mode: Specifies the suggest mode.This parameter can + only be used when the `suggest_field` and `suggest_text` query string + parameters are specified. Valid choices are missing, popular, always. + :arg suggest_size: Number of suggestions to return.This + parameter can only be used when the `suggest_field` and `suggest_text` + query string parameters are specified. :arg suggest_text: The source text for which the suggestions - should be returned. - :arg terminate_after: The maximum number of documents to collect - for each shard, upon reaching which the query execution will terminate - early. - :arg timeout: Operation timeout. - :arg track_scores: Whether to calculate and return scores even - if they are not used for sorting. - :arg track_total_hits: Indicate if the number of documents that - match the query should be tracked. - :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response. - :arg version: Whether to return document version as part of a + should be returned.This parameter can only be used when the + `suggest_field` and `suggest_text` query string parameters are + specified. + :arg terminate_after: Maximum number of documents to collect for + each shard.If a query reaches this limit, Opensearch terminates the + query early.Opensearch collects documents before sorting.Use with + caution.Opensearch applies this parameter to each shard handling the + request.When possible, let Opensearch perform early termination + automatically.Avoid specifying this parameter for requests that target + data streams with backing indices across multiple data tiers.If set to + `0` (default), the query does not terminate early. + :arg timeout: Specifies the period of time to wait for a + response from each shard.If no response is received before the timeout + expires, the request fails and returns an error. + :arg track_scores: If `true`, calculate and return document + scores, even if the scores are not used for sorting. + :arg track_total_hits: Number of hits matching the query to + count accurately.If `true`, the exact number of hits is returned at the + cost of some performance.If `false`, the response does not include the + total number of hits matching the query. + :arg typed_keys: If `true`, aggregation and suggester names are + be prefixed by their respective types in the response. + :arg version: If `true`, returns document version as part of a hit. """ # from is a reserved word so it cannot be used, use from_ instead @@ -1750,11 +2357,16 @@ def search( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "local", "preference", + "pretty", "routing", + "source", ) def search_shards( self, @@ -1767,21 +2379,37 @@ def search_shards( executed against. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg routing: Routing value. + :arg index: Returns the indices and shards that a search request + would be executed against. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices.For example, a request targeting `foo*,bar*` + returns an error if an index starts with `foo` but no index starts with + `bar`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path(index, "_search_shards"), params=params, headers=headers @@ -1790,16 +2418,21 @@ def search_shards( @query_params( "allow_no_indices", "ccs_minimize_roundtrips", + "error_trace", "expand_wildcards", "explain", + "filter_path", + "human", "ignore_throttled", "ignore_unavailable", "preference", + "pretty", "profile", "rest_total_hits_as_int", "routing", "scroll", "search_type", + "source", "typed_keys", ) def search_template( @@ -1814,37 +2447,50 @@ def search_template( :arg body: The search definition template and its params - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg ccs_minimize_roundtrips: Indicates whether network round- - trips should be minimized as part of cross-cluster search requests - execution. Default is True. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg explain: Specify whether to return detailed information - about score computation as part of a hit. - :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg profile: Specify whether to profile the query execution. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg routing: Comma-separated list of specific routing values. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. - :arg search_type: Search operation type. Valid choices are - query_then_fetch, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch. - :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response. + :arg index: Comma-separated list of data streams, indices, and + aliases to search. Supports wildcards (*). + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices.For example, a request targeting `foo*,bar*` + returns an error if an index starts with `foo` but no index starts with + `bar`. + :arg ccs_minimize_roundtrips: If `true`, network round-trips are + minimized for cross-cluster search requests. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg explain: If `true`, the response includes additional + details about score computation as part of a hit. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_throttled: If `true`, specified concrete, expanded, + or aliased indices are not included in the response when throttled. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg profile: If `true`, the query execution is profiled. + :arg rest_total_hits_as_int: If true, hits.total are rendered as + an integer in the response. + :arg routing: Custom value used to route operations to a + specific shard. + :arg scroll: Specifies how long a consistent view of the + indexshould be maintained for scrolled search. + :arg search_type: The type of the search operation. Valid + choices are query_then_fetch, dfs_query_then_fetch. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg typed_keys: If `true`, the response prefixes aggregation + and suggester names with their respective types. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1858,14 +2504,19 @@ def search_template( ) @query_params( + "error_trace", "field_statistics", "fields", + "filter_path", + "human", "offsets", "payloads", "positions", "preference", + "pretty", "realtime", "routing", + "source", "term_statistics", "version", "version_type", @@ -1883,29 +2534,40 @@ def termvectors( document. - :arg index: The index in which the document resides. + :arg index: Name of the index that contains the document. :arg body: Define parameters and or supply a document to get termvectors for. See documentation. - :arg id: Document ID. When not specified a doc param should be - supplied. - :arg field_statistics: Specifies if document count, sum of - document frequencies and sum of total term frequencies should be - returned. Default is True. - :arg fields: Comma-separated list of fields to return. - :arg offsets: Specifies if term offsets should be returned. - Default is True. - :arg payloads: Specifies if term payloads should be returned. - Default is True. - :arg positions: Specifies if term positions should be returned. - Default is True. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specifies if request is real-time as opposed to - near-real-time. Default is True. - :arg routing: Routing value. - :arg term_statistics: Specifies if total term frequency and - document frequency should be returned. Default is false. - :arg version: Explicit version number for concurrency control. + :arg id: Unique identifier of the document. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg field_statistics: If `true`, the response includes the + document count, sum of document frequencies, and sum of total term + frequencies. + :arg fields: Comma-separated list or wildcard expressions of + fields to include in the statistics.Used as the default list unless a + specific field list is provided in the `completion_fields` or + `fielddata_fields` parameters. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg offsets: If `true`, the response includes term offsets. + :arg payloads: If `true`, the response includes term payloads. + :arg positions: If `true`, the response includes term positions. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If true, the request is real-time as opposed to + near-real-time. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg term_statistics: If `true`, the response includes term + frequency and document frequency. + :arg version: If `true`, returns the document version as part of + a hit. :arg version_type: Specific version type. Valid choices are internal, external, external_gte, force. """ @@ -1922,13 +2584,18 @@ def termvectors( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "if_primary_term", "if_seq_no", "lang", + "pretty", "refresh", "require_alias", "retry_on_conflict", "routing", + "source", "timeout", "wait_for_active_shards", ) @@ -1944,36 +2611,50 @@ def update( Updates a document with a script or partial document. - :arg index: Index name. - :arg id: Document ID. + :arg index: The name of the index + :arg id: Document ID :arg body: The request definition requires either `script` or partial `doc` - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg if_primary_term: only perform the operation if the last - operation that has changed the document has the specified primary term. - :arg if_seq_no: only perform the operation if the last operation - that has changed the document has the specified sequence number. - :arg lang: The script language. Default is painless. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg require_alias: When true, requires destination to be an - alias. Default is false. + :arg _source: Set to false to disable source retrieval. You can + also specify a comma-separatedlist of the fields you want to retrieve. + :arg _source_excludes: Specify the source fields you want to + exclude. + :arg _source_includes: Specify the source fields you want to + retrieve. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg if_primary_term: Only perform the operation if the document + has this primary term. + :arg if_seq_no: Only perform the operation if the document has + this sequence number. + :arg lang: The script language. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If 'true', Opensearch refreshes the affected + shards to make this operationvisible to search, if 'wait_for' then wait + for a refresh to make this operationvisible to search, if 'false' do + nothing with refreshes. Valid choices are true, false, wait_for. + :arg require_alias: If true, the destination must be an index + alias. :arg retry_on_conflict: Specify how many times should the - operation be retried when a conflict occurs. Default is 0. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + operation be retried when a conflict occurs. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for dynamic mapping updates and + active shards.This guarantees Opensearch waits for at least the timeout + before failing.The actual wait time could be longer, particularly when + multiple waits occur. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operations.Set to 'all' or any + positive integer up to the total number of shards in the + index(number_of_replicas+1). Defaults to 1 meaning the primary shard. + Valid choices are all, index-setting. """ for param in (index, id, body): if param in SKIP_IN_PATH: @@ -1995,13 +2676,17 @@ def update( "conflicts", "default_operator", "df", + "error_trace", "expand_wildcards", + "filter_path", "from_", + "human", "ignore_unavailable", "lenient", "max_docs", "pipeline", "preference", + "pretty", "q", "refresh", "request_cache", @@ -2014,6 +2699,7 @@ def update( "size", "slices", "sort", + "source", "stats", "terminate_after", "timeout", @@ -2033,8 +2719,9 @@ def update_by_query( for example to pick up a mapping change. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + :arg index: Comma-separated list of data streams, indices, and + aliases to search. Supports wildcards (`*`). To search all data streams + or indices, omit this parameter or use `*` or `_all`. :arg body: The search definition using the Query DSL :arg _source: True or false to return the _source field or not, or a list of fields to return. @@ -2042,68 +2729,89 @@ def update_by_query( returned _source field. :arg _source_includes: List of fields to extract and return from the _source field. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. - :arg conflicts: What to do when the operation encounters version - conflicts?. Valid choices are abort, proceed. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices.For example, a request targeting `foo*,bar*` + returns an error if an index starts with `foo` but no index starts with + `bar`. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed. + :arg analyzer: Analyzer to use for the query string. + :arg conflicts: What to do if update by query hits version + conflicts: `abort` or `proceed`. Valid choices are abort, proceed. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg from_: Starting offset. Default is 0. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg max_docs: Maximum number of documents to process (default: - all documents). - :arg pipeline: The pipeline id to preprocess incoming documents - with. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. + query: `AND` or `OR`. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg from_: Starting offset (default: 0) + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg max_docs: Maximum number of documents to process.Defaults + to all documents. + :arg pipeline: ID of the pipeline to use to preprocess incoming + documents.If the index has a default ingest pipeline specified, then + setting the value to `_none` disables the default ingest pipeline for + this request.If a final pipeline is configured it will always run, + regardless of the value of this parameter. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg refresh: Should the affected indexes be refreshed?. - :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting. + :arg refresh: If `true`, Opensearch refreshes affected shards to + make the operation visible to search. + :arg request_cache: If `true`, the request cache is used for + this request. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. Default is 0. - :arg routing: Comma-separated list of specific routing values. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. - :arg scroll_size: Size on the scroll request powering the - operation. Default is 100. + requests per second. + :arg routing: Custom value used to route operations to a + specific shard. + :arg scroll: Period to retain the search context for scrolling. + :arg scroll_size: Size of the scroll request that powers the + operation. :arg search_timeout: Explicit timeout for each search request. - Defaults to no timeout. - :arg search_type: Search operation type. Valid choices are + :arg search_type: The type of the search operation. Available + options: `query_then_fetch`, `dfs_query_then_fetch`. Valid choices are query_then_fetch, dfs_query_then_fetch. :arg size: Deprecated, please use `max_docs` instead. :arg slices: The number of slices this task should be divided - into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default is 1. - :arg sort: Comma-separated list of : pairs. - :arg stats: Specific 'tag' of the request for logging and + into. Valid choices are auto. + :arg sort: A comma-separated list of : pairs. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stats: Specific `tag` of the request for logging and statistical purposes. - :arg terminate_after: The maximum number of documents to collect - for each shard, upon reaching which the query execution will terminate - early. - :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default is 1m. - :arg version: Whether to return document version as part of a - hit. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is True. + :arg terminate_after: Maximum number of documents to collect for + each shard.If a query reaches this limit, Opensearch terminates the + query early.Opensearch collects documents before sorting.Use with + caution.Opensearch applies this parameter to each shard handling the + request.When possible, let Opensearch perform early termination + automatically.Avoid specifying this parameter for requests that target + data streams with backing indices across multiple data tiers. + :arg timeout: Period each update request waits for the following + operations: dynamic mapping updates, waiting for active shards. + :arg version: If `true`, returns the document version as part of + a hit. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. + :arg wait_for_completion: If `true`, the request blocks until + the operation is complete. """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: @@ -2120,7 +2828,9 @@ def update_by_query( body=body, ) - @query_params("requests_per_second") + @query_params( + "error_trace", "filter_path", "human", "pretty", "requests_per_second", "source" + ) def update_by_query_rethrottle( self, task_id: Any, @@ -2132,9 +2842,19 @@ def update_by_query_rethrottle( operation. - :arg task_id: The task id to rethrottle. + :arg task_id: The ID for the task. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. + requests per second. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -2146,7 +2866,7 @@ def update_by_query_rethrottle( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_script_context( self, params: Any = None, @@ -2155,12 +2875,23 @@ def get_script_context( """ Returns all script contexts. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_script_context", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_script_languages( self, params: Any = None, @@ -2169,6 +2900,17 @@ def get_script_languages( """ Returns available script types, languages and contexts. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_script_language", params=params, headers=headers @@ -2176,10 +2918,15 @@ def get_script_languages( @query_params( "allow_partial_pit_creation", + "error_trace", "expand_wildcards", + "filter_path", + "human", "keep_alive", "preference", + "pretty", "routing", + "source", ) def create_pit( self, @@ -2195,13 +2942,23 @@ def create_pit( string to perform the operation on all indices. :arg allow_partial_pit_creation: Allow if point in time can be created with partial failures. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg keep_alive: Specify the keep alive for point in time. :arg preference: Specify the node or shard the operation should be performed on. Default is random. + :arg pretty: Whether to pretty format the returned JSON + response. :arg routing: Comma-separated list of specific routing values. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -2213,7 +2970,7 @@ def create_pit( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_all_pits( self, params: Any = None, @@ -2222,12 +2979,23 @@ def delete_all_pits( """ Deletes all active point in time searches. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "DELETE", "/_search/point_in_time/_all", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_pit( self, body: Any = None, @@ -2239,6 +3007,16 @@ def delete_pit( :arg body: The point-in-time ids to be deleted + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "DELETE", @@ -2248,7 +3026,7 @@ def delete_pit( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_all_pits( self, params: Any = None, @@ -2257,6 +3035,17 @@ def get_all_pits( """ Lists all active point in time searches. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_search/point_in_time/_all", params=params, headers=headers diff --git a/opensearchpy/client/cat.py b/opensearchpy/client/cat.py index a18608130..e92741e6c 100644 --- a/opensearchpy/client/cat.py +++ b/opensearchpy/client/cat.py @@ -40,7 +40,20 @@ class CatClient(NamespacedClient): - @query_params("expand_wildcards", "format", "h", "help", "local", "s", "v") + @query_params( + "error_trace", + "expand_wildcards", + "filter_path", + "format", + "h", + "help", + "human", + "local", + "pretty", + "s", + "source", + "v", + ) def aliases( self, name: Any = None, @@ -52,25 +65,49 @@ def aliases( filter and routing infos. - :arg name: Comma-separated list of alias names. + :arg name: A comma-separated list of aliases to retrieve. + Supports wildcards (`*`). To retrieve all aliases, omit this parameter + or use `*` or `_all`. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "aliases", name), params=params, headers=headers ) - @query_params("bytes", "format", "h", "help", "s", "v") + @query_params( + "bytes", + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "v", + ) def all_pit_segments( self, params: Any = None, @@ -82,12 +119,22 @@ def all_pit_segments( :arg bytes: The unit in which to display byte values. Valid choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -97,12 +144,17 @@ def all_pit_segments( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) def allocation( @@ -116,23 +168,33 @@ def allocation( much disk space they are using. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg node_id: Comma-separated list of node identifiers or names + used to limit the returned information. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -144,12 +206,17 @@ def allocation( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) def cluster_manager( @@ -163,24 +230,45 @@ def cluster_manager( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", "/_cat/cluster_manager", params=params, headers=headers ) - @query_params("format", "h", "help", "s", "v") + @query_params( + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "v", + ) def count( self, index: Any = None, @@ -192,21 +280,44 @@ def count( individual indices. - :arg index: Comma-separated list of indices to limit the - returned information. + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "count", index), params=params, headers=headers ) - @query_params("bytes", "format", "h", "help", "s", "v") + @query_params( + "bytes", + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "v", + ) def fielddata( self, fields: Any = None, @@ -218,16 +329,26 @@ def fielddata( node in the cluster. - :arg fields: Comma-separated list of fields to return in the - output. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg fields: Comma-separated list of fields used to limit + returned information. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -237,7 +358,20 @@ def fielddata( headers=headers, ) - @query_params("format", "h", "help", "s", "time", "ts", "v") + @query_params( + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "time", + "ts", + "v", + ) def health( self, params: Any = None, @@ -247,22 +381,34 @@ def health( Returns a concise representation of the cluster health. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. - :arg ts: Set to false to disable timestamping. Default is True. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg time: The unit used to display time values. Valid choices + are nanos, micros, ms, s, m, h, d. + :arg ts: If true, returns `HH:MM:SS` and Unix epoch timestamps. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", "/_cat/health", params=params, headers=headers ) - @query_params("help", "s") + @query_params( + "error_trace", "filter_path", "help", "human", "pretty", "s", "source" + ) def help( self, params: Any = None, @@ -272,9 +418,19 @@ def help( Returns help for the Cat APIs. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_cat", params=params, headers=headers @@ -283,16 +439,21 @@ def help( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "format", "h", "health", "help", + "human", "include_unloaded_segments", "local", "master_timeout", + "pretty", "pri", "s", + "source", "time", "v", ) @@ -307,36 +468,45 @@ def indices( counts, disk size, ... - :arg index: Comma-separated list of indices to limit the - returned information. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: The type of index that wildcard patterns + can match. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg health: Health status ('green', 'yellow', or 'red') to - filter only indices matching the specified health status. Valid choices - are green, yellow, red. + :arg health: The health status used to limit returned indices. + By default, the response includes indices of any health status. Valid + choices are green, yellow, red. :arg help: Return help information. Default is false. - :arg include_unloaded_segments: If set to true segment stats - will include stats for segments that are not currently loaded into - memory. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg include_unloaded_segments: If true, the response includes + information from segments that are not loaded into memory. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. - :arg pri: Set to true to return stats only for primary shards. - Default is false. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg pri: If true, the response only includes information from + primary shards. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg time: The unit used to display time values. Valid choices + are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -345,12 +515,17 @@ def indices( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) def master( @@ -364,17 +539,27 @@ def master( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ from warnings import warn @@ -388,12 +573,17 @@ def master( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) def nodeattrs( @@ -407,17 +597,27 @@ def nodeattrs( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -427,13 +627,18 @@ def nodeattrs( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "full_id", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "time", "v", ) @@ -446,26 +651,35 @@ def nodes( Returns basic statistics about performance of cluster nodes. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. - :arg full_id: Return the full node ID instead of the shortened - version. Default is false. + :arg full_id: If `true`, return the full node ID. If `false`, + return the shortened node ID. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. - :arg local (Deprecated: This parameter does not cause this API - to act locally.): Return local information, do not retrieve the state + :arg human: Whether to return human readable values for + statistics. + :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -474,12 +688,17 @@ def nodes( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "time", "v", ) @@ -494,26 +713,48 @@ def pending_tasks( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", "/_cat/pending_tasks", params=params, headers=headers ) - @query_params("bytes", "format", "h", "help", "s", "v") + @query_params( + "bytes", + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "v", + ) def pit_segments( self, body: Any = None, @@ -526,12 +767,22 @@ def pit_segments( :arg bytes: The unit in which to display byte values. Valid choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -540,12 +791,17 @@ def pit_segments( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) def plugins( @@ -559,17 +815,27 @@ def plugins( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -577,7 +843,20 @@ def plugins( ) @query_params( - "active_only", "bytes", "detailed", "format", "h", "help", "s", "time", "v" + "active_only", + "bytes", + "detailed", + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "time", + "v", ) def recovery( self, @@ -592,19 +871,29 @@ def recovery( :arg index: Comma-separated list or wildcard expression of index names to limit the returned information. :arg active_only: If `true`, the response only includes ongoing - shard recoveries. Default is false. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + shard recoveries. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg detailed: If `true`, the response includes detailed - information about shard recoveries. Default is false. + information about shard recoveries. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -613,12 +902,17 @@ def recovery( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) def repositories( @@ -632,17 +926,27 @@ def repositories( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -655,14 +959,19 @@ def repositories( "bytes", "completed_only", "detailed", + "error_trace", "expand_wildcards", + "filter_path", "format", "h", "help", + "human", "ignore_throttled", "ignore_unavailable", + "pretty", "s", "shards", + "source", "time", "timeout", "v", @@ -691,22 +1000,32 @@ def segment_replication( latest completed segment replication events. Default is false. :arg detailed: If `true`, the response includes detailed information about segment replications. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg ignore_throttled: Whether specified concrete, expanded or aliased indices should be ignored when throttled. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. :arg shards: Comma-separated list of shards to display. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg timeout: Operation timeout. :arg v: Verbose mode. Display column headers. Default is false. """ @@ -720,11 +1039,16 @@ def segment_replication( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "master_timeout", + "pretty", "s", + "source", "v", ) def segments( @@ -737,21 +1061,32 @@ def segments( Provides low-level information about the segments in the shards of an index. - :arg index: Comma-separated list of indices to limit the - returned information. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg index: A comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -761,12 +1096,17 @@ def segments( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "time", "v", ) @@ -780,25 +1120,36 @@ def shards( Provides a detailed view of shard allocation on nodes. - :arg index: Comma-separated list of indices to limit the - returned information. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg index: A comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -807,13 +1158,18 @@ def shards( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", "size", + "source", "v", ) def thread_pool( @@ -827,22 +1183,32 @@ def thread_pool( queue and rejected statistics are returned for all thread pools. - :arg thread_pool_patterns: Comma-separated list of regular- - expressions to filter the thread pools in the output. + :arg thread_pool_patterns: A comma-separated list of thread pool + names used to limit the request. Accepts wildcard expressions. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. :arg size: The multiplier in which to display values. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -854,12 +1220,17 @@ def thread_pool( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "ignore_unavailable", "master_timeout", + "pretty", "s", + "source", "time", "v", ) @@ -873,23 +1244,35 @@ def snapshots( Returns all snapshots in a specific repository. - :arg repository: Comma-separated list of repository names. + :arg repository: A comma-separated list of snapshot repositories + used to limit the request. Accepts wildcard expressions. `_all` returns + all repositories. If any repository fails during the request, Opensearch + returns an error. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). Default is - false. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `true`, the response does not + include information from unavailable snapshots. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -902,12 +1285,17 @@ def snapshots( @query_params( "actions", "detailed", + "error_trace", + "filter_path", "format", "h", "help", + "human", "nodes", "parent_task_id", + "pretty", "s", + "source", "time", "v", ) @@ -921,24 +1309,34 @@ def tasks( the cluster. - :arg actions: Comma-separated list of actions that should be - returned. Leave empty to return all. - :arg detailed: Return detailed task information. Default is - false. + :arg actions: The task action names, which are used to limit the + response. + :arg detailed: If `true`, the response includes detailed + information about shard recoveries. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg nodes: Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. - :arg parent_task_id: Return tasks with specified parent task id - (node_id:task_number). Set to -1 to return all. + :arg parent_task_id: The parent task identifier, which is used + to limit the response. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -947,12 +1345,17 @@ def tasks( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) def templates( @@ -965,20 +1368,31 @@ def templates( Returns information about existing templates. - :arg name: The name of the template. + :arg name: The name of the template to return. Accepts wildcard + expressions. If omitted, all templates are returned. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( diff --git a/opensearchpy/client/cluster.py b/opensearchpy/client/cluster.py index fc49f2664..4bca05290 100644 --- a/opensearchpy/client/cluster.py +++ b/opensearchpy/client/cluster.py @@ -43,10 +43,15 @@ class ClusterClient(NamespacedClient): @query_params( "awareness_attribute", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "level", "local", "master_timeout", + "pretty", + "source", "timeout", "wait_for_active_shards", "wait_for_events", @@ -65,36 +70,63 @@ def health( Returns basic information about the health of the cluster. - :arg index: Limit the information returned to specific indicies. + :arg index: Comma-separated list of data streams, indices, and + index aliases used to limit the request. Wildcard expressions (*) are + supported. To target all data streams and indices in a cluster, omit + this parameter or use `_all` or `*`. :arg awareness_attribute: The awareness attribute for which the health is required. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. - :arg level: Specify the level of detail for returned - information. Valid choices are cluster, indices, shards, - awareness_attributes. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg level: Can be one of cluster, indices or shards. Controls + the details level of the health information returned. Valid choices are + cluster, indices, shards, awareness_attributes. + :arg local: If true, the request retrieves information from the + local node only. Defaults to false, which means information is retrieved + from the master node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Wait until the specified number of - shards is active. - :arg wait_for_events: Wait until all currently queued events - with the given priority are processed. Valid choices are immediate, - urgent, high, normal, low, languid. - :arg wait_for_no_initializing_shards: Whether to wait until - there are no initializing shards in the cluster. - :arg wait_for_no_relocating_shards: Whether to wait until there - are no relocating shards in the cluster. - :arg wait_for_nodes: Wait until the specified number of nodes is - available. - :arg wait_for_status: Wait until cluster is in a specific state. - Valid choices are green, yellow, red. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: A number controlling to how many + active shards to wait for, all to wait for all shards in the cluster to + be active, or 0 to not wait. Valid choices are all, index-setting. + :arg wait_for_events: Can be one of immediate, urgent, high, + normal, low, languid. Wait until all currently queued events with the + given priority are processed. Valid choices are immediate, urgent, high, + normal, low, languid. + :arg wait_for_no_initializing_shards: A boolean value which + controls whether to wait (until the timeout provided) for the cluster to + have no shard initializations. Defaults to false, which means it will + not wait for initializing shards. + :arg wait_for_no_relocating_shards: A boolean value which + controls whether to wait (until the timeout provided) for the cluster to + have no shard relocations. Defaults to false, which means it will not + wait for relocating shards. + :arg wait_for_nodes: The request waits until the specified + number N of nodes is available. It also accepts >=N, <=N, >N and yellow > red. By default, will + not wait for any status. Valid choices are green, yellow, red. """ return self.transport.perform_request( "GET", @@ -103,7 +135,16 @@ def health( headers=headers, ) - @query_params("cluster_manager_timeout", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) def pending_tasks( self, params: Any = None, @@ -116,11 +157,23 @@ def pending_tasks( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg local: If `true`, the request retrieves information from + the local node only.If `false`, information is retrieved from the master + node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_cluster/pending_tasks", params=params, headers=headers @@ -129,11 +182,16 @@ def pending_tasks( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "local", "master_timeout", + "pretty", + "source", "wait_for_metadata_version", "wait_for_timeout", ) @@ -149,31 +207,40 @@ def state( :arg metric: Limit the information returned to the specified - metrics. Valid choices are _all, blocks, metadata, nodes, routing_table, - routing_nodes, master_node, cluster_manager_node, version. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + metrics + :arg index: A comma-separated list of index names; use `_all` or + empty string to perform the operation on all indices :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + string or when no indices have been specified) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: Return settings in flat format (default: + false) + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + should be ignored when unavailable (missing or closed) :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + from cluster-manager node (default: false) :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_metadata_version: Wait for the metadata version to - be equal or greater than the specified metadata version. + be equal or greater than the specified metadata version :arg wait_for_timeout: The maximum time to wait for - wait_for_metadata_version before timing out. + wait_for_metadata_version before timing out """ if index and metric in SKIP_IN_PATH: metric = "_all" @@ -185,7 +252,15 @@ def state( headers=headers, ) - @query_params("flat_settings", "timeout") + @query_params( + "error_trace", + "filter_path", + "flat_settings", + "human", + "pretty", + "source", + "timeout", + ) def stats( self, node_id: Any = None, @@ -196,19 +271,31 @@ def stats( Returns high-level overview of cluster statistics. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg timeout: Operation timeout. + :arg node_id: Comma-separated list of node filters used to limit + returned information. Defaults to all nodes in the cluster. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for each node to respond.If a node + does not respond before its timeout expires, the response does not + include its stats.However, timed out nodes are included in the + response’s `_nodes.failed` property. Defaults to no timeout. """ return self.transport.perform_request( "GET", - "/_cluster/stats" - if node_id in SKIP_IN_PATH - else _make_path("_cluster", "stats", "nodes", node_id), + ( + "/_cluster/stats" + if node_id in SKIP_IN_PATH + else _make_path("_cluster", "stats", "nodes", node_id) + ), params=params, headers=headers, ) @@ -216,10 +303,15 @@ def stats( @query_params( "cluster_manager_timeout", "dry_run", + "error_trace", "explain", + "filter_path", + "human", "master_timeout", "metric", + "pretty", "retry_failed", + "source", "timeout", ) def reroute( @@ -236,18 +328,31 @@ def reroute( `cancel`, `allocate`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg dry_run: Simulate the operation only and return the - resulting state. - :arg explain: Return an explanation of why the commands can or - cannot be executed. + :arg dry_run: If true, then the request simulates the operation + only and returns the resulting state. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg explain: If true, then the response contains an explanation + of why the commands can or cannot be executed. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg metric: Limit the information returned to the specified - metrics. Defaults to all but metadata. - :arg retry_failed: Retries allocation of shards that are blocked - due to too many subsequent allocation failures. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg metric: Limits the information returned to the specified + metrics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg retry_failed: If true, then retries allocation of shards + that are blocked due to too many subsequent allocation failures. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ return self.transport.perform_request( "POST", "/_cluster/reroute", params=params, headers=headers, body=body @@ -255,9 +360,14 @@ def reroute( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "flat_settings", + "human", "include_defaults", "master_timeout", + "pretty", + "source", "timeout", ) def get_settings( @@ -271,21 +381,41 @@ def get_settings( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg include_defaults: Whether to return all default clusters - setting. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg include_defaults: If `true`, returns default cluster + settings from the local node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ return self.transport.perform_request( "GET", "/_cluster/settings", params=params, headers=headers ) @query_params( - "cluster_manager_timeout", "flat_settings", "master_timeout", "timeout" + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "master_timeout", + "pretty", + "source", + "timeout", ) def put_settings( self, @@ -301,12 +431,22 @@ def put_settings( or `persistent` (survives cluster restart). :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: Return settings in flat format (default: + false) + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -315,7 +455,7 @@ def put_settings( "PUT", "/_cluster/settings", params=params, headers=headers, body=body ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def remote_info( self, params: Any = None, @@ -324,12 +464,31 @@ def remote_info( """ Returns the information about configured remote clusters. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_remote/info", params=params, headers=headers ) - @query_params("include_disk_info", "include_yes_decisions") + @query_params( + "error_trace", + "filter_path", + "human", + "include_disk_info", + "include_yes_decisions", + "pretty", + "source", + ) def allocation_explain( self, body: Any = None, @@ -342,10 +501,20 @@ def allocation_explain( :arg body: The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' - :arg include_disk_info: Return information about disk usage and - shard sizes. Default is false. - :arg include_yes_decisions: Return 'YES' decisions in - explanation. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg include_disk_info: If true, returns information about disk + usage and shard sizes. + :arg include_yes_decisions: If true, returns YES decisions in + explanation. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", @@ -355,7 +524,16 @@ def allocation_explain( body=body, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def delete_component_template( self, name: Any, @@ -366,13 +544,27 @@ def delete_component_template( Deletes a component template. - :arg name: The name of the template. + :arg name: Name of the component template to delete. Wildcard + (*) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -384,7 +576,16 @@ def delete_component_template( headers=headers, ) - @query_params("cluster_manager_timeout", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) def get_component_template( self, name: Any = None, @@ -395,14 +596,27 @@ def get_component_template( Returns one or more component templates. - :arg name: The Comma-separated names of the component templates. + :arg name: Name of the component template to retrieve. Wildcard + (`*`) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg local: If `true`, the request retrieves information from + the local node only.If `false`, information is retrieved from the master + node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", @@ -411,7 +625,17 @@ def get_component_template( headers=headers, ) - @query_params("cluster_manager_timeout", "create", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def put_component_template( self, name: Any, @@ -423,15 +647,35 @@ def put_component_template( Creates or updates a component template. - :arg name: The name of the template. + :arg name: Name of the component template to create. Opensearch + includes the following built-in component templates: `logs-mappings`; + 'logs-settings`; `metrics-mappings`; `metrics-settings`;`synthetics- + mapping`; `synthetics-settings`. Opensearch Agent uses these templates + to configure backing indices for its data streams. If you use Opensearch + Agent and want to overwrite one of these templates, set the `version` + for your replacement template higher than the current version. If you + don’t use Opensearch Agent and want to disable all built-in component + and index templates, set `stack.templates.enabled` to `false` using the + cluster update settings API. :arg body: The template definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template should only be added if - new or can also replace an existing one. Default is false. + :arg create: If `true`, this request cannot replace or update + existing component templates. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg timeout: Operation timeout. """ for param in (name, body): @@ -446,7 +690,16 @@ def put_component_template( body=body, ) - @query_params("cluster_manager_timeout", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) def exists_component_template( self, name: Any, @@ -457,14 +710,27 @@ def exists_component_template( Returns information about whether a particular component template exist. - :arg name: The name of the template. + :arg name: Name of the component template to check existence of. + Wildcard (*) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg local: If true, the request retrieves information from the + local node only.Defaults to false, which means information is retrieved + from the master node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response isreceived before the timeout + expires, the request fails and returns anerror. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -476,7 +742,9 @@ def exists_component_template( headers=headers, ) - @query_params("wait_for_removal") + @query_params( + "error_trace", "filter_path", "human", "pretty", "source", "wait_for_removal" + ) def delete_voting_config_exclusions( self, params: Any = None, @@ -486,9 +754,22 @@ def delete_voting_config_exclusions( Clears cluster voting config exclusions. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_removal: Specifies whether to wait for all - excluded nodes to be removed from the cluster before clearing the voting - configuration exclusions list. Default is True. + excluded nodes to be removed from thecluster before clearing the voting + configuration exclusions list.Defaults to true, meaning that all + excluded nodes must be removed fromthe cluster before this API takes any + action. If set to false then thevoting configuration exclusions list is + cleared even if some excludednodes are still in the cluster. """ return self.transport.perform_request( "DELETE", @@ -497,7 +778,16 @@ def delete_voting_config_exclusions( headers=headers, ) - @query_params("node_ids", "node_names", "timeout") + @query_params( + "error_trace", + "filter_path", + "human", + "node_ids", + "node_names", + "pretty", + "source", + "timeout", + ) def post_voting_config_exclusions( self, params: Any = None, @@ -507,19 +797,33 @@ def post_voting_config_exclusions( Updates the cluster voting config exclusions by node ids or node names. - :arg node_ids: Comma-separated list of the persistent ids of the - nodes to exclude from the voting configuration. If specified, you may - not also specify ?node_names. - :arg node_names: Comma-separated list of the names of the nodes - to exclude from the voting configuration. If specified, you may not also - specify ?node_ids. - :arg timeout: Operation timeout. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg node_ids: A comma-separated list of the persistent ids of + the nodes to excludefrom the voting configuration. If specified, you may + not also specify node_names. + :arg node_names: A comma-separated list of the names of the + nodes to exclude from thevoting configuration. If specified, you may not + also specify node_ids. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: When adding a voting configuration exclusion, the + API waits for thespecified nodes to be excluded from the voting + configuration beforereturning. If the timeout expires before the + appropriate conditionis satisfied, the request fails and returns an + error. """ return self.transport.perform_request( "POST", "/_cluster/voting_config_exclusions", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_decommission_awareness( self, params: Any = None, @@ -528,15 +832,23 @@ def delete_decommission_awareness( """ Delete any existing decommission. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( - "DELETE", - "/_cluster/decommission/awareness/", - params=params, - headers=headers, + "DELETE", "/_cluster/decommission/awareness", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_weighted_routing( self, params: Any = None, @@ -545,6 +857,17 @@ def delete_weighted_routing( """ Delete weighted shard routing weights. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "DELETE", @@ -553,7 +876,7 @@ def delete_weighted_routing( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_decommission_awareness( self, awareness_attribute_name: Any, @@ -565,6 +888,16 @@ def get_decommission_awareness( :arg awareness_attribute_name: Awareness attribute name. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if awareness_attribute_name in SKIP_IN_PATH: raise ValueError( @@ -584,7 +917,7 @@ def get_decommission_awareness( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_weighted_routing( self, attribute: Any, @@ -596,6 +929,16 @@ def get_weighted_routing( :arg attribute: Awareness attribute name. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if attribute in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'attribute'.") @@ -607,7 +950,7 @@ def get_weighted_routing( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def put_decommission_awareness( self, awareness_attribute_name: Any, @@ -621,6 +964,16 @@ def put_decommission_awareness( :arg awareness_attribute_name: Awareness attribute name. :arg awareness_attribute_value: Awareness attribute value. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (awareness_attribute_name, awareness_attribute_value): if param in SKIP_IN_PATH: @@ -639,7 +992,7 @@ def put_decommission_awareness( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def put_weighted_routing( self, attribute: Any, @@ -651,6 +1004,16 @@ def put_weighted_routing( :arg attribute: Awareness attribute name. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if attribute in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'attribute'.") diff --git a/opensearchpy/client/dangling_indices.py b/opensearchpy/client/dangling_indices.py index e6184e9a3..bee5c3f14 100644 --- a/opensearchpy/client/dangling_indices.py +++ b/opensearchpy/client/dangling_indices.py @@ -41,7 +41,15 @@ class DanglingIndicesClient(NamespacedClient): @query_params( - "accept_data_loss", "cluster_manager_timeout", "master_timeout", "timeout" + "accept_data_loss", + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", ) def delete_dangling_index( self, @@ -53,15 +61,25 @@ def delete_dangling_index( Deletes the specified dangling index. - :arg index_uuid: The UUID of the dangling index. + :arg index_uuid: The UUID of the dangling index :arg accept_data_loss: Must be set to true in order to delete - the dangling index. + the dangling index :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if index_uuid in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index_uuid'.") @@ -74,7 +92,15 @@ def delete_dangling_index( ) @query_params( - "accept_data_loss", "cluster_manager_timeout", "master_timeout", "timeout" + "accept_data_loss", + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", ) def import_dangling_index( self, @@ -86,15 +112,25 @@ def import_dangling_index( Imports the specified dangling index. - :arg index_uuid: The UUID of the dangling index. + :arg index_uuid: The UUID of the dangling index :arg accept_data_loss: Must be set to true in order to import - the dangling index. + the dangling index :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if index_uuid in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index_uuid'.") @@ -103,7 +139,7 @@ def import_dangling_index( "POST", _make_path("_dangling", index_uuid), params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def list_dangling_indices( self, params: Any = None, @@ -112,6 +148,17 @@ def list_dangling_indices( """ Returns all dangling indices. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_dangling", params=params, headers=headers diff --git a/opensearchpy/client/indices.py b/opensearchpy/client/indices.py index ef2eba819..2dec6548b 100644 --- a/opensearchpy/client/indices.py +++ b/opensearchpy/client/indices.py @@ -40,7 +40,7 @@ class IndicesClient(NamespacedClient): - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def analyze( self, body: Any = None, @@ -56,6 +56,16 @@ def analyze( :arg body: Define analyzer/tokenizer parameters and the text on which the analysis should be performed :arg index: The name of the index to scope the operation. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", @@ -65,7 +75,16 @@ def analyze( body=body, ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") + @query_params( + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "source", + ) def refresh( self, index: Any = None, @@ -76,16 +95,30 @@ def refresh( Performs the refresh operation in one or more indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", _make_path(index, "_refresh"), params=params, headers=headers @@ -93,9 +126,14 @@ def refresh( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", "force", + "human", "ignore_unavailable", + "pretty", + "source", "wait_if_ongoing", ) def flush( @@ -108,32 +146,51 @@ def flush( Performs the flush operation on one or more indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg force: Whether a flush should be forced even if it is not - necessarily needed ie. if no changes will be committed to the index. - This is useful if transaction log IDs should be incremented even if no - uncommitted changes are present. (This setting can be considered as - internal). - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg wait_if_ongoing: If set to true the flush operation will - block until the flush can be executed if another flush operation is - already executing. If set to false the flush will be skipped iff if - another flush operation is already running. Default is True. + :arg index: Comma-separated list of data streams, indices, and + aliases to flush. Supports wildcards (`*`). To flush all data streams + and indices, omit this parameter or use `*` or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg force: If `true`, the request forces a flush even if there + are no changes to commit to the index. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg wait_if_ongoing: If `true`, the flush operation blocks + until execution when another flush operation is running.If `false`, + Opensearch returns an error if you request a flush when another flush + operation is running. """ return self.transport.perform_request( "POST", _make_path(index, "_flush"), params=params, headers=headers ) @query_params( - "cluster_manager_timeout", "master_timeout", "timeout", "wait_for_active_shards" + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + "wait_for_active_shards", ) def create( self, @@ -146,17 +203,32 @@ def create( Creates an index with optional settings and mappings. - :arg index: Index name. + :arg index: Name of the index you wish to create. :arg body: The configuration for the index (`settings` and `mappings`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for before the operation returns. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation. Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -167,7 +239,12 @@ def create( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", "master_timeout", + "pretty", + "source", "task_execution_timeout", "timeout", "wait_for_active_shards", @@ -185,20 +262,35 @@ def clone( Clones an index. - :arg index: The name of the source index to clone. - :arg target: The name of the target index. + :arg index: Name of the source index to clone. + :arg target: Name of the target index to create. :arg body: The configuration for the target index (`settings` and `aliases`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg task_execution_timeout: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for on the cloned index before the operation returns. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -217,12 +309,17 @@ def clone( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "include_defaults", "local", "master_timeout", + "pretty", + "source", ) def get( self, @@ -234,27 +331,43 @@ def get( Returns information about one or more indices. - :arg index: Comma-separated list of indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). Default is false. + :arg index: Comma-separated list of data streams, indices, and + index aliases used to limit the request. Wildcard expressions (*) are + supported. + :arg allow_no_indices: If false, the request returns an error if + any wildcard expression, index alias, or _all value targets onlymissing + or closed indices. This behavior applies even if the request targets + other open indices. For example,a request targeting foo*,bar* returns an + error if an index starts with foo but no index starts with bar. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). Default is - false. - :arg include_defaults: Whether to return all default setting for - each of the indices. Default is false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard expressions + can match. If the request can target data streams, this + argumentdetermines whether wildcard expressions match hidden data + streams. Supports comma-separated values,such as open,hidden. Valid + choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If true, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If false, requests that target a + missing index return an error. + :arg include_defaults: If true, return all default settings in + the response. + :arg local: If true, the request retrieves information from the + local node only. Defaults to false, which means information is retrieved + from the master node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -266,9 +379,14 @@ def get( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "task_execution_timeout", "timeout", "wait_for_active_shards", @@ -284,25 +402,49 @@ def open( Opens an index. - :arg index: Comma-separated list of indices to open. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). By default, + you must explicitly name the indices you using to limit the request. To + limit a request using `_all`, `*`, or other wildcard expressions, change + the `action.destructive_requires_name` setting to false. You can update + this setting in the `opensearch.yml` file or using the cluster update + settings API. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg task_execution_timeout: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Sets the number of active shards to - wait for before the operation returns. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -316,9 +458,14 @@ def open( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "timeout", "wait_for_active_shards", ) @@ -332,23 +479,42 @@ def close( Closes an index. - :arg index: Comma-separated list of indices to close. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg index: Comma-separated list or wildcard expression of index + names used to limit the request. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Sets the number of active shards to - wait for before the operation returns. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -360,9 +526,14 @@ def close( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "timeout", ) def delete( @@ -375,23 +546,40 @@ def delete( Deletes an index. - :arg index: Comma-separated list of indices to delete; use - `_all` or `*` string to delete all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). Default is false. + :arg index: Comma-separated list of indices to delete. You + cannot specify index aliases. By default, this parameter does not + support wildcards (`*`) or `_all`. To use wildcards or `_all`, set the + `action.destructive_requires_name` cluster setting to `false`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). Default is - false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -402,11 +590,16 @@ def delete( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "include_defaults", "local", + "pretty", + "source", ) def exists( self, @@ -418,22 +611,34 @@ def exists( Returns information about whether a particular index exists. - :arg index: Comma-separated list of indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). Default is false. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). Default is - false. - :arg include_defaults: Whether to return all default setting for - each of the indices. Default is false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg index: Comma-separated list of data streams, indices, and + aliases. Supports wildcards (`*`). + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg include_defaults: If `true`, return all default settings in + the response. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -445,9 +650,14 @@ def exists( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "timeout", "write_index_only", ) @@ -465,22 +675,38 @@ def put_mapping( :arg body: The mapping definition :arg index: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg write_index_only: When true, applies mappings only to the - write index of an alias or data stream. Default is false. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg write_index_only: If `true`, the mappings are applied only + to the current write index for the target. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -499,10 +725,15 @@ def put_mapping( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "local", "master_timeout", + "pretty", + "source", ) def get_mapping( self, @@ -514,23 +745,38 @@ def get_mapping( Returns mappings for one or more indices. - :arg index: Comma-separated list of indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg local (Deprecated: This parameter is a no-op and field - mappings are always retrieved locally.): Return local information, do - not retrieve the state from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg local: If `true`, the request retrieves information from + the local node only. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path(index, "_mapping"), params=params, headers=headers @@ -538,10 +784,15 @@ def get_mapping( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "include_defaults", "local", + "pretty", + "source", ) def get_field_mapping( self, @@ -554,20 +805,36 @@ def get_field_mapping( Returns mapping for one or more fields. - :arg fields: Comma-separated list of fields. - :arg index: Comma-separated list of indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg include_defaults: Whether the default mapping values should - be returned as well. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg fields: Comma-separated list or wildcard expression of + fields used to limit returned information. + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg include_defaults: If `true`, return all default settings in + the response. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if fields in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'fields'.") @@ -579,7 +846,16 @@ def get_field_mapping( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def put_alias( self, index: Any, @@ -592,17 +868,32 @@ def put_alias( Creates or updates an alias. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg name: The name of the alias to be created or updated. + :arg index: Comma-separated list of data streams or indices to + add. Supports wildcards (`*`). Wildcard patterns that match both data + streams and indices return an error. + :arg name: Alias to update. If the alias doesn’t exist, the + request creates it. Index alias names support date math. :arg body: The settings for the alias, such as `routing` or `filter` :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ for param in (index, name): if param in SKIP_IN_PATH: @@ -616,7 +907,17 @@ def put_alias( body=body, ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable", "local") + @query_params( + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "local", + "pretty", + "source", + ) def exists_alias( self, name: Any, @@ -628,18 +929,35 @@ def exists_alias( Returns information about whether a particular alias exists. - :arg name: Comma-separated list of alias names. - :arg index: Comma-separated list of indices to filter aliases. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg name: Comma-separated list of aliases to check. Supports + wildcards (`*`). + :arg index: Comma-separated list of data streams or indices used + to limit the request. Supports wildcards (`*`). To target all data + streams and indices, omit this parameter or use `*` or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, requests that include a + missing data stream or index in the target indices or data streams + return an error. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -648,7 +966,17 @@ def exists_alias( "HEAD", _make_path(index, "_alias", name), params=params, headers=headers ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable", "local") + @query_params( + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "local", + "pretty", + "source", + ) def get_alias( self, index: Any = None, @@ -660,24 +988,50 @@ def get_alias( Returns an alias. - :arg index: Comma-separated list of indices to filter aliases. - :arg name: Comma-separated list of alias names. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg index: Comma-separated list of data streams or indices used + to limit the request. Supports wildcards (`*`). To target all data + streams and indices, omit this parameter or use `*` or `_all`. + :arg name: Comma-separated list of aliases to retrieve. Supports + wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` + or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path(index, "_alias", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def update_aliases( self, body: Any, @@ -691,10 +1045,23 @@ def update_aliases( :arg body: The definition of `actions` to perform :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -703,7 +1070,16 @@ def update_aliases( "POST", "/_aliases", params=params, headers=headers, body=body ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def delete_alias( self, index: Any, @@ -715,16 +1091,29 @@ def delete_alias( Deletes an alias. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg name: Comma-separated list of aliases to delete (supports - wildcards); use `_all` to delete all aliases for the specified indices. + :arg index: Comma-separated list of data streams or indices used + to limit the request. Supports wildcards (`*`). + :arg name: Comma-separated list of aliases to remove. Supports + wildcards (`*`). To remove all aliases, use `*` or `_all`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ for param in (index, name): if param in SKIP_IN_PATH: @@ -734,7 +1123,17 @@ def delete_alias( "DELETE", _make_path(index, "_alias", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "create", "master_timeout", "order") + @query_params( + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "order", + "pretty", + "source", + ) def put_template( self, name: Any, @@ -746,18 +1145,30 @@ def put_template( Creates or updates an index template. - :arg name: The name of the template. + :arg name: The name of the template :arg body: The template definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template should only be added if - new or can also replace an existing one. Default is false. + :arg create: If true, this request cannot replace or update + existing index templates. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg order: The order for this template when merging multiple - matching ones (higher numbers are merged later, overriding the lower - numbers). + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response isreceived before the timeout + expires, the request fails and returns an error. + :arg order: Order in which Opensearch applies this template if + indexmatches multiple templates.Templates with lower 'order' values are + merged first. Templates with higher'order' values are merged later, + overriding templates with lower values. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (name, body): if param in SKIP_IN_PATH: @@ -771,7 +1182,17 @@ def put_template( body=body, ) - @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) def exists_template( self, name: Any, @@ -782,16 +1203,26 @@ def exists_template( Returns information about whether a particular index template exists. - :arg name: Comma-separated names of the index templates. + :arg name: The comma separated names of the index templates :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: Return settings in flat format (default: + false) + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + from cluster-manager node (default: false) :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -800,7 +1231,17 @@ def exists_template( "HEAD", _make_path("_template", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) def get_template( self, name: Any = None, @@ -811,22 +1252,44 @@ def get_template( Returns an index template. - :arg name: Comma-separated names of the index templates. + :arg name: Comma-separated list of index template names used to + limit the request. Wildcard (`*`) expressions are supported. To return + all index templates, omit this parameter or use a value of `_all` or + `*`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg local: If `true`, the request retrieves information from + the local node only. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path("_template", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def delete_template( self, name: Any, @@ -837,13 +1300,27 @@ def delete_template( Deletes an index template. - :arg name: The name of the template. + :arg name: The name of the legacy index template to delete. + Wildcard (`*`) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -855,12 +1332,17 @@ def delete_template( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "include_defaults", "local", "master_timeout", + "pretty", + "source", ) def get_settings( self, @@ -873,28 +1355,46 @@ def get_settings( Returns settings for one or more indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg name: Comma-separated list of settings. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg name: Comma-separated list or wildcard expression of + settings to retrieve. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, indexalias, or `_all` value targets only + missing or closed indices. Thisbehavior applies even if the request + targets other open indices. Forexample, a request targeting `foo*,bar*` + returns an error if an indexstarts with foo but no index starts with + `bar`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg include_defaults: Whether to return all default setting for - each of the indices. Default is false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`. Valid choices are all, open, + closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg include_defaults: If `true`, return all default settings in + the response. + :arg local: If `true`, the request retrieves information from + the local node only. If`false`, information is retrieved from the master + node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response isreceived before the timeout + expires, the request fails and returns anerror. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path(index, "_settings", name), params=params, headers=headers @@ -903,11 +1403,16 @@ def get_settings( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "master_timeout", "preserve_existing", + "pretty", + "source", "timeout", ) def put_settings( @@ -921,28 +1426,44 @@ def put_settings( Updates the index settings. - :arg body: The index settings to be updated - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, indexalias, or `_all` value targets only + missing or closed indices. Thisbehavior applies even if the request + targets other open indices. Forexample, a request targeting `foo*,bar*` + returns an error if an indexstarts with `foo` but no index starts with + `bar`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match. If the request can targetdata streams, this argument determines + whether wildcard expressions matchhidden data streams. Supports comma- + separated values, such as`open,hidden`. Valid choices are all, open, + closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg preserve_existing: Whether to update existing settings. If - set to `true` existing settings on an index remain unchanged. Default is - false. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response isreceived before the timeout + expires, the request fails and returns anerror. + :arg preserve_existing: If `true`, existing index settings + remain unchanged. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -957,14 +1478,19 @@ def put_settings( @query_params( "completion_fields", + "error_trace", "expand_wildcards", "fielddata_fields", "fields", + "filter_path", "forbid_closed_indices", "groups", + "human", "include_segment_file_sizes", "include_unloaded_segments", "level", + "pretty", + "source", ) def stats( self, @@ -977,41 +1503,58 @@ def stats( Provides statistics on operations happening in an index. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + :arg index: A comma-separated list of index names; use `_all` or + empty string to perform the operation on all indices :arg metric: Limit the information returned the specific - metrics. Valid choices are _all, store, indexing, get, search, merge, - flush, refresh, query_cache, fielddata, docs, warmer, completion, - segments, translog, suggest, request_cache, recovery. - :arg completion_fields: Comma-separated list of fields for - `fielddata` and `suggest` index metric (supports wildcards). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg fielddata_fields: Comma-separated list of fields for - `fielddata` index metric (supports wildcards). - :arg fields: Comma-separated list of fields for `fielddata` and - `completion` index metric (supports wildcards). - :arg forbid_closed_indices: If set to false stats will also - collected from closed indices if explicitly specified or if - expand_wildcards expands to closed indices. Default is True. - :arg groups: Comma-separated list of search groups for `search` - index metric. - :arg include_segment_file_sizes: Whether to report the + metrics. + :arg completion_fields: Comma-separated list or wildcard + expressions of fields to include in fielddata and suggest statistics. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match. If the request can target data streams, this argumentdetermines + whether wildcard expressions match hidden data streams. Supports comma- + separated values,such as `open,hidden`. Valid choices are all, open, + closed, hidden, none. + :arg fielddata_fields: Comma-separated list or wildcard + expressions of fields to include in fielddata statistics. + :arg fields: Comma-separated list or wildcard expressions of + fields to include in the statistics. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg forbid_closed_indices: If true, statistics are not + collected from closed indices. + :arg groups: Comma-separated list of search groups to include in + the search statistics. + :arg human: Whether to return human readable values for + statistics. + :arg include_segment_file_sizes: If true, the call reports the aggregated disk usage of each one of the Lucene index files (only - applies if segment stats are requested). Default is false. - :arg include_unloaded_segments: If set to true segment stats - will include stats for segments that are not currently loaded into - memory. Default is false. - :arg level: Return stats aggregated at cluster, index or shard - level. Valid choices are cluster, indices, shards. + applies if segment stats are requested). + :arg include_unloaded_segments: If true, the response includes + information from segments that are not loaded into memory. + :arg level: Indicates whether statistics are aggregated at the + cluster, index, or shard level. Valid choices are cluster, indices, + shards. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path(index, "_stats", metric), params=params, headers=headers ) @query_params( - "allow_no_indices", "expand_wildcards", "ignore_unavailable", "verbose" + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "source", + "verbose", ) def segments( self, @@ -1023,18 +1566,31 @@ def segments( Provides low-level information about segments in a Lucene index. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg verbose: Includes detailed memory usage by Lucene. Default - is false. + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg verbose: If `true`, the request returns a verbose response. """ return self.transport.perform_request( "GET", _make_path(index, "_segments"), params=params, headers=headers @@ -1047,12 +1603,17 @@ def segments( "analyzer", "default_operator", "df", + "error_trace", "expand_wildcards", "explain", + "filter_path", + "human", "ignore_unavailable", "lenient", + "pretty", "q", "rewrite", + "source", ) def validate_query( self, @@ -1066,31 +1627,49 @@ def validate_query( :arg body: The query definition specified with the Query DSL - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg all_shards: Execute validation on all shards instead of one - random shard per index. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. + :arg index: Comma-separated list of data streams, indices, and + aliases to search. Supports wildcards (`*`). To search all data streams + or indices, omit this parameter or use `*` or `_all`. + :arg all_shards: If `true`, the validation is executed on all + shards instead of one random shard per index. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed. + :arg analyzer: Analyzer to use for the query string.This + parameter can only be used when the `q` query string parameter is + specified. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg explain: Return detailed information about the error. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. + query: `AND` or `OR`. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string.This parameter can only be used when the `q` query + string parameter is specified. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg explain: If `true`, the response returns detailed + information if an error has occurred. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg rewrite: Provide a more detailed explanation showing the - actual Lucene query that will be executed. + :arg rewrite: If `true`, returns a more detailed explanation + showing the actual Lucene query that will be executed. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", @@ -1102,12 +1681,17 @@ def validate_query( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", "fielddata", "fields", + "filter_path", + "human", "ignore_unavailable", + "pretty", "query", "request", + "source", ) def clear_cache( self, @@ -1121,25 +1705,47 @@ def clear_cache( :arg index: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg fielddata: Clear field data. - :arg fields: Comma-separated list of fields to clear when using - the `fielddata` parameter (default: all). - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg query: Clear query caches. - :arg request: Clear request cache. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, index alias, or `_all` value targets only + missing or closed indices.This behavior applies even if the request + targets other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg fielddata: If `true`, clears the fields cache.Use the + `fields` parameter to clear the cache of specific fields only. + :arg fields: Comma-separated list of field names used to limit + the `fielddata` parameter. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg query: If `true`, clears the query cache. + :arg request: If `true`, clears the request cache. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", _make_path(index, "_cache", "clear"), params=params, headers=headers ) - @query_params("active_only", "detailed") + @query_params( + "active_only", + "detailed", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + ) def recovery( self, index: Any = None, @@ -1150,12 +1756,23 @@ def recovery( Returns information about ongoing index shard recoveries. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg active_only: Display only those recoveries that are - currently on-going. Default is false. - :arg detailed: Whether to display detailed information about - shard recovery. Default is false. + :arg index: Comma-separated list of data streams, indices, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indices, omit this parameter or use `*` or `_all`. + :arg active_only: If `true`, the response only includes ongoing + shard recoveries. + :arg detailed: If `true`, the response includes detailed + information about shard recoveries. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path(index, "_recovery"), params=params, headers=headers @@ -1163,9 +1780,14 @@ def recovery( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "only_ancient_segments", + "pretty", + "source", "wait_for_completion", ) def upgrade( @@ -1183,13 +1805,23 @@ def upgrade( :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified). + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). :arg only_ancient_segments: If true, only ancient (an older Lucene major release) segments will be upgraded. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is false. """ @@ -1197,7 +1829,16 @@ def upgrade( "POST", _make_path(index, "_upgrade"), params=params, headers=headers ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") + @query_params( + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "source", + ) def get_upgrade( self, index: Any = None, @@ -1213,18 +1854,36 @@ def get_upgrade( :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified). + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path(index, "_upgrade"), params=params, headers=headers ) @query_params( - "allow_no_indices", "expand_wildcards", "ignore_unavailable", "status" + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "source", + "status", ) def shard_stores( self, @@ -1236,18 +1895,30 @@ def shard_stores( Provides store information for shard copies of indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg status: Comma-separated list of statuses used to filter on - shards to get store information for. + :arg index: List of data streams, indices, and aliases used to + limit the request. + :arg allow_no_indices: If false, the request returns an error if + any wildcard expression, index alias, or _allvalue targets only missing + or closed indices. This behavior applies even if the requesttargets + other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match. If the request can target data streams,this argument determines + whether wildcard expressions match hidden data streams. Valid choices + are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If true, missing or closed indices are + not included in the response. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg status: List of shard health statuses used to limit the + request. """ return self.transport.perform_request( "GET", _make_path(index, "_shard_stores"), params=params, headers=headers @@ -1255,11 +1926,17 @@ def shard_stores( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", "flush", + "human", "ignore_unavailable", "max_num_segments", "only_expunge_deletes", + "pretty", + "primary_only", + "source", "wait_for_completion", ) def forcemerge( @@ -1272,24 +1949,36 @@ def forcemerge( Performs the force merge operation on one or more indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + :arg index: A comma-separated list of index names; use `_all` or + empty string to perform the operation on all indices :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + string or when no indices have been specified) + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg flush: Specify whether the index should be flushed after - performing the operation. Default is True. + performing the operation (default: true) + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + should be ignored when unavailable (missing or closed) :arg max_num_segments: The number of segments the index should - be merged into (default: dynamic). + be merged into (default: dynamic) :arg only_expunge_deletes: Specify whether the operation should - only expunge deleted documents. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is True. + only expunge deleted documents + :arg pretty: Whether to pretty format the returned JSON + response. + :arg primary_only: Specify whether the operation should only + perform on primary shards. Defaults to false. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg wait_for_completion: Should the request wait until the + force merge is completed. """ return self.transport.perform_request( "POST", _make_path(index, "_forcemerge"), params=params, headers=headers @@ -1298,7 +1987,12 @@ def forcemerge( @query_params( "cluster_manager_timeout", "copy_settings", + "error_trace", + "filter_path", + "human", "master_timeout", + "pretty", + "source", "task_execution_timeout", "timeout", "wait_for_active_shards", @@ -1316,22 +2010,37 @@ def shrink( 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. + :arg index: Name of the source index to shrink. + :arg target: Name of the target index to create. :arg body: The configuration for the target index (`settings` and `aliases`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg copy_settings: whether or not to copy settings from the source index. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg task_execution_timeout: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for on the shrunken index before the operation returns. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -1350,7 +2059,12 @@ def shrink( @query_params( "cluster_manager_timeout", "copy_settings", + "error_trace", + "filter_path", + "human", "master_timeout", + "pretty", + "source", "task_execution_timeout", "timeout", "wait_for_active_shards", @@ -1369,22 +2083,37 @@ def split( shards. - :arg index: The name of the source index to split. - :arg target: The name of the target index. + :arg index: Name of the source index to split. + :arg target: Name of the target index to create. :arg body: The configuration for the target index (`settings` and `aliases`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg copy_settings: whether or not to copy settings from the source index. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg task_execution_timeout: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for on the shrunken index before the operation returns. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to `all` or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -1403,7 +2132,12 @@ def split( @query_params( "cluster_manager_timeout", "dry_run", + "error_trace", + "filter_path", + "human", "master_timeout", + "pretty", + "source", "timeout", "wait_for_active_shards", ) @@ -1420,22 +2154,36 @@ def rollover( to be too large or too old. - :arg alias: The name of the alias to rollover. + :arg alias: Name of the data stream or index alias to roll over. :arg body: The conditions that needs to be met for executing rollover - :arg new_index: The name of the rollover index. + :arg new_index: Name of the index to create. Supports date math. + Data streams do not support this parameter. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg dry_run: If set to true the rollover action will only be - validated but not actually performed even if a condition matches. - Default is false. + :arg dry_run: If `true`, checks whether the current index + satisfies the specified conditions but does not perform a rollover. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for on the newly created rollover index before the operation - returns. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operation.Set to all or any + positive integer up to the total number of shards in the index + (`number_of_replicas+1`). Valid choices are all, index-setting. """ if alias in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'alias'.") @@ -1448,7 +2196,7 @@ def rollover( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def create_data_stream( self, name: Any, @@ -1460,8 +2208,23 @@ def create_data_stream( Creates or updates a data stream. - :arg name: The name of the data stream. + :arg name: Name of the data stream, which must meet the + following criteria: Lowercase only; Cannot include `/`, `*`, `?`, `"`, + `<`, `>`, `|`, `,`, `#`, `:`, backslash, or a space character; Cannot + start with `-`, `_`, `+`, or `.ds-`; Cannot be `.` or `..`; Cannot be + longer than 255 bytes. Multi-byte characters count towards this limit + faster. :arg body: The data stream definition + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1474,7 +2237,7 @@ def create_data_stream( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_data_stream( self, name: Any, @@ -1485,8 +2248,18 @@ def delete_data_stream( Deletes a data stream. - :arg name: Comma-separated list of data streams; use `_all` or - empty string to perform the operation on all data streams. + :arg name: Comma-separated list of data streams to delete. + Wildcard (`*`) expressions are supported. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1495,7 +2268,16 @@ def delete_data_stream( "DELETE", _make_path("_data_stream", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def delete_index_template( self, name: Any, @@ -1506,13 +2288,27 @@ def delete_index_template( Deletes an index template. - :arg name: The name of the template. + :arg name: Name of the index template to delete. Wildcard (*) + expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1524,7 +2320,17 @@ def delete_index_template( headers=headers, ) - @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) def exists_index_template( self, name: Any, @@ -1535,16 +2341,28 @@ def exists_index_template( Returns information about whether a particular index template exists. - :arg name: The name of the template. + :arg name: Name of the index template to check existence of. + Wildcard (*) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg flat_settings: Return settings in flat format. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1553,7 +2371,17 @@ def exists_index_template( "HEAD", _make_path("_index_template", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) def get_index_template( self, name: Any = None, @@ -1564,22 +2392,44 @@ def get_index_template( Returns an index template. - :arg name: Comma-separated names of the index templates. + :arg name: Name of the index template to retrieve. Wildcard (*) + expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If true, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg local: If true, the request retrieves information from the + local node only. Defaults to false, which means information is retrieved + from the master node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path("_index_template", name), params=params, headers=headers ) - @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") + @query_params( + "cause", + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) def put_index_template( self, name: Any, @@ -1591,17 +2441,27 @@ def put_index_template( Creates or updates an index template. - :arg name: The name of the template. + :arg name: Index or template name :arg body: The template definition :arg cause: User defined reason for creating/updating the index template. Default is false. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template should only be added if - new or can also replace an existing one. Default is false. + :arg create: If `true`, this request cannot replace or update + existing index templates. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (name, body): if param in SKIP_IN_PATH: @@ -1615,7 +2475,17 @@ def put_index_template( body=body, ) - @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") + @query_params( + "cause", + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) def simulate_index_template( self, name: Any, @@ -1628,20 +2498,32 @@ def simulate_index_template( system. - :arg name: The name of the index (it must be a concrete index - name). + :arg name: Index or template name to simulate :arg body: New index template definition, which will be included in the simulation, as if it already exists in the system :arg cause: User defined reason for dry-run creating the new template for simulation purposes. Default is false. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template we optionally defined in - the body should only be dry-run added if new or can also replace an - existing one. Default is false. + :arg create: If `true`, the template passed in the body is only + used if no existingtemplates match the same index patterns. If `false`, + the simulation usesthe template with the highest priority. Note that the + template is notpermanently added or updated in either case; it is only + used for thesimulation. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is receivedbefore the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1654,7 +2536,7 @@ def simulate_index_template( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_data_stream( self, name: Any = None, @@ -1665,14 +2547,35 @@ def get_data_stream( Returns data streams. - :arg name: Comma-separated list of data streams; use `_all` or - empty string to perform the operation on all data streams. + :arg name: Comma-separated list of data stream names used to + limit the request. Wildcard (`*`) expressions are supported. If omitted, + all data streams are returned. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path("_data_stream", name), params=params, headers=headers ) - @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") + @query_params( + "cause", + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) def simulate_template( self, body: Any = None, @@ -1684,19 +2587,32 @@ def simulate_template( Simulate resolving the given template name or body. - :arg body: New index template definition to be simulated, if no - index template name is specified - :arg name: The name of the template. + :arg name: Name of the index template to simulate. To test a + template configuration before you add it to the cluster, omit this + parameter and specify the template configuration in the request body. :arg cause: User defined reason for dry-run creating the new template for simulation purposes. Default is false. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template we optionally defined in - the body should only be dry-run added if new or can also replace an - existing one. Default is false. + :arg create: If true, the template passed in the body is only + used if no existing templates match the same index patterns. If false, + the simulation uses the template with the highest priority. Note that + the template is not permanently added or updated in either case; it is + only used for the simulation. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", @@ -1706,7 +2622,9 @@ def simulate_template( body=body, ) - @query_params("expand_wildcards") + @query_params( + "error_trace", "expand_wildcards", "filter_path", "human", "pretty", "source" + ) def resolve_index( self, name: Any, @@ -1717,11 +2635,24 @@ def resolve_index( Returns information about any matching indices, aliases, and data streams. - :arg name: Comma-separated list of names or wildcard - expressions. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. + :arg name: Comma-separated name(s) or index pattern(s) of the + indices, aliases, and data streams to resolve. Resources on remote + clusters can be specified using the ``:`` syntax. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match.If the request can target data streams, this argument determines + whether wildcard expressions match hidden data streams.Supports comma- + separated values, such as `open,hidden`.Valid values are: `all`, `open`, + `closed`, `hidden`, `none`. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1733,9 +2664,14 @@ def resolve_index( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "timeout", ) def add_block( @@ -1749,23 +2685,33 @@ def add_block( Adds a block to an index. - :arg index: Comma-separated list of indices to add a block to. + :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 - metadata). + metadata) :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + string or when no indices have been specified) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + should be ignored when unavailable (missing or closed) :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ for param in (index, block): if param in SKIP_IN_PATH: @@ -1775,7 +2721,7 @@ def add_block( "PUT", _make_path(index, "_block", block), params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def data_streams_stats( self, name: Any = None, @@ -1786,8 +2732,19 @@ def data_streams_stats( Provides statistics on operations happening in a data stream. - :arg name: Comma-separated list of data streams; use `_all` or - empty string to perform the operation on all data streams. + :arg name: Comma-separated list of data streams used to limit + the request. Wildcard expressions (`*`) are supported. To target all + data streams in a cluster, omit this parameter or use `*`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", diff --git a/opensearchpy/client/ingest.py b/opensearchpy/client/ingest.py index 632a23d97..4b11d5c5c 100644 --- a/opensearchpy/client/ingest.py +++ b/opensearchpy/client/ingest.py @@ -40,7 +40,15 @@ class IngestClient(NamespacedClient): - @query_params("cluster_manager_timeout", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) def get_pipeline( self, id: Any = None, @@ -51,19 +59,40 @@ def get_pipeline( Returns a pipeline. - :arg id: Comma-separated list of pipeline ids. Wildcards - supported. + :arg id: Comma-separated list of pipeline IDs to retrieve. + Wildcard (`*`) expressions are supported. To get all ingest pipelines, + omit this parameter or use `*`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path("_ingest", "pipeline", id), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def put_pipeline( self, id: Any, @@ -75,14 +104,27 @@ def put_pipeline( Creates or updates a pipeline. - :arg id: Pipeline ID. + :arg id: ID of the ingest pipeline to create or update. :arg body: The ingest definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ for param in (id, body): if param in SKIP_IN_PATH: @@ -96,7 +138,16 @@ def put_pipeline( body=body, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def delete_pipeline( self, id: Any, @@ -107,13 +158,28 @@ def delete_pipeline( Deletes a pipeline. - :arg id: Pipeline ID. + :arg id: Pipeline ID or wildcard expression of pipeline IDs used + to limit the request. To delete all ingest pipelines in a cluster, use a + value of `*`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node.If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'id'.") @@ -125,7 +191,7 @@ def delete_pipeline( headers=headers, ) - @query_params("verbose") + @query_params("error_trace", "filter_path", "human", "pretty", "source", "verbose") def simulate( self, body: Any, @@ -138,9 +204,20 @@ def simulate( :arg body: The simulate definition - :arg id: Pipeline ID. - :arg verbose: Verbose mode. Display data output for each - processor in executed pipeline. Default is false. + :arg id: Pipeline to test. If you don’t specify a `pipeline` in + the request body, this parameter is required. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg verbose: If `true`, the response includes output data for + each processor in the executed pipeline. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -153,7 +230,7 @@ def simulate( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def processor_grok( self, params: Any = None, @@ -162,6 +239,17 @@ def processor_grok( """ Returns a list of the built-in patterns. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_ingest/processor/grok", params=params, headers=headers diff --git a/opensearchpy/client/nodes.py b/opensearchpy/client/nodes.py index ea2d4b475..eb224d49d 100644 --- a/opensearchpy/client/nodes.py +++ b/opensearchpy/client/nodes.py @@ -40,7 +40,7 @@ class NodesClient(NamespacedClient): - @query_params("timeout") + @query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout") def reload_secure_settings( self, body: Any = None, @@ -54,10 +54,21 @@ def reload_secure_settings( :arg body: An object containing the password for the opensearch keystore - :arg node_id: Comma-separated list of node IDs to span the - reload/reinit call. Should stay empty because reloading usually involves - all cluster nodes. - :arg timeout: Operation timeout. + :arg node_id: The names of particular nodes in the cluster to + target. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ return self.transport.perform_request( "POST", @@ -67,7 +78,15 @@ def reload_secure_settings( body=body, ) - @query_params("flat_settings", "timeout") + @query_params( + "error_trace", + "filter_path", + "flat_settings", + "human", + "pretty", + "source", + "timeout", + ) def info( self, node_id: Any = None, @@ -79,16 +98,24 @@ def info( Returns information about nodes in the cluster. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. - :arg metric: Comma-separated list of metrics you wish returned. - Leave empty to return all. Valid choices are settings, os, process, jvm, - thread_pool, transport, http, plugins, ingest. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg timeout: Operation timeout. + :arg node_id: Comma-separated list of node IDs or names used to + limit returned information. + :arg metric: Limits the information returned to the specific + metrics. Supports a comma-separated list, such as http,ingest. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If true, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ return self.transport.perform_request( "GET", _make_path("_nodes", node_id, metric), params=params, headers=headers @@ -96,11 +123,16 @@ def info( @query_params( "completion_fields", + "error_trace", "fielddata_fields", "fields", + "filter_path", "groups", + "human", "include_segment_file_sizes", "level", + "pretty", + "source", "timeout", "types", ) @@ -116,35 +148,42 @@ def stats( Returns statistical information about nodes in the cluster. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. + :arg node_id: Comma-separated list of node IDs or names used to + limit returned information. :arg metric: Limit the information returned to the specified - metrics. Valid choices are _all, breaker, fs, http, indices, jvm, os, - process, thread_pool, transport, discovery, indexing_pressure, - search_pipeline. - :arg index_metric: Limit the information returned for `indices` - metric to the specific index metrics. Isn't used if `indices` (or `all`) - metric isn't specified. Valid choices are _all, store, indexing, get, - search, merge, flush, refresh, query_cache, fielddata, docs, warmer, - completion, segments, translog, suggest, request_cache, recovery. - :arg completion_fields: Comma-separated list of fields for - `fielddata` and `suggest` index metric (supports wildcards). - :arg fielddata_fields: Comma-separated list of fields for - `fielddata` index metric (supports wildcards). - :arg fields: Comma-separated list of fields for `fielddata` and - `completion` index metric (supports wildcards). - :arg groups: Comma-separated list of search groups for `search` - index metric. - :arg include_segment_file_sizes: Whether to report the + metrics + :arg index_metric: Limit the information returned for indices + metric to the specific index metrics. It can be used only if indices (or + all) metric is specified. + :arg completion_fields: Comma-separated list or wildcard + expressions of fields to include in fielddata and suggest statistics. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg fielddata_fields: Comma-separated list or wildcard + expressions of fields to include in fielddata statistics. + :arg fields: Comma-separated list or wildcard expressions of + fields to include in the statistics. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg groups: Comma-separated list of search groups to include in + the search statistics. + :arg human: Whether to return human readable values for + statistics. + :arg include_segment_file_sizes: If true, the call reports the aggregated disk usage of each one of the Lucene index files (only - applies if segment stats are requested). Default is false. - :arg level: Return indices stats aggregated at index, node or - shard level. Valid choices are indices, node, shards. - :arg timeout: Operation timeout. - :arg types: Comma-separated list of document types for the - `indexing` index metric. + applies if segment stats are requested). + :arg level: Indicates whether statistics are aggregated at the + cluster, index, or shard level. Valid choices are cluster, indices, + shards. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. + :arg types: A comma-separated list of document types for the + indexing index metric. """ return self.transport.perform_request( "GET", @@ -154,7 +193,17 @@ def stats( ) @query_params( - "doc_type", "ignore_idle_threads", "interval", "snapshots", "threads", "timeout" + "doc_type", + "error_trace", + "filter_path", + "human", + "ignore_idle_threads", + "interval", + "pretty", + "snapshots", + "source", + "threads", + "timeout", ) def hot_threads( self, @@ -172,12 +221,22 @@ def hot_threads( nodes. :arg doc_type: The type to sample. Valid choices are cpu, wait, block. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_idle_threads: Don't show threads that are in known- idle places, such as waiting on a socket select or pulling from an empty task queue. Default is True. :arg interval: The interval for the second sampling of threads. + :arg pretty: Whether to pretty format the returned JSON + response. :arg snapshots: Number of samples of thread stacktrace. Default is 10. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg threads: Specify the number of threads to provide information for. Default is 3. :arg timeout: Operation timeout. @@ -193,7 +252,7 @@ def hot_threads( headers=headers, ) - @query_params("timeout") + @query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout") def usage( self, node_id: Any = None, @@ -205,13 +264,26 @@ def usage( Returns low-level information about REST actions usage on nodes. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. - :arg metric: Limit the information returned to the specified - metrics. Valid choices are _all, rest_actions. - :arg timeout: Operation timeout. + :arg node_id: A comma-separated list of node IDs or names to + limit the returned information; use `_local` to return information from + the node you're connecting to, leave empty to get information from all + nodes + :arg metric: Limits the information returned to the specific + metrics. A comma-separated list of the following options: `_all`, + `rest_actions`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ return self.transport.perform_request( "GET", diff --git a/opensearchpy/client/plugins.py b/opensearchpy/client/plugins.py index 5bf662889..fe82ff87b 100644 --- a/opensearchpy/client/plugins.py +++ b/opensearchpy/client/plugins.py @@ -12,6 +12,8 @@ from ..plugins.alerting import AlertingClient from ..plugins.index_management import IndexManagementClient +from ..plugins.knn import KnnClient +from ..plugins.notifications import NotificationsClient from .client import Client from .utils import NamespacedClient @@ -22,6 +24,8 @@ class PluginsClient(NamespacedClient): def __init__(self, client: Client) -> None: super(PluginsClient, self).__init__(client) + self.notifications = NotificationsClient(client) + self.knn = KnnClient(client) # self.query_workbench = QueryWorkbenchClient(client) # self.reporting = ReportingClient(client) # self.notebooks = NotebooksClient(client) diff --git a/opensearchpy/client/remote_store.py b/opensearchpy/client/remote_store.py index 55d8fd6ed..20e22eaea 100644 --- a/opensearchpy/client/remote_store.py +++ b/opensearchpy/client/remote_store.py @@ -22,7 +22,15 @@ class RemoteStoreClient(NamespacedClient): - @query_params("cluster_manager_timeout", "wait_for_completion") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + "wait_for_completion", + ) def restore( self, body: Any, @@ -36,6 +44,16 @@ def restore( :arg body: Comma-separated list of index IDs :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is false. """ diff --git a/opensearchpy/client/search_pipeline.py b/opensearchpy/client/search_pipeline.py new file mode 100644 index 000000000..bd764c3c7 --- /dev/null +++ b/opensearchpy/client/search_pipeline.py @@ -0,0 +1,151 @@ +# 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. + +# ------------------------------------------------------------------------------------------ +# THIS CODE IS AUTOMATICALLY GENERATED AND MANUAL EDITS WILL BE LOST +# +# To contribute, kindly make modifications in the opensearch-py client generator +# or in the OpenSearch API specification, and run `nox -rs generate`. See DEVELOPER_GUIDE.md +# and https://github.com/opensearch-project/opensearch-api-specification for details. +# -----------------------------------------------------------------------------------------+ + + +from typing import Any + +from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params + + +class SearchPipelineClient(NamespacedClient): + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + ) + def get( + self, + id: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves information about a specified search pipeline. + + + :arg id: Comma-separated list of search pipeline ids. Wildcards + supported. + :arg cluster_manager_timeout: operation timeout for connection + to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + return self.transport.perform_request( + "GET", _make_path("_search", "pipeline", id), params=params, headers=headers + ) + + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + "timeout", + ) + def delete( + self, + id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Deletes the specified search pipeline. + + + :arg id: Pipeline ID. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Operation timeout. + """ + if id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'id'.") + + return self.transport.perform_request( + "DELETE", + _make_path("_search", "pipeline", id), + params=params, + headers=headers, + ) + + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + "timeout", + ) + def put( + self, + id: Any, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Creates or replaces the specified search pipeline. + + + :arg id: Pipeline ID. + :arg cluster_manager_timeout: operation timeout for connection + to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Operation timeout. + """ + for param in (id, body): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return self.transport.perform_request( + "PUT", + _make_path("_search", "pipeline", id), + params=params, + headers=headers, + body=body, + ) diff --git a/opensearchpy/client/security.py b/opensearchpy/client/security.py index d7b76a90f..b2945fc0b 100644 --- a/opensearchpy/client/security.py +++ b/opensearchpy/client/security.py @@ -24,7 +24,7 @@ class SecurityClient(NamespacedClient): from ._patch import health_check, update_audit_config # type: ignore - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_account_details( self, params: Any = None, @@ -33,12 +33,23 @@ def get_account_details( """ Returns account details for the current user. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_plugins/_security/api/account", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def change_password( self, body: Any, @@ -49,6 +60,16 @@ def change_password( Changes the password for the current user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -61,7 +82,7 @@ def change_password( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_action_group( self, action_group: Any, @@ -73,6 +94,16 @@ def get_action_group( :arg action_group: Action group to retrieve. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if action_group in SKIP_IN_PATH: raise ValueError( @@ -86,7 +117,7 @@ def get_action_group( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_action_groups( self, params: Any = None, @@ -95,15 +126,26 @@ def get_action_groups( """ Retrieves all action groups. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", - "/_plugins/_security/api/actiongroups/", + "/_plugins/_security/api/actiongroups", params=params, headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_action_group( self, action_group: Any, @@ -115,6 +157,16 @@ def delete_action_group( :arg action_group: Action group to delete. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if action_group in SKIP_IN_PATH: raise ValueError( @@ -128,7 +180,7 @@ def delete_action_group( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def create_action_group( self, action_group: Any, @@ -142,6 +194,16 @@ def create_action_group( :arg action_group: The name of the action group to create or replace + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (action_group, body): if param in SKIP_IN_PATH: @@ -155,7 +217,7 @@ def create_action_group( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_action_group( self, action_group: Any, @@ -167,6 +229,16 @@ def patch_action_group( Updates individual attributes of an action group. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (action_group, body): if param in SKIP_IN_PATH: @@ -180,7 +252,7 @@ def patch_action_group( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_action_groups( self, body: Any, @@ -191,6 +263,16 @@ def patch_action_groups( Creates, updates, or deletes multiple action groups in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -203,7 +285,7 @@ def patch_action_groups( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_user( self, username: Any, @@ -214,6 +296,16 @@ def get_user( Retrieve one internal user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'username'.") @@ -225,7 +317,7 @@ def get_user( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_users( self, params: Any = None, @@ -234,6 +326,17 @@ def get_users( """ Retrieve all internal users. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", @@ -242,7 +345,7 @@ def get_users( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_user( self, username: Any, @@ -253,6 +356,16 @@ def delete_user( Delete the specified user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'username'.") @@ -264,7 +377,7 @@ def delete_user( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def create_user( self, username: Any, @@ -276,6 +389,16 @@ def create_user( Creates or replaces the specified user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (username, body): if param in SKIP_IN_PATH: @@ -289,7 +412,7 @@ def create_user( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_user( self, username: Any, @@ -301,6 +424,16 @@ def patch_user( Updates individual attributes of an internal user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (username, body): if param in SKIP_IN_PATH: @@ -314,7 +447,7 @@ def patch_user( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_users( self, body: Any, @@ -325,6 +458,16 @@ def patch_users( Creates, updates, or deletes multiple internal users in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -337,7 +480,7 @@ def patch_users( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_role( self, role: Any, @@ -348,6 +491,16 @@ def get_role( Retrieves one role. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -359,7 +512,7 @@ def get_role( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_roles( self, params: Any = None, @@ -368,12 +521,23 @@ def get_roles( """ Retrieves all roles. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_plugins/_security/api/roles/", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_role( self, role: Any, @@ -384,6 +548,16 @@ def delete_role( Delete the specified role. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -395,7 +569,7 @@ def delete_role( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def create_role( self, role: Any, @@ -407,6 +581,16 @@ def create_role( Creates or replaces the specified role. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (role, body): if param in SKIP_IN_PATH: @@ -420,7 +604,7 @@ def create_role( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_role( self, role: Any, @@ -432,6 +616,16 @@ def patch_role( Updates individual attributes of a role. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (role, body): if param in SKIP_IN_PATH: @@ -445,7 +639,7 @@ def patch_role( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_roles( self, body: Any, @@ -456,6 +650,16 @@ def patch_roles( Creates, updates, or deletes multiple roles in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -468,7 +672,7 @@ def patch_roles( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_role_mapping( self, role: Any, @@ -479,6 +683,16 @@ def get_role_mapping( Retrieves one role mapping. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -490,7 +704,7 @@ def get_role_mapping( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_role_mappings( self, params: Any = None, @@ -499,6 +713,17 @@ def get_role_mappings( """ Retrieves all role mappings. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", @@ -507,7 +732,7 @@ def get_role_mappings( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_role_mapping( self, role: Any, @@ -518,6 +743,16 @@ def delete_role_mapping( Deletes the specified role mapping. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -529,7 +764,7 @@ def delete_role_mapping( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def create_role_mapping( self, role: Any, @@ -541,6 +776,16 @@ def create_role_mapping( Creates or replaces the specified role mapping. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (role, body): if param in SKIP_IN_PATH: @@ -554,7 +799,7 @@ def create_role_mapping( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_role_mapping( self, role: Any, @@ -566,6 +811,16 @@ def patch_role_mapping( Updates individual attributes of a role mapping. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (role, body): if param in SKIP_IN_PATH: @@ -579,7 +834,7 @@ def patch_role_mapping( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_role_mappings( self, body: Any, @@ -590,6 +845,16 @@ def patch_role_mappings( Creates or updates multiple role mappings in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -602,7 +867,7 @@ def patch_role_mappings( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_tenant( self, tenant: Any, @@ -613,6 +878,16 @@ def get_tenant( Retrieves one tenant. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if tenant in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'tenant'.") @@ -624,7 +899,7 @@ def get_tenant( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_tenants( self, params: Any = None, @@ -633,12 +908,23 @@ def get_tenants( """ Retrieves all tenants. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_plugins/_security/api/tenants/", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_tenant( self, tenant: Any, @@ -649,6 +935,16 @@ def delete_tenant( Delete the specified tenant. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if tenant in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'tenant'.") @@ -660,7 +956,7 @@ def delete_tenant( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def create_tenant( self, tenant: Any, @@ -672,6 +968,16 @@ def create_tenant( Creates or replaces the specified tenant. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (tenant, body): if param in SKIP_IN_PATH: @@ -685,7 +991,7 @@ def create_tenant( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_tenant( self, tenant: Any, @@ -697,6 +1003,16 @@ def patch_tenant( Add, delete, or modify a single tenant. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (tenant, body): if param in SKIP_IN_PATH: @@ -710,7 +1026,7 @@ def patch_tenant( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_tenants( self, body: Any, @@ -721,6 +1037,16 @@ def patch_tenants( Add, delete, or modify multiple tenants in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -733,7 +1059,7 @@ def patch_tenants( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_configuration( self, params: Any = None, @@ -742,6 +1068,17 @@ def get_configuration( """ Returns the current Security plugin configuration in JSON format. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", @@ -750,7 +1087,7 @@ def get_configuration( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def update_configuration( self, body: Any, @@ -761,6 +1098,16 @@ def update_configuration( Adds or updates the existing configuration using the REST API. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -773,7 +1120,7 @@ def update_configuration( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_configuration( self, body: Any, @@ -784,6 +1131,16 @@ def patch_configuration( A PATCH call is used to update the existing configuration using the REST API. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -796,7 +1153,7 @@ def patch_configuration( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_distinguished_names( self, cluster_name: Any = None, @@ -804,9 +1161,19 @@ def get_distinguished_names( headers: Any = None, ) -> Any: """ - Retrieves all distinguished names in the allow list. + Retrieves distinguished names. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", @@ -815,7 +1182,7 @@ def get_distinguished_names( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def update_distinguished_names( self, cluster_name: Any, @@ -828,6 +1195,16 @@ def update_distinguished_names( allow list. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if cluster_name in SKIP_IN_PATH: raise ValueError( @@ -842,7 +1219,7 @@ def update_distinguished_names( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_distinguished_names( self, cluster_name: Any, @@ -854,6 +1231,16 @@ def delete_distinguished_names( list. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if cluster_name in SKIP_IN_PATH: raise ValueError( @@ -867,7 +1254,7 @@ def delete_distinguished_names( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_certificates( self, params: Any = None, @@ -876,12 +1263,23 @@ def get_certificates( """ Retrieves the cluster’s security certificates. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_plugins/_security/api/ssl/certs", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def reload_transport_certificates( self, params: Any = None, @@ -890,6 +1288,17 @@ def reload_transport_certificates( """ Reload transport layer communication certificates. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "PUT", @@ -898,7 +1307,7 @@ def reload_transport_certificates( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def reload_http_certificates( self, params: Any = None, @@ -907,6 +1316,17 @@ def reload_http_certificates( """ Reload HTTP layer communication certificates. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "PUT", @@ -915,7 +1335,7 @@ def reload_http_certificates( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def flush_cache( self, params: Any = None, @@ -924,12 +1344,23 @@ def flush_cache( """ Flushes the Security plugin user, authentication, and authorization cache. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "DELETE", "/_plugins/_security/api/cache", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def health( self, params: Any = None, @@ -938,12 +1369,23 @@ def health( """ Checks to see if the Security plugin is up and running. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_plugins/_security/health", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_audit_configuration( self, params: Any = None, @@ -952,12 +1394,23 @@ def get_audit_configuration( """ Retrieves the audit configuration. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_plugins/_security/api/audit", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def update_audit_configuration( self, body: Any, @@ -968,6 +1421,16 @@ def update_audit_configuration( Updates the audit configuration. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -980,7 +1443,7 @@ def update_audit_configuration( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_audit_configuration( self, body: Any, @@ -991,6 +1454,16 @@ def patch_audit_configuration( A PATCH call is used to update specified fields in the audit configuration. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1003,7 +1476,7 @@ def patch_audit_configuration( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_distinguished_names( self, body: Any, @@ -1014,6 +1487,16 @@ def patch_distinguished_names( Bulk update of distinguished names. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") diff --git a/opensearchpy/client/snapshot.py b/opensearchpy/client/snapshot.py index eecd15a95..7e57e4743 100644 --- a/opensearchpy/client/snapshot.py +++ b/opensearchpy/client/snapshot.py @@ -40,7 +40,16 @@ class SnapshotClient(NamespacedClient): - @query_params("cluster_manager_timeout", "master_timeout", "wait_for_completion") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "wait_for_completion", + ) def create( self, repository: Any, @@ -53,16 +62,29 @@ def create( Creates a snapshot in a repository. - :arg repository: Repository name. - :arg snapshot: Snapshot name. + :arg repository: Repository for the snapshot. + :arg snapshot: Name of the snapshot. Must be unique in the + repository. :arg body: The snapshot definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg wait_for_completion: If `true`, the request returns a + response when the snapshot is complete. If `false`, the request returns + a response when the snapshot initializes. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -76,7 +98,15 @@ def create( body=body, ) - @query_params("cluster_manager_timeout", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) def delete( self, repository: Any, @@ -88,13 +118,23 @@ def delete( Deletes a snapshot. - :arg repository: Repository name. - :arg snapshot: Snapshot name. + :arg repository: A repository name + :arg snapshot: A comma-separated list of snapshot names :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -108,7 +148,15 @@ def delete( ) @query_params( - "cluster_manager_timeout", "ignore_unavailable", "master_timeout", "verbose" + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "ignore_unavailable", + "master_timeout", + "pretty", + "source", + "verbose", ) def get( self, @@ -121,18 +169,35 @@ def get( Returns information about a snapshot. - :arg repository: Repository name. - :arg snapshot: Comma-separated list of snapshot names. + :arg repository: Comma-separated list of snapshot repository + names used to limit the request. Wildcard (*) expressions are supported. + :arg snapshot: Comma-separated list of snapshot names to + retrieve. Also accepts wildcards (*). - To get information about all + snapshots in a registered repository, use a wildcard (*) or _all. - To + get information about any snapshots that are currently running, use + _current. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg ignore_unavailable: Whether to ignore unavailable - snapshots, defaults to false which means a SnapshotMissingException is - thrown. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If false, the request returns an error + for any snapshots that are unavailable. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg verbose: Whether to show verbose snapshot info or only show - the basic info found in the repository index blob. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg verbose: If true, returns additional information about each + snapshot such as the version of Opensearch which took the snapshot, the + start and end times of the snapshot, and the number of shards + snapshotted. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -145,7 +210,16 @@ def get( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def delete_repository( self, repository: Any, @@ -160,10 +234,20 @@ def delete_repository( Wildcard (`*`) patterns are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -175,7 +259,16 @@ def delete_repository( headers=headers, ) - @query_params("cluster_manager_timeout", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) def get_repository( self, repository: Any = None, @@ -186,20 +279,40 @@ def get_repository( Returns information about a repository. - :arg repository: Comma-separated list of repository names. + :arg repository: A comma-separated list of repository names :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + from cluster-manager node (default: false) :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path("_snapshot", repository), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout", "verify") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + "verify", + ) def create_repository( self, repository: Any, @@ -211,15 +324,25 @@ def create_repository( Creates a repository. - :arg repository: Repository name. + :arg repository: A repository name :arg body: The repository definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg verify: Whether to verify the repository after creation. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout + :arg verify: Whether to verify the repository after creation """ for param in (repository, body): if param in SKIP_IN_PATH: @@ -233,7 +356,16 @@ def create_repository( body=body, ) - @query_params("cluster_manager_timeout", "master_timeout", "wait_for_completion") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "wait_for_completion", + ) def restore( self, repository: Any, @@ -246,16 +378,26 @@ def restore( Restores a snapshot. - :arg repository: Repository name. - :arg snapshot: Snapshot name. + :arg repository: A repository name + :arg snapshot: A snapshot name :arg body: Details of what to restore :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + operation has completed before returning """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -269,7 +411,16 @@ def restore( body=body, ) - @query_params("cluster_manager_timeout", "ignore_unavailable", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "ignore_unavailable", + "master_timeout", + "pretty", + "source", + ) def status( self, repository: Any = None, @@ -281,16 +432,26 @@ def status( Returns information about the status of a snapshot. - :arg repository: Repository name. - :arg snapshot: Comma-separated list of snapshot names. + :arg repository: A repository name + :arg snapshot: A comma-separated list of snapshot names :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is - thrown. Default is false. + thrown :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", @@ -299,7 +460,16 @@ def status( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def verify_repository( self, repository: Any, @@ -310,13 +480,23 @@ def verify_repository( Verifies a repository. - :arg repository: Repository name. + :arg repository: A repository name :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -328,7 +508,16 @@ def verify_repository( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def cleanup_repository( self, repository: Any, @@ -339,13 +528,23 @@ def cleanup_repository( Removes stale data from repository. - :arg repository: Repository name. + :arg repository: Snapshot repository to clean up. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -357,7 +556,15 @@ def cleanup_repository( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) def clone( self, repository: Any, @@ -371,15 +578,25 @@ def clone( Clones indices from one snapshot into another snapshot in the same repository. - :arg repository: Repository name. - :arg snapshot: Snapshot name. - :arg target_snapshot: The name of the cloned snapshot to create. + :arg repository: A repository name + :arg snapshot: The name of the snapshot to clone from + :arg target_snapshot: The name of the cloned snapshot to create :arg body: The snapshot clone definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (repository, snapshot, target_snapshot, body): if param in SKIP_IN_PATH: diff --git a/opensearchpy/client/tasks.py b/opensearchpy/client/tasks.py index 02a3eb0f3..25eda7a1d 100644 --- a/opensearchpy/client/tasks.py +++ b/opensearchpy/client/tasks.py @@ -44,9 +44,14 @@ class TasksClient(NamespacedClient): @query_params( "actions", "detailed", + "error_trace", + "filter_path", "group_by", + "human", "nodes", "parent_task_id", + "pretty", + "source", "timeout", "wait_for_completion", ) @@ -59,27 +64,50 @@ def list( Returns a list of tasks. - :arg actions: Comma-separated list of actions that should be - returned. Leave empty to return all. - :arg detailed: Return detailed task information. Default is - false. - :arg group_by: Group tasks by nodes or parent/child - relationships. Valid choices are nodes, parents, none. + :arg actions: Comma-separated list or wildcard expression of + actions used to limit the request. + :arg detailed: If `true`, the response includes detailed + information about shard recoveries. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg group_by: Key used to group tasks in the response. Valid + choices are nodes, parents, none. + :arg human: Whether to return human readable values for + statistics. :arg nodes: Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. - :arg parent_task_id: Return tasks with specified parent task id - (node_id:task_number). Set to -1 to return all. - :arg timeout: Operation timeout. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + :arg parent_task_id: Parent task ID used to limit returned + information. To return all tasks, omit this parameter or use a value of + `-1`. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_completion: If `true`, the request blocks until + the operation is complete. """ return self.transport.perform_request( "GET", "/_tasks", params=params, headers=headers ) - @query_params("actions", "nodes", "parent_task_id", "wait_for_completion") + @query_params( + "actions", + "error_trace", + "filter_path", + "human", + "nodes", + "parent_task_id", + "pretty", + "source", + "wait_for_completion", + ) def cancel( self, task_id: Any = None, @@ -90,18 +118,25 @@ def cancel( Cancels a task, if it can be cancelled through an API. - :arg task_id: Cancel the task with specified task id - (node_id:task_number). - :arg actions: Comma-separated list of actions that should be - cancelled. Leave empty to cancel all. - :arg nodes: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. - :arg parent_task_id: Cancel tasks with specified parent task id - (node_id:task_number). Set to -1 to cancel all. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + :arg task_id: ID of the task. + :arg actions: Comma-separated list or wildcard expression of + actions used to limit the request. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg nodes: Comma-separated list of node IDs or names used to + limit the request. + :arg parent_task_id: Parent task ID used to limit the tasks. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg wait_for_completion: Should the request block until the + cancellation of the task and its descendant tasks is completed. Defaults + to false """ return self.transport.perform_request( "POST", @@ -110,7 +145,15 @@ def cancel( headers=headers, ) - @query_params("timeout", "wait_for_completion") + @query_params( + "error_trace", + "filter_path", + "human", + "pretty", + "source", + "timeout", + "wait_for_completion", + ) def get( self, task_id: Any = None, @@ -121,11 +164,22 @@ def get( Returns information about a task. - :arg task_id: Return the task with specified id - (node_id:task_number). - :arg timeout: Operation timeout. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + :arg task_id: ID of the task. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_completion: If `true`, the request blocks until + the task has completed. """ if task_id in SKIP_IN_PATH: warnings.warn( diff --git a/opensearchpy/connection/http_requests.py b/opensearchpy/connection/http_requests.py index 9bf83004f..2c1737252 100644 --- a/opensearchpy/connection/http_requests.py +++ b/opensearchpy/connection/http_requests.py @@ -36,6 +36,8 @@ except ImportError: REQUESTS_AVAILABLE = False +from opensearchpy.metrics import Metrics, MetricsNone + from ..compat import reraise_exceptions, string_types, urlencode from ..exceptions import ( ConnectionError, @@ -69,6 +71,9 @@ class RequestsHttpConnection(Connection): For tracing all requests made by this transport. :arg pool_maxsize: Maximum connection pool size used by pool-manager For custom connection-pooling on current session + :arg metrics: metrics is an instance of a subclass of the + :class:`~opensearchpy.Metrics` class, used for collecting + and reporting metrics related to the client's operations; """ def __init__( @@ -86,8 +91,10 @@ def __init__( http_compress: Any = None, opaque_id: Any = None, pool_maxsize: Any = None, + metrics: Metrics = MetricsNone(), **kwargs: Any ) -> None: + self.metrics = metrics if not REQUESTS_AVAILABLE: raise ImproperlyConfigured( "Please install requests to use RequestsHttpConnection." @@ -188,6 +195,7 @@ def perform_request( # type: ignore } send_kwargs.update(settings) try: + self.metrics.request_start() response = self.session.send(prepared_request, **send_kwargs) duration = time.time() - start raw_data = response.content.decode("utf-8", "surrogatepass") @@ -207,6 +215,8 @@ def perform_request( # type: ignore if isinstance(e, requests.Timeout): raise ConnectionTimeout("TIMEOUT", str(e), e) raise ConnectionError("N/A", str(e), e) + finally: + self.metrics.request_end() # raise warnings if any from the 'Warnings' header. warnings_headers = ( diff --git a/opensearchpy/connection/http_urllib3.py b/opensearchpy/connection/http_urllib3.py index ab9a1a78f..e3b60cf3f 100644 --- a/opensearchpy/connection/http_urllib3.py +++ b/opensearchpy/connection/http_urllib3.py @@ -34,6 +34,8 @@ from urllib3.exceptions import SSLError as UrllibSSLError from urllib3.util.retry import Retry +from opensearchpy.metrics import Metrics, MetricsNone + from ..compat import reraise_exceptions, urlencode from ..exceptions import ( ConnectionError, @@ -94,6 +96,9 @@ class Urllib3HttpConnection(Connection): :arg http_compress: Use gzip compression :arg opaque_id: Send this value in the 'X-Opaque-Id' HTTP header For tracing all requests made by this transport. + :arg metrics: metrics is an instance of a subclass of the + :class:`~opensearchpy.Metrics` class, used for collecting + and reporting metrics related to the client's operations; """ def __init__( @@ -115,8 +120,10 @@ def __init__( ssl_context: Any = None, http_compress: Any = None, opaque_id: Any = None, + metrics: Metrics = MetricsNone(), **kwargs: Any ) -> None: + self.metrics = metrics # Initialize headers before calling super().__init__(). self.headers = urllib3.make_headers(keep_alive=True) @@ -268,6 +275,8 @@ def perform_request( if isinstance(self.http_auth, Callable): # type: ignore request_headers.update(self.http_auth(method, full_url, body)) + self.metrics.request_start() + response = self.pool.urlopen( method, url, body, retries=Retry(False), headers=request_headers, **kw ) @@ -284,6 +293,8 @@ def perform_request( if isinstance(e, ReadTimeoutError): raise ConnectionTimeout("TIMEOUT", str(e), e) raise ConnectionError("N/A", str(e), e) + finally: + self.metrics.request_end() # raise warnings if any from the 'Warnings' header. warning_headers = response.headers.get_all("warning", ()) diff --git a/opensearchpy/helpers/analysis.py b/opensearchpy/helpers/analysis.py index 816a29b6a..ff5d46b9a 100644 --- a/opensearchpy/helpers/analysis.py +++ b/opensearchpy/helpers/analysis.py @@ -233,9 +233,13 @@ def get_definition(self) -> Any: if "filters" in d: d["filters"] = [ # comma delimited string given by user - fs if isinstance(fs, six.string_types) else - # list of strings or TokenFilter objects - ", ".join(f.to_dict() if hasattr(f, "to_dict") else f for f in fs) + ( + fs + if isinstance(fs, six.string_types) + else + # list of strings or TokenFilter objects + ", ".join(f.to_dict() if hasattr(f, "to_dict") else f for f in fs) + ) for fs in self.filters ] return d diff --git a/opensearchpy/metrics/__init__.py b/opensearchpy/metrics/__init__.py new file mode 100644 index 000000000..2d0e0d11c --- /dev/null +++ b/opensearchpy/metrics/__init__.py @@ -0,0 +1,18 @@ +# 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. + +from .metrics import Metrics +from .metrics_events import MetricsEvents +from .metrics_none import MetricsNone + +__all__ = [ + "Metrics", + "MetricsEvents", + "MetricsNone", +] diff --git a/opensearchpy/metrics/metrics.py b/opensearchpy/metrics/metrics.py new file mode 100644 index 000000000..8764976c4 --- /dev/null +++ b/opensearchpy/metrics/metrics.py @@ -0,0 +1,42 @@ +# 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. + +from abc import ABC, abstractmethod +from typing import Optional + + +class Metrics(ABC): + """ + The Metrics class defines methods and properties for managing + request metrics, including start time, end time, and service time, + serving as a blueprint for concrete implementations. + """ + + @abstractmethod + def request_start(self) -> None: + pass + + @abstractmethod + def request_end(self) -> None: + pass + + @property + @abstractmethod + def start_time(self) -> Optional[float]: + pass + + @property + @abstractmethod + def end_time(self) -> Optional[float]: + pass + + @property + @abstractmethod + def service_time(self) -> Optional[float]: + pass diff --git a/opensearchpy/metrics/metrics_events.py b/opensearchpy/metrics/metrics_events.py new file mode 100644 index 000000000..994d5b10e --- /dev/null +++ b/opensearchpy/metrics/metrics_events.py @@ -0,0 +1,61 @@ +# 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. + +import time +from typing import Optional + +from events import Events + +from opensearchpy.metrics.metrics import Metrics + + +class MetricsEvents(Metrics): + """ + The MetricsEvents class implements the Metrics abstract base class + and tracks metrics such as start time, end time, and service time + during request processing. + """ + + @property + def start_time(self) -> Optional[float]: + return self._start_time + + @property + def end_time(self) -> Optional[float]: + return self._end_time + + @property + def service_time(self) -> Optional[float]: + return self._service_time + + def __init__(self) -> None: + self.events = Events() + self._start_time: Optional[float] = None + self._end_time: Optional[float] = None + self._service_time: Optional[float] = None + + # Subscribe to the request_start and request_end events + self.events.request_start += self._on_request_start + self.events.request_end += self._on_request_end + + def request_start(self) -> None: + self.events.request_start() + + def _on_request_start(self) -> None: + self._start_time = time.perf_counter() + self._end_time = None + self._service_time = None + + def request_end(self) -> None: + self.events.request_end() + + def _on_request_end(self) -> None: + self._end_time = time.perf_counter() + if self._start_time is not None: + self._service_time = self._end_time - self._start_time diff --git a/opensearchpy/metrics/metrics_none.py b/opensearchpy/metrics/metrics_none.py new file mode 100644 index 000000000..bbc7b335b --- /dev/null +++ b/opensearchpy/metrics/metrics_none.py @@ -0,0 +1,47 @@ +# 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. + +from typing import Optional + +from opensearchpy.metrics.metrics import Metrics + + +class MetricsNone(Metrics): + """ + Default metrics class. It sets the start time, end time, and service time to None. + """ + + @property + def start_time(self) -> Optional[float]: + return self._start_time + + @property + def end_time(self) -> Optional[float]: + return self._end_time + + @property + def service_time(self) -> Optional[float]: + return self._service_time + + def __init__(self) -> None: + self._start_time: Optional[float] = None + self._end_time: Optional[float] = None + self._service_time: Optional[float] = None + + # request_start and request_end are placeholders, + # not implementing actual metrics collection in this subclass. + + def request_start(self) -> None: + self._start_time = None + self._end_time = None + self._service_time = None + + def request_end(self) -> None: + self._end_time = None + self._service_time = None diff --git a/opensearchpy/plugins/__init__.py b/opensearchpy/plugins/__init__.py index 2f42da793..6c0097cd1 100644 --- a/opensearchpy/plugins/__init__.py +++ b/opensearchpy/plugins/__init__.py @@ -6,4 +6,3 @@ # # Modifications Copyright OpenSearch Contributors. See # GitHub history for details. -# diff --git a/opensearchpy/plugins/alerting.py b/opensearchpy/plugins/alerting.py index 63977420f..c812025a7 100644 --- a/opensearchpy/plugins/alerting.py +++ b/opensearchpy/plugins/alerting.py @@ -124,9 +124,11 @@ def get_destination( """ return self.transport.perform_request( "GET", - _make_path("_plugins", "_alerting", "destinations", destination_id) - if destination_id - else _make_path("_plugins", "_alerting", "destinations"), + ( + _make_path("_plugins", "_alerting", "destinations", destination_id) + if destination_id + else _make_path("_plugins", "_alerting", "destinations") + ), params=params, headers=headers, ) diff --git a/opensearchpy/plugins/knn.py b/opensearchpy/plugins/knn.py new file mode 100644 index 000000000..475492d2f --- /dev/null +++ b/opensearchpy/plugins/knn.py @@ -0,0 +1,383 @@ +# 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. + +# ------------------------------------------------------------------------------------------ +# THIS CODE IS AUTOMATICALLY GENERATED AND MANUAL EDITS WILL BE LOST +# +# To contribute, kindly make modifications in the opensearch-py client generator +# or in the OpenSearch API specification, and run `nox -rs generate`. See DEVELOPER_GUIDE.md +# and https://github.com/opensearch-project/opensearch-api-specification for details. +# -----------------------------------------------------------------------------------------+ + + +from typing import Any + +from ..client.utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params + + +class KnnClient(NamespacedClient): + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def delete_model( + self, + model_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Used to delete a particular model in the cluster. + + + :arg model_id: The id of the model. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if model_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'model_id'.") + + return self.transport.perform_request( + "DELETE", + _make_path("_plugins", "_knn", "models", model_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_model( + self, + model_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Used to retrieve information about models present in the cluster. + + + :arg model_id: The id of the model. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if model_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'model_id'.") + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_knn", "models", model_id), + params=params, + headers=headers, + ) + + @query_params( + "_source", + "_source_excludes", + "_source_includes", + "allow_no_indices", + "allow_partial_search_results", + "analyze_wildcard", + "analyzer", + "batched_reduce_size", + "ccs_minimize_roundtrips", + "default_operator", + "df", + "docvalue_fields", + "error_trace", + "expand_wildcards", + "explain", + "filter_path", + "from_", + "human", + "ignore_throttled", + "ignore_unavailable", + "lenient", + "max_concurrent_shard_requests", + "pre_filter_shard_size", + "preference", + "pretty", + "q", + "request_cache", + "rest_total_hits_as_int", + "routing", + "scroll", + "search_type", + "seq_no_primary_term", + "size", + "sort", + "source", + "stats", + "stored_fields", + "suggest_field", + "suggest_mode", + "suggest_size", + "suggest_text", + "terminate_after", + "timeout", + "track_scores", + "track_total_hits", + "typed_keys", + "version", + ) + def search_models( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Use an OpenSearch query to search for models in the index. + + + :arg _source: True or false to return the _source field or not, + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. + :arg allow_no_indices: Whether to ignore if a wildcard indices + expression resolves into no concrete indices. (This includes `_all` + string or when no indices have been specified). + :arg allow_partial_search_results: Indicate if an error should + be returned if there is a partial search failure or timeout. Default is + True. + :arg analyze_wildcard: Specify whether wildcard and prefix + queries should be analyzed. Default is false. + :arg analyzer: The analyzer to use for the query string. + :arg batched_reduce_size: The number of shard results that + should be reduced at once on the coordinating node. This value should be + used as a protection mechanism to reduce the memory overhead per search + request if the potential number of shards in the request can be large. + Default is 512. + :arg ccs_minimize_roundtrips: Indicates whether network round- + trips should be minimized as part of cross-cluster search requests + execution. Default is True. + :arg default_operator: The default operator for query string + query (AND or OR). Valid choices are AND, OR. + :arg df: The field to use as default where no field prefix is + given in the query string. + :arg docvalue_fields: Comma-separated list of fields to return + as the docvalue representation of a field for each hit. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Whether to expand wildcard expression to + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg explain: Specify whether to return detailed information + about score computation as part of a hit. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg from_: Starting offset. Default is 0. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_throttled: Whether specified concrete, expanded or + aliased indices should be ignored when throttled. + :arg ignore_unavailable: Whether specified concrete indices + should be ignored when unavailable (missing or closed). + :arg lenient: Specify whether format-based query failures (such + as providing text to a numeric field) should be ignored. + :arg max_concurrent_shard_requests: The number of concurrent + shard requests per node this search executes concurrently. This value + should be used to limit the impact of the search on the cluster in order + to limit the number of concurrent shard requests. Default is 5. + :arg pre_filter_shard_size: Threshold that enforces a pre-filter + round-trip to prefilter search shards based on query rewriting if the + number of shards the search request expands to exceeds the threshold. + This filter round-trip can limit the number of shards significantly if + for instance a shard can not match any documents based on its rewrite + method ie. if date filters are mandatory to match but the shard bounds + and the query are disjoint. + :arg preference: Specify the node or shard the operation should + be performed on. Default is random. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg q: Query in the Lucene query string syntax. + :arg request_cache: Specify if request cache should be used for + this request or not, defaults to index level setting. + :arg rest_total_hits_as_int: Indicates whether hits.total should + be rendered as an integer or an object in the rest search response. + Default is false. + :arg routing: Comma-separated list of specific routing values. + :arg scroll: Specify how long a consistent view of the index + should be maintained for scrolled search. + :arg search_type: Search operation type. Valid choices are + query_then_fetch, dfs_query_then_fetch. + :arg seq_no_primary_term: Specify whether to return sequence + number and primary term of the last modification of each hit. + :arg size: Number of hits to return. Default is 10. + :arg sort: Comma-separated list of : pairs. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stats: Specific 'tag' of the request for logging and + statistical purposes. + :arg stored_fields: Comma-separated list of stored fields to + return. + :arg suggest_field: Specify which field to use for suggestions. + :arg suggest_mode: Specify suggest mode. Valid choices are + missing, popular, always. + :arg suggest_size: How many suggestions to return in response. + :arg suggest_text: The source text for which the suggestions + should be returned. + :arg terminate_after: The maximum number of documents to collect + for each shard, upon reaching which the query execution will terminate + early. + :arg timeout: Operation timeout. + :arg track_scores: Whether to calculate and return scores even + if they are not used for sorting. + :arg track_total_hits: Indicate if the number of documents that + match the query should be tracked. + :arg typed_keys: Specify whether aggregation and suggester names + should be prefixed by their respective types in the response. + :arg version: Whether to return document version as part of a + hit. + """ + # from is a reserved word so it cannot be used, use from_ instead + if "from_" in params: + params["from"] = params.pop("from_") + + return self.transport.perform_request( + "POST", + "/_plugins/_knn/models/_search", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout") + def stats( + self, + node_id: Any = None, + stat: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Provides information about the current status of the k-NN plugin. + + + :arg node_id: Comma-separated list of node IDs or names to limit + the returned information; use `_local` to return information from the + node you're connecting to, leave empty to get information from all + nodes. + :arg stat: Comma-separated list of stats to retrieve; use `_all` + or empty string to retrieve all stats. Valid choices are + circuit_breaker_triggered, total_load_time, eviction_count, hit_count, + miss_count, graph_memory_usage, graph_memory_usage_percentage, + graph_index_requests, graph_index_errors, graph_query_requests, + graph_query_errors, knn_query_requests, cache_capacity_reached, + load_success_count, load_exception_count, indices_in_cache, + script_compilations, script_compilation_errors, script_query_requests, + script_query_errors, nmslib_initialized, faiss_initialized, + model_index_status, indexing_from_model_degraded, training_requests, + training_errors, training_memory_usage, + training_memory_usage_percentage. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Operation timeout. + """ + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_knn", node_id, "stats", stat), + params=params, + headers=headers, + ) + + @query_params( + "error_trace", "filter_path", "human", "preference", "pretty", "source" + ) + def train_model( + self, + body: Any, + model_id: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Create and train a model that can be used for initializing k-NN native library + indexes during indexing. + + + :arg model_id: The id of the model. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Preferred node to execute training. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if body in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'body'.") + + return self.transport.perform_request( + "POST", + _make_path("_plugins", "_knn", "models", model_id, "_train"), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def warmup( + self, + index: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Preloads native library files into memory, reducing initial search latency for + specified indexes. + + + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if index in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'index'.") + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_knn", "warmup", index), + params=params, + headers=headers, + ) diff --git a/opensearchpy/plugins/notifications.py b/opensearchpy/plugins/notifications.py new file mode 100644 index 000000000..88e6270f4 --- /dev/null +++ b/opensearchpy/plugins/notifications.py @@ -0,0 +1,326 @@ +# 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. + +# ------------------------------------------------------------------------------------------ +# THIS CODE IS AUTOMATICALLY GENERATED AND MANUAL EDITS WILL BE LOST +# +# To contribute, kindly make modifications in the opensearch-py client generator +# or in the OpenSearch API specification, and run `nox -rs generate`. See DEVELOPER_GUIDE.md +# and https://github.com/opensearch-project/opensearch-api-specification for details. +# -----------------------------------------------------------------------------------------+ + + +from typing import Any + +from ..client.utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params + + +class NotificationsClient(NamespacedClient): + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def create_config( + self, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Create channel configuration. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if body in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'body'.") + + return self.transport.perform_request( + "POST", + "/_plugins/_notifications/configs", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def delete_config( + self, + config_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Delete a channel configuration. + + + :arg config_id: The ID of the channel configuration to delete. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if config_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'config_id'.") + + return self.transport.perform_request( + "DELETE", + _make_path("_plugins", "_notifications", "configs", config_id), + params=params, + headers=headers, + ) + + @query_params( + "config_id", + "config_id_list", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + ) + def delete_configs( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Delete multiple channel configurations. + + + :arg config_id: The ID of the channel configuration to delete. + :arg config_id_list: A comma-separated list of channel IDs to + delete. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + return self.transport.perform_request( + "DELETE", "/_plugins/_notifications/configs", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_config( + self, + config_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get a specific channel configuration. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if config_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'config_id'.") + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_notifications", "configs", config_id), + params=params, + headers=headers, + ) + + @query_params( + "chime.url", + "chime.url.keyword", + "config_type", + "created_time_ms", + "description", + "description.keyword", + "email.email_account_id", + "email.email_group_id_list", + "email.recipient_list.recipient", + "email.recipient_list.recipient.keyword", + "email_group.recipient_list.recipient", + "email_group.recipient_list.recipient.keyword", + "error_trace", + "filter_path", + "human", + "is_enabled", + "last_updated_time_ms", + "microsoft_teams.url", + "microsoft_teams.url.keyword", + "name", + "name.keyword", + "pretty", + "query", + "ses_account.from_address", + "ses_account.from_address.keyword", + "ses_account.region", + "ses_account.role_arn", + "ses_account.role_arn.keyword", + "slack.url", + "slack.url.keyword", + "smtp_account.from_address", + "smtp_account.from_address.keyword", + "smtp_account.host", + "smtp_account.host.keyword", + "smtp_account.method", + "sns.role_arn", + "sns.role_arn.keyword", + "sns.topic_arn", + "sns.topic_arn.keyword", + "source", + "text_query", + "webhook.url", + "webhook.url.keyword", + ) + def get_configs( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get multiple channel configurations with filtering. + + + :arg config_type: Type of notification configuration. Valid + choices are slack, chime, microsoft_teams, webhook, email, sns, + ses_account, smtp_account, email_group. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + return self.transport.perform_request( + "GET", + "/_plugins/_notifications/configs", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def list_features( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + List supported channel configurations. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + return self.transport.perform_request( + "GET", "/_plugins/_notifications/features", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def send_test( + self, + config_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Send a test notification. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if config_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'config_id'.") + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_notifications", "feature", "test", config_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def update_config( + self, + config_id: Any, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Update channel configuration. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + for param in (config_id, body): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return self.transport.perform_request( + "PUT", + _make_path("_plugins", "_notifications", "configs", config_id), + params=params, + headers=headers, + body=body, + ) diff --git a/opensearchpy/transport.py b/opensearchpy/transport.py index f582a3be3..5c7e62978 100644 --- a/opensearchpy/transport.py +++ b/opensearchpy/transport.py @@ -29,6 +29,8 @@ from itertools import chain from typing import Any, Callable, Collection, Dict, List, Mapping, Optional, Type, Union +from opensearchpy.metrics import Metrics, MetricsNone + from .connection import Connection, Urllib3HttpConnection from .connection_pool import ConnectionPool, DummyConnectionPool, EmptyConnectionPool from .exceptions import ( @@ -91,6 +93,7 @@ class Transport(object): last_sniff: float sniff_timeout: Optional[float] host_info_callback: Any + metrics: Metrics def __init__( self, @@ -112,6 +115,7 @@ def __init__( retry_on_status: Collection[int] = (502, 503, 504), retry_on_timeout: bool = False, send_get_body_as: str = "GET", + metrics: Metrics = MetricsNone(), **kwargs: Any ) -> None: """ @@ -148,11 +152,15 @@ def __init__( will be serialized and passed as a query parameter `source`. :arg pool_maxsize: Maximum connection pool size used by pool-manager For custom connection-pooling on current session + :arg metrics: metrics is an instance of a subclass of the + :class:`~opensearchpy.Metrics` class, used for collecting + and reporting metrics related to the client's operations; Any extra keyword arguments will be passed to the `connection_class` when creating and instance unless overridden by that connection's options provided as part of the hosts parameter. """ + self.metrics = metrics if connection_class is None: connection_class = self.DEFAULT_CONNECTION_CLASS @@ -242,7 +250,7 @@ def _create_connection(host: Any) -> Any: kwargs.update(host) if self.pool_maxsize and isinstance(self.pool_maxsize, int): kwargs["pool_maxsize"] = self.pool_maxsize - return self.connection_class(**kwargs) + return self.connection_class(metrics=self.metrics, **kwargs) connections = list(zip(map(_create_connection, hosts), hosts)) if len(connections) == 1: diff --git a/samples/poetry.lock b/samples/poetry.lock index 2d733513f..7d4075d58 100644 --- a/samples/poetry.lock +++ b/samples/poetry.lock @@ -1,114 +1,100 @@ -# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "aiohttp" -version = "3.8.6" +version = "3.9.3" description = "Async http client/server framework (asyncio)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "aiohttp-3.8.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:41d55fc043954cddbbd82503d9cc3f4814a40bcef30b3569bc7b5e34130718c1"}, - {file = "aiohttp-3.8.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1d84166673694841d8953f0a8d0c90e1087739d24632fe86b1a08819168b4566"}, - {file = "aiohttp-3.8.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:253bf92b744b3170eb4c4ca2fa58f9c4b87aeb1df42f71d4e78815e6e8b73c9e"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3fd194939b1f764d6bb05490987bfe104287bbf51b8d862261ccf66f48fb4096"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6c5f938d199a6fdbdc10bbb9447496561c3a9a565b43be564648d81e1102ac22"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2817b2f66ca82ee699acd90e05c95e79bbf1dc986abb62b61ec8aaf851e81c93"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0fa375b3d34e71ccccf172cab401cd94a72de7a8cc01847a7b3386204093bb47"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9de50a199b7710fa2904be5a4a9b51af587ab24c8e540a7243ab737b45844543"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e1d8cb0b56b3587c5c01de3bf2f600f186da7e7b5f7353d1bf26a8ddca57f965"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:8e31e9db1bee8b4f407b77fd2507337a0a80665ad7b6c749d08df595d88f1cf5"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:7bc88fc494b1f0311d67f29fee6fd636606f4697e8cc793a2d912ac5b19aa38d"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:ec00c3305788e04bf6d29d42e504560e159ccaf0be30c09203b468a6c1ccd3b2"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ad1407db8f2f49329729564f71685557157bfa42b48f4b93e53721a16eb813ed"}, - {file = "aiohttp-3.8.6-cp310-cp310-win32.whl", hash = "sha256:ccc360e87341ad47c777f5723f68adbb52b37ab450c8bc3ca9ca1f3e849e5fe2"}, - {file = "aiohttp-3.8.6-cp310-cp310-win_amd64.whl", hash = "sha256:93c15c8e48e5e7b89d5cb4613479d144fda8344e2d886cf694fd36db4cc86865"}, - {file = "aiohttp-3.8.6-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6e2f9cc8e5328f829f6e1fb74a0a3a939b14e67e80832975e01929e320386b34"}, - {file = "aiohttp-3.8.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e6a00ffcc173e765e200ceefb06399ba09c06db97f401f920513a10c803604ca"}, - {file = "aiohttp-3.8.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:41bdc2ba359032e36c0e9de5a3bd00d6fb7ea558a6ce6b70acedf0da86458321"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:14cd52ccf40006c7a6cd34a0f8663734e5363fd981807173faf3a017e202fec9"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2d5b785c792802e7b275c420d84f3397668e9d49ab1cb52bd916b3b3ffcf09ad"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1bed815f3dc3d915c5c1e556c397c8667826fbc1b935d95b0ad680787896a358"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:96603a562b546632441926cd1293cfcb5b69f0b4159e6077f7c7dbdfb686af4d"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d76e8b13161a202d14c9584590c4df4d068c9567c99506497bdd67eaedf36403"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e3f1e3f1a1751bb62b4a1b7f4e435afcdade6c17a4fd9b9d43607cebd242924a"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:76b36b3124f0223903609944a3c8bf28a599b2cc0ce0be60b45211c8e9be97f8"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:a2ece4af1f3c967a4390c284797ab595a9f1bc1130ef8b01828915a05a6ae684"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:16d330b3b9db87c3883e565340d292638a878236418b23cc8b9b11a054aaa887"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:42c89579f82e49db436b69c938ab3e1559e5a4409eb8639eb4143989bc390f2f"}, - {file = "aiohttp-3.8.6-cp311-cp311-win32.whl", hash = "sha256:efd2fcf7e7b9d7ab16e6b7d54205beded0a9c8566cb30f09c1abe42b4e22bdcb"}, - {file = "aiohttp-3.8.6-cp311-cp311-win_amd64.whl", hash = "sha256:3b2ab182fc28e7a81f6c70bfbd829045d9480063f5ab06f6e601a3eddbbd49a0"}, - {file = "aiohttp-3.8.6-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:fdee8405931b0615220e5ddf8cd7edd8592c606a8e4ca2a00704883c396e4479"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d25036d161c4fe2225d1abff2bd52c34ed0b1099f02c208cd34d8c05729882f0"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5d791245a894be071d5ab04bbb4850534261a7d4fd363b094a7b9963e8cdbd31"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0cccd1de239afa866e4ce5c789b3032442f19c261c7d8a01183fd956b1935349"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1f13f60d78224f0dace220d8ab4ef1dbc37115eeeab8c06804fec11bec2bbd07"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8a9b5a0606faca4f6cc0d338359d6fa137104c337f489cd135bb7fbdbccb1e39"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:13da35c9ceb847732bf5c6c5781dcf4780e14392e5d3b3c689f6d22f8e15ae31"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:4d4cbe4ffa9d05f46a28252efc5941e0462792930caa370a6efaf491f412bc66"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:229852e147f44da0241954fc6cb910ba074e597f06789c867cb7fb0621e0ba7a"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:713103a8bdde61d13490adf47171a1039fd880113981e55401a0f7b42c37d071"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:45ad816b2c8e3b60b510f30dbd37fe74fd4a772248a52bb021f6fd65dff809b6"}, - {file = "aiohttp-3.8.6-cp36-cp36m-win32.whl", hash = "sha256:2b8d4e166e600dcfbff51919c7a3789ff6ca8b3ecce16e1d9c96d95dd569eb4c"}, - {file = "aiohttp-3.8.6-cp36-cp36m-win_amd64.whl", hash = "sha256:0912ed87fee967940aacc5306d3aa8ba3a459fcd12add0b407081fbefc931e53"}, - {file = "aiohttp-3.8.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e2a988a0c673c2e12084f5e6ba3392d76c75ddb8ebc6c7e9ead68248101cd446"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ebf3fd9f141700b510d4b190094db0ce37ac6361a6806c153c161dc6c041ccda"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3161ce82ab85acd267c8f4b14aa226047a6bee1e4e6adb74b798bd42c6ae1f80"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d95fc1bf33a9a81469aa760617b5971331cdd74370d1214f0b3109272c0e1e3c"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c43ecfef7deaf0617cee936836518e7424ee12cb709883f2c9a1adda63cc460"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca80e1b90a05a4f476547f904992ae81eda5c2c85c66ee4195bb8f9c5fb47f28"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:90c72ebb7cb3a08a7f40061079817133f502a160561d0675b0a6adf231382c92"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:bb54c54510e47a8c7c8e63454a6acc817519337b2b78606c4e840871a3e15349"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:de6a1c9f6803b90e20869e6b99c2c18cef5cc691363954c93cb9adeb26d9f3ae"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:a3628b6c7b880b181a3ae0a0683698513874df63783fd89de99b7b7539e3e8a8"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:fc37e9aef10a696a5a4474802930079ccfc14d9f9c10b4662169671ff034b7df"}, - {file = "aiohttp-3.8.6-cp37-cp37m-win32.whl", hash = "sha256:f8ef51e459eb2ad8e7a66c1d6440c808485840ad55ecc3cafefadea47d1b1ba2"}, - {file = "aiohttp-3.8.6-cp37-cp37m-win_amd64.whl", hash = "sha256:b2fe42e523be344124c6c8ef32a011444e869dc5f883c591ed87f84339de5976"}, - {file = "aiohttp-3.8.6-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:9e2ee0ac5a1f5c7dd3197de309adfb99ac4617ff02b0603fd1e65b07dc772e4b"}, - {file = "aiohttp-3.8.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:01770d8c04bd8db568abb636c1fdd4f7140b284b8b3e0b4584f070180c1e5c62"}, - {file = "aiohttp-3.8.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:3c68330a59506254b556b99a91857428cab98b2f84061260a67865f7f52899f5"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:89341b2c19fb5eac30c341133ae2cc3544d40d9b1892749cdd25892bbc6ac951"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:71783b0b6455ac8f34b5ec99d83e686892c50498d5d00b8e56d47f41b38fbe04"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f628dbf3c91e12f4d6c8b3f092069567d8eb17814aebba3d7d60c149391aee3a"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b04691bc6601ef47c88f0255043df6f570ada1a9ebef99c34bd0b72866c217ae"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7ee912f7e78287516df155f69da575a0ba33b02dd7c1d6614dbc9463f43066e3"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9c19b26acdd08dd239e0d3669a3dddafd600902e37881f13fbd8a53943079dbc"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:99c5ac4ad492b4a19fc132306cd57075c28446ec2ed970973bbf036bcda1bcc6"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:f0f03211fd14a6a0aed2997d4b1c013d49fb7b50eeb9ffdf5e51f23cfe2c77fa"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:8d399dade330c53b4106160f75f55407e9ae7505263ea86f2ccca6bfcbdb4921"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ec4fd86658c6a8964d75426517dc01cbf840bbf32d055ce64a9e63a40fd7b771"}, - {file = "aiohttp-3.8.6-cp38-cp38-win32.whl", hash = "sha256:33164093be11fcef3ce2571a0dccd9041c9a93fa3bde86569d7b03120d276c6f"}, - {file = "aiohttp-3.8.6-cp38-cp38-win_amd64.whl", hash = "sha256:bdf70bfe5a1414ba9afb9d49f0c912dc524cf60141102f3a11143ba3d291870f"}, - {file = "aiohttp-3.8.6-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:d52d5dc7c6682b720280f9d9db41d36ebe4791622c842e258c9206232251ab2b"}, - {file = "aiohttp-3.8.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4ac39027011414dbd3d87f7edb31680e1f430834c8cef029f11c66dad0670aa5"}, - {file = "aiohttp-3.8.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3f5c7ce535a1d2429a634310e308fb7d718905487257060e5d4598e29dc17f0b"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b30e963f9e0d52c28f284d554a9469af073030030cef8693106d918b2ca92f54"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:918810ef188f84152af6b938254911055a72e0f935b5fbc4c1a4ed0b0584aed1"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:002f23e6ea8d3dd8d149e569fd580c999232b5fbc601c48d55398fbc2e582e8c"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4fcf3eabd3fd1a5e6092d1242295fa37d0354b2eb2077e6eb670accad78e40e1"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:255ba9d6d5ff1a382bb9a578cd563605aa69bec845680e21c44afc2670607a95"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d67f8baed00870aa390ea2590798766256f31dc5ed3ecc737debb6e97e2ede78"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:86f20cee0f0a317c76573b627b954c412ea766d6ada1a9fcf1b805763ae7feeb"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:39a312d0e991690ccc1a61f1e9e42daa519dcc34ad03eb6f826d94c1190190dd"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:e827d48cf802de06d9c935088c2924e3c7e7533377d66b6f31ed175c1620e05e"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:bd111d7fc5591ddf377a408ed9067045259ff2770f37e2d94e6478d0f3fc0c17"}, - {file = "aiohttp-3.8.6-cp39-cp39-win32.whl", hash = "sha256:caf486ac1e689dda3502567eb89ffe02876546599bbf915ec94b1fa424eeffd4"}, - {file = "aiohttp-3.8.6-cp39-cp39-win_amd64.whl", hash = "sha256:3f0e27e5b733803333bb2371249f41cf42bae8884863e8e8965ec69bebe53132"}, - {file = "aiohttp-3.8.6.tar.gz", hash = "sha256:b0cf2a4501bff9330a8a5248b4ce951851e415bdcce9dc158e76cfd55e15085c"}, + {file = "aiohttp-3.9.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:939677b61f9d72a4fa2a042a5eee2a99a24001a67c13da113b2e30396567db54"}, + {file = "aiohttp-3.9.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1f5cd333fcf7590a18334c90f8c9147c837a6ec8a178e88d90a9b96ea03194cc"}, + {file = "aiohttp-3.9.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:82e6aa28dd46374f72093eda8bcd142f7771ee1eb9d1e223ff0fa7177a96b4a5"}, + {file = "aiohttp-3.9.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f56455b0c2c7cc3b0c584815264461d07b177f903a04481dfc33e08a89f0c26b"}, + {file = "aiohttp-3.9.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bca77a198bb6e69795ef2f09a5f4c12758487f83f33d63acde5f0d4919815768"}, + {file = "aiohttp-3.9.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e083c285857b78ee21a96ba1eb1b5339733c3563f72980728ca2b08b53826ca5"}, + {file = "aiohttp-3.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ab40e6251c3873d86ea9b30a1ac6d7478c09277b32e14745d0d3c6e76e3c7e29"}, + {file = "aiohttp-3.9.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:df822ee7feaaeffb99c1a9e5e608800bd8eda6e5f18f5cfb0dc7eeb2eaa6bbec"}, + {file = "aiohttp-3.9.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:acef0899fea7492145d2bbaaaec7b345c87753168589cc7faf0afec9afe9b747"}, + {file = "aiohttp-3.9.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:cd73265a9e5ea618014802ab01babf1940cecb90c9762d8b9e7d2cc1e1969ec6"}, + {file = "aiohttp-3.9.3-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:a78ed8a53a1221393d9637c01870248a6f4ea5b214a59a92a36f18151739452c"}, + {file = "aiohttp-3.9.3-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:6b0e029353361f1746bac2e4cc19b32f972ec03f0f943b390c4ab3371840aabf"}, + {file = "aiohttp-3.9.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7cf5c9458e1e90e3c390c2639f1017a0379a99a94fdfad3a1fd966a2874bba52"}, + {file = "aiohttp-3.9.3-cp310-cp310-win32.whl", hash = "sha256:3e59c23c52765951b69ec45ddbbc9403a8761ee6f57253250c6e1536cacc758b"}, + {file = "aiohttp-3.9.3-cp310-cp310-win_amd64.whl", hash = "sha256:055ce4f74b82551678291473f66dc9fb9048a50d8324278751926ff0ae7715e5"}, + {file = "aiohttp-3.9.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6b88f9386ff1ad91ace19d2a1c0225896e28815ee09fc6a8932fded8cda97c3d"}, + {file = "aiohttp-3.9.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c46956ed82961e31557b6857a5ca153c67e5476972e5f7190015018760938da2"}, + {file = "aiohttp-3.9.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:07b837ef0d2f252f96009e9b8435ec1fef68ef8b1461933253d318748ec1acdc"}, + {file = "aiohttp-3.9.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dad46e6f620574b3b4801c68255492e0159d1712271cc99d8bdf35f2043ec266"}, + {file = "aiohttp-3.9.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5ed3e046ea7b14938112ccd53d91c1539af3e6679b222f9469981e3dac7ba1ce"}, + {file = "aiohttp-3.9.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:039df344b45ae0b34ac885ab5b53940b174530d4dd8a14ed8b0e2155b9dddccb"}, + {file = "aiohttp-3.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7943c414d3a8d9235f5f15c22ace69787c140c80b718dcd57caaade95f7cd93b"}, + {file = "aiohttp-3.9.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:84871a243359bb42c12728f04d181a389718710129b36b6aad0fc4655a7647d4"}, + {file = "aiohttp-3.9.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:5eafe2c065df5401ba06821b9a054d9cb2848867f3c59801b5d07a0be3a380ae"}, + {file = "aiohttp-3.9.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:9d3c9b50f19704552f23b4eaea1fc082fdd82c63429a6506446cbd8737823da3"}, + {file = "aiohttp-3.9.3-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:f033d80bc6283092613882dfe40419c6a6a1527e04fc69350e87a9df02bbc283"}, + {file = "aiohttp-3.9.3-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:2c895a656dd7e061b2fd6bb77d971cc38f2afc277229ce7dd3552de8313a483e"}, + {file = "aiohttp-3.9.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1f5a71d25cd8106eab05f8704cd9167b6e5187bcdf8f090a66c6d88b634802b4"}, + {file = "aiohttp-3.9.3-cp311-cp311-win32.whl", hash = "sha256:50fca156d718f8ced687a373f9e140c1bb765ca16e3d6f4fe116e3df7c05b2c5"}, + {file = "aiohttp-3.9.3-cp311-cp311-win_amd64.whl", hash = "sha256:5fe9ce6c09668063b8447f85d43b8d1c4e5d3d7e92c63173e6180b2ac5d46dd8"}, + {file = "aiohttp-3.9.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:38a19bc3b686ad55804ae931012f78f7a534cce165d089a2059f658f6c91fa60"}, + {file = "aiohttp-3.9.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:770d015888c2a598b377bd2f663adfd947d78c0124cfe7b959e1ef39f5b13869"}, + {file = "aiohttp-3.9.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ee43080e75fc92bf36219926c8e6de497f9b247301bbf88c5c7593d931426679"}, + {file = "aiohttp-3.9.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:52df73f14ed99cee84865b95a3d9e044f226320a87af208f068ecc33e0c35b96"}, + {file = "aiohttp-3.9.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc9b311743a78043b26ffaeeb9715dc360335e5517832f5a8e339f8a43581e4d"}, + {file = "aiohttp-3.9.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b955ed993491f1a5da7f92e98d5dad3c1e14dc175f74517c4e610b1f2456fb11"}, + {file = "aiohttp-3.9.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:504b6981675ace64c28bf4a05a508af5cde526e36492c98916127f5a02354d53"}, + {file = "aiohttp-3.9.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a6fe5571784af92b6bc2fda8d1925cccdf24642d49546d3144948a6a1ed58ca5"}, + {file = "aiohttp-3.9.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:ba39e9c8627edc56544c8628cc180d88605df3892beeb2b94c9bc857774848ca"}, + {file = "aiohttp-3.9.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:e5e46b578c0e9db71d04c4b506a2121c0cb371dd89af17a0586ff6769d4c58c1"}, + {file = "aiohttp-3.9.3-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:938a9653e1e0c592053f815f7028e41a3062e902095e5a7dc84617c87267ebd5"}, + {file = "aiohttp-3.9.3-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:c3452ea726c76e92f3b9fae4b34a151981a9ec0a4847a627c43d71a15ac32aa6"}, + {file = "aiohttp-3.9.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:ff30218887e62209942f91ac1be902cc80cddb86bf00fbc6783b7a43b2bea26f"}, + {file = "aiohttp-3.9.3-cp312-cp312-win32.whl", hash = "sha256:38f307b41e0bea3294a9a2a87833191e4bcf89bb0365e83a8be3a58b31fb7f38"}, + {file = "aiohttp-3.9.3-cp312-cp312-win_amd64.whl", hash = "sha256:b791a3143681a520c0a17e26ae7465f1b6f99461a28019d1a2f425236e6eedb5"}, + {file = "aiohttp-3.9.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:0ed621426d961df79aa3b963ac7af0d40392956ffa9be022024cd16297b30c8c"}, + {file = "aiohttp-3.9.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7f46acd6a194287b7e41e87957bfe2ad1ad88318d447caf5b090012f2c5bb528"}, + {file = "aiohttp-3.9.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:feeb18a801aacb098220e2c3eea59a512362eb408d4afd0c242044c33ad6d542"}, + {file = "aiohttp-3.9.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f734e38fd8666f53da904c52a23ce517f1b07722118d750405af7e4123933511"}, + {file = "aiohttp-3.9.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b40670ec7e2156d8e57f70aec34a7216407848dfe6c693ef131ddf6e76feb672"}, + {file = "aiohttp-3.9.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fdd215b7b7fd4a53994f238d0f46b7ba4ac4c0adb12452beee724ddd0743ae5d"}, + {file = "aiohttp-3.9.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:017a21b0df49039c8f46ca0971b3a7fdc1f56741ab1240cb90ca408049766168"}, + {file = "aiohttp-3.9.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e99abf0bba688259a496f966211c49a514e65afa9b3073a1fcee08856e04425b"}, + {file = "aiohttp-3.9.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:648056db9a9fa565d3fa851880f99f45e3f9a771dd3ff3bb0c048ea83fb28194"}, + {file = "aiohttp-3.9.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:8aacb477dc26797ee089721536a292a664846489c49d3ef9725f992449eda5a8"}, + {file = "aiohttp-3.9.3-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:522a11c934ea660ff8953eda090dcd2154d367dec1ae3c540aff9f8a5c109ab4"}, + {file = "aiohttp-3.9.3-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:5bce0dc147ca85caa5d33debc4f4d65e8e8b5c97c7f9f660f215fa74fc49a321"}, + {file = "aiohttp-3.9.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:4b4af9f25b49a7be47c0972139e59ec0e8285c371049df1a63b6ca81fdd216a2"}, + {file = "aiohttp-3.9.3-cp38-cp38-win32.whl", hash = "sha256:298abd678033b8571995650ccee753d9458dfa0377be4dba91e4491da3f2be63"}, + {file = "aiohttp-3.9.3-cp38-cp38-win_amd64.whl", hash = "sha256:69361bfdca5468c0488d7017b9b1e5ce769d40b46a9f4a2eed26b78619e9396c"}, + {file = "aiohttp-3.9.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:0fa43c32d1643f518491d9d3a730f85f5bbaedcbd7fbcae27435bb8b7a061b29"}, + {file = "aiohttp-3.9.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:835a55b7ca49468aaaac0b217092dfdff370e6c215c9224c52f30daaa735c1c1"}, + {file = "aiohttp-3.9.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:06a9b2c8837d9a94fae16c6223acc14b4dfdff216ab9b7202e07a9a09541168f"}, + {file = "aiohttp-3.9.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:abf151955990d23f84205286938796c55ff11bbfb4ccfada8c9c83ae6b3c89a3"}, + {file = "aiohttp-3.9.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:59c26c95975f26e662ca78fdf543d4eeaef70e533a672b4113dd888bd2423caa"}, + {file = "aiohttp-3.9.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f95511dd5d0e05fd9728bac4096319f80615aaef4acbecb35a990afebe953b0e"}, + {file = "aiohttp-3.9.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:595f105710293e76b9dc09f52e0dd896bd064a79346234b521f6b968ffdd8e58"}, + {file = "aiohttp-3.9.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c7c8b816c2b5af5c8a436df44ca08258fc1a13b449393a91484225fcb7545533"}, + {file = "aiohttp-3.9.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:f1088fa100bf46e7b398ffd9904f4808a0612e1d966b4aa43baa535d1b6341eb"}, + {file = "aiohttp-3.9.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f59dfe57bb1ec82ac0698ebfcdb7bcd0e99c255bd637ff613760d5f33e7c81b3"}, + {file = "aiohttp-3.9.3-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:361a1026c9dd4aba0109e4040e2aecf9884f5cfe1b1b1bd3d09419c205e2e53d"}, + {file = "aiohttp-3.9.3-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:363afe77cfcbe3a36353d8ea133e904b108feea505aa4792dad6585a8192c55a"}, + {file = "aiohttp-3.9.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8e2c45c208c62e955e8256949eb225bd8b66a4c9b6865729a786f2aa79b72e9d"}, + {file = "aiohttp-3.9.3-cp39-cp39-win32.whl", hash = "sha256:f7217af2e14da0856e082e96ff637f14ae45c10a5714b63c77f26d8884cf1051"}, + {file = "aiohttp-3.9.3-cp39-cp39-win_amd64.whl", hash = "sha256:27468897f628c627230dba07ec65dc8d0db566923c48f29e084ce382119802bc"}, + {file = "aiohttp-3.9.3.tar.gz", hash = "sha256:90842933e5d1ff760fae6caca4b2b3edba53ba8f4b71e95dacf2818a2aca06f7"}, ] [package.dependencies] aiosignal = ">=1.1.2" -async-timeout = ">=4.0.0a3,<5.0" -asynctest = {version = "0.13.0", markers = "python_version < \"3.8\""} +async-timeout = {version = ">=4.0,<5.0", markers = "python_version < \"3.11\""} attrs = ">=17.3.0" -charset-normalizer = ">=2.0,<4.0" frozenlist = ">=1.1.1" multidict = ">=4.5,<7.0" -typing-extensions = {version = ">=3.7.4", markers = "python_version < \"3.8\""} yarl = ">=1.0,<2.0" [package.extras] -speedups = ["Brotli", "aiodns", "cchardet"] +speedups = ["Brotli", "aiodns", "brotlicffi"] [[package]] name = "aiosignal" @@ -135,20 +121,6 @@ files = [ {file = "async_timeout-4.0.3-py3-none-any.whl", hash = "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028"}, ] -[package.dependencies] -typing-extensions = {version = ">=3.6.5", markers = "python_version < \"3.8\""} - -[[package]] -name = "asynctest" -version = "0.13.0" -description = "Enhance the standard unittest package with features for testing asyncio libraries" -optional = false -python-versions = ">=3.5" -files = [ - {file = "asynctest-0.13.0-py3-none-any.whl", hash = "sha256:5da6118a7e6d6b54d83a8f7197769d046922a44d2a99c21382f0a6e4fadae676"}, - {file = "asynctest-0.13.0.tar.gz", hash = "sha256:c27862842d15d83e6a34eb0b2866c323880eb3a75e4485b079ea11748fd77fac"}, -] - [[package]] name = "attrs" version = "23.1.0" @@ -160,9 +132,6 @@ files = [ {file = "attrs-23.1.0.tar.gz", hash = "sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015"}, ] -[package.dependencies] -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} - [package.extras] cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] dev = ["attrs[docs,tests]", "pre-commit"] @@ -415,26 +384,6 @@ files = [ {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, ] -[[package]] -name = "importlib-metadata" -version = "6.7.0" -description = "Read metadata from Python packages" -optional = false -python-versions = ">=3.7" -files = [ - {file = "importlib_metadata-6.7.0-py3-none-any.whl", hash = "sha256:cb52082e659e97afc5dac71e79de97d8681de3aa07ff18578330904a9d18e5b5"}, - {file = "importlib_metadata-6.7.0.tar.gz", hash = "sha256:1aaf550d4f73e5d6783e7acb77aec43d49da8017410afae93822cc9cca98c4d4"}, -] - -[package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} -zipp = ">=0.5" - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -perf = ["ipython"] -testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] - [[package]] name = "jmespath" version = "1.0.1" @@ -531,25 +480,25 @@ files = [ [[package]] name = "opensearch-py" -version = "0.0.0" +version = "2.5.0" description = "Python client for OpenSearch" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4" +python-versions = ">=3.8, <4" files = [] develop = true [package.dependencies] -aiohttp = {version = ">=3,<4", optional = true, markers = "extra == \"async\""} +aiohttp = {version = ">=3.9.2,<4", optional = true, markers = "extra == \"async\""} certifi = ">=2022.12.07" python-dateutil = "*" requests = ">=2.4.0,<3.0.0" six = "*" -urllib3 = ">=1.26.17" +urllib3 = ">=1.26.18,<2" [package.extras] -async = ["aiohttp (>=3,<4)"] -develop = ["black", "botocore", "coverage (<7.0.0)", "jinja2", "mock", "myst_parser", "pytest (>=3.0.0)", "pytest-cov", "pytest-mock (<4.0.0)", "pytz", "pyyaml", "requests (>=2.0.0,<3.0.0)", "sphinx", "sphinx_copybutton", "sphinx_rtd_theme"] -docs = ["myst_parser", "sphinx", "sphinx_copybutton", "sphinx_rtd_theme"] +async = ["aiohttp (>=3.9.2,<4)"] +develop = ["black (>=24.3.0)", "botocore", "coverage (<8.0.0)", "jinja2", "mock", "myst_parser", "pytest (>=3.0.0)", "pytest-cov", "pytest-mock (<4.0.0)", "pytz", "pyyaml", "requests (>=2.0.0,<3.0.0)", "sphinx", "sphinx_copybutton", "sphinx_rtd_theme"] +docs = ["aiohttp (>=3.9.2,<4)", "myst_parser", "sphinx", "sphinx_copybutton", "sphinx_rtd_theme"] kerberos = ["requests_kerberos"] [package.source] @@ -619,17 +568,6 @@ files = [ {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, ] -[[package]] -name = "typing-extensions" -version = "4.7.1" -description = "Backported and Experimental Type Hints for Python 3.7+" -optional = false -python-versions = ">=3.7" -files = [ - {file = "typing_extensions-4.7.1-py3-none-any.whl", hash = "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36"}, - {file = "typing_extensions-4.7.1.tar.gz", hash = "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2"}, -] - [[package]] name = "urllib3" version = "1.26.18" @@ -646,23 +584,6 @@ brotli = ["brotli (==1.0.9)", "brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotl secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] -[[package]] -name = "urllib3" -version = "2.0.7" -description = "HTTP library with thread-safe connection pooling, file post, and more." -optional = false -python-versions = ">=3.7" -files = [ - {file = "urllib3-2.0.7-py3-none-any.whl", hash = "sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e"}, - {file = "urllib3-2.0.7.tar.gz", hash = "sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84"}, -] - -[package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] -secure = ["certifi", "cryptography (>=1.9)", "idna (>=2.0.0)", "pyopenssl (>=17.1.0)", "urllib3-secure-extra"] -socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] -zstd = ["zstandard (>=0.18.0)"] - [[package]] name = "yarl" version = "1.9.2" @@ -749,24 +670,8 @@ files = [ [package.dependencies] idna = ">=2.0" multidict = ">=4.0" -typing-extensions = {version = ">=3.7.4", markers = "python_version < \"3.8\""} - -[[package]] -name = "zipp" -version = "3.15.0" -description = "Backport of pathlib-compatible object wrapper for zip files" -optional = false -python-versions = ">=3.7" -files = [ - {file = "zipp-3.15.0-py3-none-any.whl", hash = "sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556"}, - {file = "zipp-3.15.0.tar.gz", hash = "sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b"}, -] - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] [metadata] lock-version = "2.0" -python-versions = "^3.7" -content-hash = "b5b82026a5a053bd7c1cf6f8db578509faded763d01d1ed5aee201ba62c17a0a" +python-versions = "^3.8" +content-hash = "5d7c2c4ee621085bb95c08c02f7673612fadc85ee1509da37c22c23afff142b0" diff --git a/samples/pyproject.toml b/samples/pyproject.toml index 8a89367ff..7022ec743 100644 --- a/samples/pyproject.toml +++ b/samples/pyproject.toml @@ -7,7 +7,7 @@ license = "Apache 2.0" readme = "README.md" [tool.poetry.dependencies] -python = "^3.7" +python = "^3.8" opensearch-py = { path = "../", extras=["async"], develop = true } boto3 = "^1.28" diff --git a/setup.py b/setup.py index 057fda184..8198b3648 100644 --- a/setup.py +++ b/setup.py @@ -59,6 +59,7 @@ "six", "python-dateutil", "certifi>=2022.12.07", + "Events", ] tests_require = [ "requests>=2.0.0, <3.0.0", @@ -72,10 +73,10 @@ "pytest-mock<4.0.0", ] -async_require = ["aiohttp>=3,<4"] +async_require = ["aiohttp>=3.9.2,<4"] docs_require = ["sphinx", "sphinx_rtd_theme", "myst_parser", "sphinx_copybutton"] -generate_require = ["black", "jinja2"] +generate_require = ["black>=24.3.0", "jinja2"] setup( name=PACKAGE_NAME, @@ -104,14 +105,15 @@ "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ], - python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", + python_requires=">=3.8, <4", install_requires=install_requires, test_suite="test_opensearchpy.run_tests.run_all", tests_require=tests_require, diff --git a/test_opensearchpy/test_async/test_server/__init__.py b/test_opensearchpy/test_async/test_server/__init__.py index 6a84337cb..ef07ae080 100644 --- a/test_opensearchpy/test_async/test_server/__init__.py +++ b/test_opensearchpy/test_async/test_server/__init__.py @@ -25,7 +25,7 @@ # under the License. -from unittest import IsolatedAsyncioTestCase # type: ignore +from unittest import IsolatedAsyncioTestCase from opensearchpy._async.helpers.test import get_test_client from opensearchpy.connection.async_connections import add_connection @@ -33,7 +33,7 @@ from ...utils import wipe_cluster -class AsyncOpenSearchTestCase(IsolatedAsyncioTestCase): # type: ignore +class AsyncOpenSearchTestCase(IsolatedAsyncioTestCase): async def asyncSetUp( self, ) -> None: diff --git a/test_opensearchpy/test_async/test_server_secured/test_security_plugin.py b/test_opensearchpy/test_async/test_server_secured/test_security_plugin.py index acf3d849b..bb8c9957c 100644 --- a/test_opensearchpy/test_async/test_server_secured/test_security_plugin.py +++ b/test_opensearchpy/test_async/test_server_secured/test_security_plugin.py @@ -10,7 +10,7 @@ from __future__ import unicode_literals -from unittest import IsolatedAsyncioTestCase # type: ignore +from unittest import IsolatedAsyncioTestCase import pytest from _pytest.mark.structures import MarkDecorator @@ -22,7 +22,7 @@ pytestmark: MarkDecorator = pytest.mark.asyncio -class TestSecurityPlugin(IsolatedAsyncioTestCase): # type: ignore +class TestSecurityPlugin(IsolatedAsyncioTestCase): ROLE_NAME = "test-role" ROLE_CONTENT = { "cluster_permissions": ["cluster_monitor"], diff --git a/test_opensearchpy/test_client/test_search_pipeline.py b/test_opensearchpy/test_client/test_search_pipeline.py new file mode 100644 index 000000000..5ec16ea4d --- /dev/null +++ b/test_opensearchpy/test_client/test_search_pipeline.py @@ -0,0 +1,35 @@ +# 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. + +from test_opensearchpy.test_cases import OpenSearchTestCase + + +class TestSearchPipeline(OpenSearchTestCase): + def test_create_search_pipeline(self) -> None: + body = { + "request_processors": [ + { + "filter_query": { + "tag": "tag1", + "description": "This processor returns only publicly visible documents", + "query": {"term": {"visibility": "public"}}, + } + } + ], + "response_processors": [ + {"rename_field": {"field": "message", "target_field": "notification"}} + ], + } + + self.client.search_pipeline.put("my_pipeline", body) + self.assert_url_called("PUT", "/_search/pipeline/my_pipeline") + + def test_get_search_pipeline(self) -> None: + self.client.search_pipeline.get("my_pipeline") + self.assert_url_called("GET", "/_search/pipeline/my_pipeline") diff --git a/test_opensearchpy/test_server/__init__.py b/test_opensearchpy/test_server/__init__.py index 36b548b5d..0e4a974b4 100644 --- a/test_opensearchpy/test_server/__init__.py +++ b/test_opensearchpy/test_server/__init__.py @@ -31,24 +31,24 @@ from opensearchpy.helpers import test from opensearchpy.helpers.test import OpenSearchTestCase as BaseTestCase -client: Any = None +CLIENT: Any = None def get_client(**kwargs: Any) -> Any: - global client - if client is False: + global CLIENT + if CLIENT is False: raise SkipTest("No client is available") - if client is not None and not kwargs: - return client + if CLIENT is not None and not kwargs: + return CLIENT try: new_client = test.get_test_client(**kwargs) except SkipTest: - client = False + CLIENT = False raise if not kwargs: - client = new_client + CLIENT = new_client return new_client diff --git a/test_opensearchpy/test_server/test_metrics.py b/test_opensearchpy/test_server/test_metrics.py new file mode 100644 index 000000000..189fc739c --- /dev/null +++ b/test_opensearchpy/test_server/test_metrics.py @@ -0,0 +1,117 @@ +# 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. + +from __future__ import unicode_literals + +import time + +import pytest + +from opensearchpy import RequestsHttpConnection +from opensearchpy.metrics.metrics_events import MetricsEvents +from opensearchpy.metrics.metrics_none import MetricsNone + +from . import OpenSearchTestCase, get_client + + +class TestMetrics(OpenSearchTestCase): + def tearDown(self) -> None: + client = get_client() + client.indices.delete(index=["test-index"], ignore_unavailable=True) + + def test_metrics_default_behavior(self) -> None: + # Test default behavior when metrics is not passed to the client + client = get_client() + index_name = "test-index" + index_body = {"settings": {"index": {"number_of_shards": 4}}} + try: + client.indices.create(index=index_name, body=index_body) + except Exception as e: + assert False, f"Error creating index: {e}" + + def test_metrics_raises_error_when_value_is_none(self) -> None: + # Test behavior when metrics is given None. + metrics = None + with pytest.raises(AttributeError): + get_client(metrics=metrics) + + def test_metrics_none_behavior(self) -> None: + # Test behavior when metrics is an instance of MetricsNone + metrics = MetricsNone() + client = get_client(metrics=metrics) + index_name = "test-index" + index_body = {"settings": {"index": {"number_of_shards": 4}}} + client.indices.create(index=index_name, body=index_body) + assert metrics.service_time is None + + +class TestMetricsEvents(OpenSearchTestCase): + def tearDown(self) -> None: + client = get_client() + client.indices.delete(index=["test-index"], ignore_unavailable=True) + + def test_metrics_events_with_urllib3_connection(self) -> None: + # Test MetricsEvents behavior with urllib3 connection + metrics = MetricsEvents() + client = get_client(metrics=metrics) + + # Calculate service time for create index operation + index_name = "test-index" + index_body = {"settings": {"index": {"number_of_shards": 4}}} + start1 = time.perf_counter() + client.indices.create(index=index_name, body=index_body) + duration1 = time.perf_counter() - start1 + create_index_service_time = metrics.service_time + assert ( + isinstance(create_index_service_time, float) + and create_index_service_time < duration1 + ) + + # Calculate service time for adding document operation + document = {"title": "Moneyball", "director": "Bennett Miller", "year": "2011"} + id = "1" + start2 = time.perf_counter() + client.index(index=index_name, body=document, id=id, refresh=True) + duration2 = time.perf_counter() - start2 + assert ( + isinstance(metrics.service_time, float) + and metrics.service_time < duration2 + and metrics.service_time != create_index_service_time + # Above check is to confirm service time differs from the previous API call. + ) + + def test_metrics_events_with_requests_http_connection(self) -> None: + # Test MetricsEvents behavior with requests HTTP connection + metrics = MetricsEvents() + client = get_client(metrics=metrics, connection_class=RequestsHttpConnection) + + # Calculate service time for create index operation + index_name = "test-index" + index_body = {"settings": {"index": {"number_of_shards": 4}}} + start1 = time.perf_counter() + client.indices.create(index_name, body=index_body) + duration1 = time.perf_counter() - start1 + create_index_service_time = metrics.service_time + assert ( + isinstance(create_index_service_time, float) + and create_index_service_time < duration1 + ) + + # Calculate service time for adding document operation + document = {"title": "Moneyball", "director": "Bennett Miller", "year": "2011"} + id = "1" + start2 = time.perf_counter() + client.index(index=index_name, body=document, id=id, refresh=True) + duration2 = time.perf_counter() - start2 + assert ( + isinstance(metrics.service_time, float) + and metrics.service_time < duration2 + and metrics.service_time != create_index_service_time + # Above check is to confirm service time differs from the previous API call. + ) diff --git a/test_opensearchpy/test_server/test_plugins/test_notification.py b/test_opensearchpy/test_server/test_plugins/test_notification.py new file mode 100644 index 000000000..54c19ff0e --- /dev/null +++ b/test_opensearchpy/test_server/test_plugins/test_notification.py @@ -0,0 +1,67 @@ +# 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. + + +from __future__ import unicode_literals + +from .. import OpenSearchTestCase + + +class TestNotificationPlugin(OpenSearchTestCase): + async def test_create_channel_notification(self) -> None: + content = { + "config_id": "sample-id", + "name": "sample-name", + "config": { + "name": "Sample Slack Channel", + "description": "This ialerting.create_destination(dummy_destination)s a Slack channel", + "config_type": "slack", + "is_enabled": True, + "slack": {"url": "https://sample-slack-webhook"}, + }, + } + response = self.client.plugins.notifications.create_config(content) + + self.assertNotIn("errors", response) + self.assertIn("config_id", response) + + async def test_list_all_channel_configurations(self) -> None: + response = self.client.plugins.notifications.list_features() + + self.assertNotIn("errors", response) + self.assertIn("config_id", response) + + async def test_list_all_notification_configurations(self) -> None: + response = self.client.plugins.notifications.get_config() + + self.assertNotIn("errors", response) + self.assertIn("config_id", response) + + async def test_get_channel_configuration(self) -> None: + response = self.client.plugins.notifications.get_config(config_id="sample-id") + + self.assertNotIn("errors", response) + self.assertIn("config_id", response) + + async def test_update_channel_configuration(self) -> None: + response = self.client.plugins.notifications.update_config( + config_id="sample-id" + ) + + self.assertNotIn("errors", response) + self.assertIn("config_id", response) + + async def test_delete_channel_configuration(self) -> None: + # Try fetching the destination + response = self.client.plugins.notifications.delete_config( + config_id="sample-id" + ) + + self.assertNotIn("errors", response) + self.assertIn("config_id", response) diff --git a/test_opensearchpy/test_server/test_rest_api_spec.py b/test_opensearchpy/test_server/test_rest_api_spec.py index 8f9655019..d493caf6a 100644 --- a/test_opensearchpy/test_server/test_rest_api_spec.py +++ b/test_opensearchpy/test_server/test_rest_api_spec.py @@ -90,6 +90,8 @@ "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/tasks/list/10_basic[0]", "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/index/90_unsigned_long[1]", "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/indices/stats/50_noop_update[0]", + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/search/340_doc_values_field[0]", + "OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/search/340_doc_values_field[1]", "search/aggregation/250_moving_fn[1]", # body: null "indices/simulate_index_template/10_basic[2]", @@ -369,10 +371,10 @@ def run_match(self, action: Any) -> None: if ( isinstance(expected, str) - and expected.startswith("/") - and expected.endswith("/") + and expected.strip().startswith("/") + and expected.strip().endswith("/") ): - expected = re.compile(expected[1:-1], re.VERBOSE | re.MULTILINE) + expected = re.compile(expected.strip()[1:-1], re.VERBOSE | re.MULTILINE) assert expected.search(value), "%r does not match %r" % ( value, expected, @@ -415,9 +417,7 @@ def _resolve(self, value: Any) -> Any: value = value.replace(key_replace, v) break - if isinstance(value, string_types): - value = value.strip() - elif isinstance(value, dict): + if isinstance(value, dict): value = dict((k, self._resolve(v)) for (k, v) in value.items()) elif isinstance(value, list): value = list(map(self._resolve, value)) diff --git a/utils/build_dists.py b/utils/build_dists.py index bb9d537e5..e1cd6ed1a 100644 --- a/utils/build_dists.py +++ b/utils/build_dists.py @@ -44,7 +44,7 @@ @contextlib.contextmanager # type: ignore -def set_tmp_dir() -> None: +def set_tmp_dir() -> None: # type: ignore """ makes and yields a temporary directory for any working files needed for a process during a build """ diff --git a/utils/changelog_updater.py b/utils/changelog_updater.py new file mode 100644 index 000000000..7021c10c7 --- /dev/null +++ b/utils/changelog_updater.py @@ -0,0 +1,67 @@ +# 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. + +import subprocess + +import requests + + +def main() -> None: + """ + Update CHANGELOG.md when API generator produces new code differing from existing. + """ + git_command = "git status" + try: + git_status = subprocess.check_output( + git_command, shell=True, stderr=subprocess.STDOUT + ) + if ( + "Changes to be committed:" in git_status.decode() + or "Changes not staged for commit:" in git_status.decode() + or "Untracked files:" in git_status.decode() + ): + print("Changes detected; updating changelog.") + + base_url = "https://api.github.com/repos/opensearch-project/opensearch-api-specification/commits" + url_with_per_page = base_url + "?per_page=1" + response = requests.get(url_with_per_page) + if response.ok: + commit_info = response.json()[0] + commit_url = commit_info["html_url"] + latest_commit_sha = commit_info.get("sha") + else: + raise Exception( + f"Failed to fetch opensearch-api-specification commit information. Status code: {response.status_code}" + ) + + with open("CHANGELOG.md", "r+", encoding="utf-8") as file: + content = file.read() + if commit_url not in content: + if "### Updated APIs" in content: + file_content = content.replace( + "### Updated APIs", + f"### Updated APIs\n- Updated opensearch-py APIs to reflect [opensearch-api-specification@{latest_commit_sha[:7]}]({commit_url})", + 1, + ) + file.seek(0) + file.write(file_content) + file.truncate() + else: + raise Exception( + "'Updated APIs' section is not present in CHANGELOG.md" + ) + else: + print("No changes detected") + + except subprocess.CalledProcessError as e: + print(f"Error occurred while checking Git status: {e}") + + +if __name__ == "__main__": + main() diff --git a/utils/generate_api.py b/utils/generate_api.py index 475782e39..6d6fa4ead 100644 --- a/utils/generate_api.py +++ b/utils/generate_api.py @@ -44,6 +44,7 @@ import requests import unasync import urllib3 +import yaml from click.testing import CliRunner from jinja2 import Environment, FileSystemLoader, TemplateNotFound, select_autoescape @@ -100,9 +101,10 @@ def is_valid_url(url: str) -> bool: class Module: - def __init__(self, namespace: str) -> None: + def __init__(self, namespace: str, is_plugin: bool) -> None: self.namespace: Any = namespace self._apis: Any = [] + self.is_plugin: bool = is_plugin self.parse_orig() def add(self, api: Any) -> None: @@ -117,10 +119,11 @@ def parse_orig(self) -> None: reads the written module and updates with important code specific to this client """ self.orders = [] - self.header = "from typing import Any, Collection, Optional, Tuple, Union\n\n" - - namespace_new = "".join(word.capitalize() for word in self.namespace.split("_")) - self.header += "class " + namespace_new + "Client(NamespacedClient):" + self.header = "from typing import Any\n\n" + self.namespace_new = "".join( + word.capitalize() for word in self.namespace.split("_") + ) + self.header += "class " + self.namespace_new + "Client(NamespacedClient):" if os.path.exists(self.filepath): with open(self.filepath, encoding="utf-8") as file: content = file.read() @@ -163,7 +166,45 @@ def dump(self) -> None: writes the module out to disk """ self.sort() + if not os.path.exists(self.filepath): + # Imports added for new namespaces in appropriate files. + if self.is_plugin: + with open( + "opensearchpy/_async/client/plugins.py", "r+", encoding="utf-8" + ) as file: + content = file.read() + file_content = content.replace( + "super(PluginsClient, self).__init__(client)", + f"super(PluginsClient, self).__init__(client)\n self.{self.namespace} = {self.namespace_new}Client(client)", # pylint: disable=line-too-long + 1, + ) + new_file_content = file_content.replace( + "from .client import Client", + f"from ..plugins.{self.namespace} import {self.namespace_new}Client\nfrom .client import Client", # pylint: disable=line-too-long + 1, + ) + file.seek(0) + file.write(new_file_content) + file.truncate() + else: + with open( + "opensearchpy/_async/client/__init__.py", "r+", encoding="utf-8" + ) as file: + content = file.read() + file_content = content.replace( + "# namespaced clients for compatibility with API names", + f"# namespaced clients for compatibility with API names\n self.{self.namespace} = {self.namespace_new}Client(self)", # pylint: disable=line-too-long + 1, + ) + new_file_content = file_content.replace( + "from .utils import", + f"from .{self.namespace} import {self.namespace_new}Client\nfrom .utils import", # pylint: disable=line-too-long + 1, + ) + file.seek(0) + file.write(new_file_content) + file.truncate() # This code snippet adds headers to each generated module indicating # that the code is generated.The separator is the last line in the # "THIS CODE IS AUTOMATICALLY GENERATED" header. @@ -208,8 +249,14 @@ def dump(self) -> None: # Imports are temporarily removed from the header and are regenerated # later to ensure imports are updated after code generation. + utils = ".utils" + if self.is_plugin: + utils = "..client.utils" + self.header = "\n".join( - line for line in self.header.split("\n") if "from .utils import" not in line + line + for line in self.header.split("\n") + if "from " + utils + " import" not in line ) with open(self.filepath, "w", encoding="utf-8") as file: @@ -251,7 +298,7 @@ def dump(self) -> None: present_keywords = [keyword for keyword in keywords if keyword in content] if present_keywords: - utils_imports = "from .utils import" + utils_imports = "from " + utils + " import" result = f"{utils_imports} {', '.join(present_keywords)}" utils_imports = result file_content = content.replace("#replace_token#", utils_imports) @@ -264,7 +311,10 @@ def filepath(self) -> Any: """ :return: absolute path to the module """ - return CODE_ROOT / f"opensearchpy/_async/client/{self.namespace}.py" + if self.is_plugin: + return CODE_ROOT / f"opensearchpy/_async/plugins/{self.namespace}.py" + else: + return CODE_ROOT / f"opensearchpy/_async/client/{self.namespace}.py" class API: @@ -336,6 +386,22 @@ def all_parts(self) -> Dict[str, str]: if self.namespace == "tasks" and self.name == "get": parts["task_id"]["required"] = False + # Workaround to prevent lint error: invalid escape sequence '\`' + if ( + self.namespace == "indices" + and self.name == "create_data_stream" + and part == "name" + ): + replace_str = r"`\`, " + # Replace the string in the description + parts["name"]["description"] = parts["name"]["description"].replace( + replace_str, "" + ) + if "backslash" not in parts["name"]["description"]: + parts["name"]["description"] = parts["name"]["description"].replace( + "`:`", "`:`, backslash" + ) + for k, sub in SUBSTITUTIONS.items(): if k in parts: parts[sub] = parts.pop(k) @@ -484,7 +550,7 @@ def to_python(self) -> Any: def read_modules() -> Any: """ checks the opensearch-api spec at - https://raw.githubusercontent.com/opensearch-project/opensearch-api-specification/main/OpenSearch.openapi.json + https://github.com/opensearch-project/opensearch-api-specification/releases/download/main/opensearch-openapi.yaml and parses it into one or more API modules :return: a dict of API objects """ @@ -492,32 +558,45 @@ def read_modules() -> Any: # Load the OpenAPI specification file response = requests.get( - "https://raw.githubusercontent.com/opensearch-project/opensearch-api-" - "specification/main/OpenSearch.openapi.json" + "https://github.com/opensearch-project/opensearch-api-specification/releases/download/main/opensearch-openapi.yaml" ) - data = response.json() + data = yaml.safe_load(response.text) list_of_dicts = [] for path in data["paths"]: - for param in data["paths"][path]: # pylint: disable=invalid-name - if data["paths"][path][param]["x-operation-group"] == "nodes.hot_threads": - if "deprecated" in data["paths"][path][param]: + for method in data["paths"][path]: + # Workaround for excluding deprecated path of 'nodes.hot_threads' + if data["paths"][path][method]["x-operation-group"] == "nodes.hot_threads": + if "deprecated" in data["paths"][path][method]: continue - data["paths"][path][param].update({"path": path, "method": param}) - list_of_dicts.append(data["paths"][path][param]) + + data["paths"][path][method].update({"path": path, "method": method}) + list_of_dicts.append(data["paths"][path][method]) + + # 'list_of_dicts' contains dictionaries, each representing a possible API endpoint # Update parameters in each endpoint - for param_dict in list_of_dicts: - if "parameters" in param_dict: + for endpoint in list_of_dicts: + if "parameters" in endpoint: params = [] parts = [] # Iterate over the list of parameters and update them - for param in param_dict["parameters"]: + for param_ref in endpoint["parameters"]: + param = data["components"]["parameters"][ + param_ref["$ref"].split("/")[-1] + ] if "schema" in param and "$ref" in param["schema"]: schema_path_ref = param["schema"]["$ref"].split("/")[-1] param["schema"] = data["components"]["schemas"][schema_path_ref] + if "oneOf" in param["schema"]: + for element in param["schema"]["oneOf"]: + if "$ref" in element: + common_schema_path_ref = element["$ref"].split("/")[-1] + param["schema"] = data["components"]["schemas"][ + common_schema_path_ref + ] params.append(param) else: params.append(param) @@ -533,68 +612,68 @@ def read_modules() -> Any: params_new = {} parts_new = {} - for m in params: # pylint: disable=invalid-name - a = dict( # pylint: disable=invalid-name - type=m["schema"]["type"], description=m["description"] - ) # pylint: disable=invalid-name + for param in params: + param_dict: Dict[str, Any] = {} + if "description" in param: + param_dict.update( + description=param["description"].replace("\n", "") + ) + + if "type" in param["schema"]: + param_dict.update({"type": param["schema"]["type"]}) + + if "default" in param["schema"]: + param_dict.update({"default": param["schema"]["default"]}) - if "default" in m["schema"]: - a.update({"default": m["schema"]["default"]}) + if "enum" in param["schema"]: + param_dict.update({"type": "enum"}) + param_dict.update({"options": param["schema"]["enum"]}) - if "enum" in m["schema"]: - a.update({"type": "enum"}) - a.update({"options": m["schema"]["enum"]}) + if "deprecated" in param: + param_dict.update({"deprecated": param["deprecated"]}) - if "deprecated" in m["schema"]: - a.update({"deprecated": m["schema"]["deprecated"]}) - a.update( - {"deprecation_message": m["schema"]["x-deprecation-message"]} + if "x-deprecation-message" in param: + param_dict.update( + {"deprecation_message": param["x-deprecation-message"]} ) - params_new.update({m["name"]: a}) + params_new.update({param["name"]: param_dict}) # Removing the deprecated "type" if ( - param_dict["x-operation-group"] != "nodes.hot_threads" + endpoint["x-operation-group"] != "nodes.hot_threads" and "type" in params_new ): params_new.pop("type") if ( - param_dict["x-operation-group"] == "cluster.health" + endpoint["x-operation-group"] == "cluster.health" and "ensure_node_commissioned" in params_new ): params_new.pop("ensure_node_commissioned") if bool(params_new): - param_dict.update({"params": params_new}) + endpoint.update({"params": params_new}) - param_dict.pop("parameters") + for part in parts: + parts_dict: Dict[str, Any] = {} + if "type" in part["schema"]: + parts_dict.update(type=part["schema"]["type"]) - for n in parts: # pylint: disable=invalid-name - b = dict(type=n["schema"]["type"]) # pylint: disable=invalid-name - - if "description" in n: - b.update({"description": n["description"]}) - - if "x-enum-options" in n["schema"]: - b.update({"options": n["schema"]["x-enum-options"]}) - - deprecated_new = {} - if "deprecated" in n: - b.update({"deprecated": n["deprecated"]}) + if "description" in part: + parts_dict.update( + {"description": part["description"].replace("\n", " ")} + ) - if "x-deprecation-version" in n: - deprecated_new.update({"version": n["x-deprecation-version"]}) + if "x-enum-options" in part["schema"]: + parts_dict.update({"options": part["schema"]["x-enum-options"]}) - if "x-deprecation-description" in n: - deprecated_new.update( - {"description": n["x-deprecation-description"]} - ) + if "deprecated" in part: + parts_dict.update({"deprecated": part["deprecated"]}) - parts_new.update({n["name"]: b}) + parts_new.update({part["name"]: parts_dict}) if bool(parts_new): - param_dict.update({"parts": parts_new}) + endpoint.update({"parts": parts_new}) # Sort the input list by the value of the "x-operation-group" key list_of_dicts = sorted(list_of_dicts, key=itemgetter("x-operation-group")) @@ -614,54 +693,58 @@ def read_modules() -> Any: paths = [] all_paths_have_deprecation = True - for key2, value2 in groupby(value, key=itemgetter("path")): + for path, path_dicts in groupby(value, key=itemgetter("path")): # Extract the HTTP methods from the data in the current subgroup methods = [] parts_final = {} - for z in value2: # pylint: disable=invalid-name - methods.append(z["method"].upper()) + for method_dict in path_dicts: + methods.append(method_dict["method"].upper()) # Update 'api' dictionary if "documentation" not in api: - documentation = {"description": z["description"]} + documentation = {"description": method_dict["description"]} api.update({"documentation": documentation}) - if "x-deprecation-message" in z: - x_deprecation_message = z["x-deprecation-message"] + if "x-deprecation-message" in method_dict: + x_deprecation_message = method_dict["x-deprecation-message"] else: all_paths_have_deprecation = False - if "params" not in api and "params" in z: - api.update({"params": z["params"]}) + if "params" not in api and "params" in method_dict: + api.update({"params": method_dict["params"]}) - if "body" not in api and "requestBody" in z: + if ( + "body" not in api + and "requestBody" in method_dict + and "$ref" in method_dict["requestBody"] + ): + requestbody_ref = method_dict["requestBody"]["$ref"].split("/")[-1] body = {"required": False} - if "required" in z["requestBody"]: - body.update({"required": z["requestBody"]["required"]}) - q = z["requestBody"]["content"][ # pylint: disable=invalid-name - "application/json" - ]["schema"]["$ref"].split("/")[-1] - if "description" in data["components"]["schemas"][q]: - body.update( - { - "description": data["components"]["schemas"][q][ - "description" - ] - } - ) - if "x-serialize" in data["components"]["schemas"][q]: + if ( + "required" + in data["components"]["requestBodies"][requestbody_ref] + ): body.update( { - "serialize": data["components"]["schemas"][q][ - "x-serialize" - ] + "required": data["components"]["requestBodies"][ + requestbody_ref + ]["required"] } ) + q = data["components"]["requestBodies"][requestbody_ref]["content"][ + "application/json" + ][ + "schema" + ] # pylint: disable=invalid-name + if "description" in q: + body.update({"description": q["description"]}) + if "x-serialize" in q: + body.update({"serialize": q["x-serialize"]}) api.update({"body": body}) - if "parts" in z: - parts_final.update(z["parts"]) + if "parts" in method_dict: + parts_final.update(method_dict["parts"]) if "POST" in methods or "PUT" in methods: api.update( @@ -683,19 +766,10 @@ def read_modules() -> Any: } ) - if bool(deprecated_new) and bool(parts_final): - paths.append( - { - "path": key2, - "methods": methods, - "parts": parts_final, - "deprecated": deprecated_new, - } - ) - elif bool(parts_final): - paths.append({"path": key2, "methods": methods, "parts": parts_final}) + if bool(parts_final): + paths.append({"path": path, "methods": methods, "parts": parts_final}) else: - paths.append({"path": key2, "methods": methods}) + paths.append({"path": path, "methods": methods}) api.update({"url": {"paths": paths}}) if all_paths_have_deprecation and x_deprecation_message is not None: @@ -703,8 +777,12 @@ def read_modules() -> Any: api = apply_patch(namespace, name, api) + is_plugin = False + if "_plugins" in api["url"]["paths"][0]["path"] and namespace != "security": + is_plugin = True + if namespace not in modules: - modules[namespace] = Module(namespace) + modules[namespace] = Module(namespace, is_plugin) modules[namespace].add(API(namespace, name, api)) @@ -751,13 +829,20 @@ def dump_modules(modules: Any) -> None: todir="/opensearchpy/client/", additional_replacements=additional_replacements, ), + unasync.Rule( + fromdir="/opensearchpy/_async/plugins/", + todir="/opensearchpy/plugins/", + additional_replacements=additional_replacements, + ), ] filepaths = [] for root, _, filenames in os.walk(CODE_ROOT / "opensearchpy/_async"): for filename in filenames: - if filename.rpartition(".")[-1] in ("py",) and not filename.startswith( - "utils.py" + if filename.rpartition(".")[-1] in ("py",) and filename not in ( + "utils.py", + "index_management.py", + "alerting.py", ): filepaths.append(os.path.join(root, filename)) diff --git a/utils/license_headers.py b/utils/license_headers.py index 0405476e2..86582c9d4 100644 --- a/utils/license_headers.py +++ b/utils/license_headers.py @@ -79,7 +79,7 @@ def add_header_to_file(filepath: str) -> None: for i, line in enumerate(lines): if len(line) > 0 and line not in LINES_TO_KEEP: break - lines = lines[:i] + [LICENSE_HEADER] + lines[i:] + lines = lines[:i] + [LICENSE_HEADER + "\n\n"] + lines[i:] with open(filepath, mode="w", encoding="utf-8") as file: file.truncate() file.write("".join(lines)) diff --git a/utils/templates/base b/utils/templates/base index 54db34511..fa0ba2137 100644 --- a/utils/templates/base +++ b/utils/templates/base @@ -22,7 +22,7 @@ {% for p, info in api.params %} {% if info.description %} {% filter wordwrap(72, wrapstring="\n ") %} - :arg {{ p }}{% if info.deprecated %} (Deprecated: {{ info['deprecation_message'][:-1] }}.){% endif %}: {{ info.description }} {% if info.options %}Valid choices are {{ info.options|join(", ") }}.{% endif %} + :arg {{ p }}{% if info.deprecated and info.deprecation_message is defined %} (Deprecated: {{ info['deprecation_message'][:-1] }}.){% endif %}: {{ info.description }} {% if info.options and "Valid values" not in info.description %}Valid choices are {{ info.options|join(", ") }}.{% endif %} {% if info.default is defined %}{% if info.default is not none %}{% if info.default is sameas(false) %}Default is false.{% else %}Default is {{ info.default }}.{% endif %}{% endif %}{% endif %} {% endfilter %} From e8c413da77f11479897a894443f71f41dbe83e74 Mon Sep 17 00:00:00 2001 From: AbitraryYu Date: Tue, 23 Apr 2024 10:31:29 +0800 Subject: [PATCH 2/5] Add back the lines of comment in indices.py during resolving merge conflict. Signed-off-by: AbitraryYu --- opensearchpy/client/indices.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opensearchpy/client/indices.py b/opensearchpy/client/indices.py index 9768335b9..27894be01 100644 --- a/opensearchpy/client/indices.py +++ b/opensearchpy/client/indices.py @@ -2415,8 +2415,10 @@ def get_index_template( statistics. :arg local: If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved - from the master node. + from the master node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is received before the timeout expires, the request fails and returns an error. :arg pretty: Whether to pretty format the returned JSON response. From 2db146cda2c895020febe57ea1c0995f48e57cf0 Mon Sep 17 00:00:00 2001 From: AbitraryYu Date: Thu, 25 Apr 2024 11:52:08 +0800 Subject: [PATCH 3/5] Fix notification plugin tests, from async def to def. Signed-off-by: AbitraryYu --- .../test_plugins/test_notification.py | 48 +++++++++++-------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/test_opensearchpy/test_server/test_plugins/test_notification.py b/test_opensearchpy/test_server/test_plugins/test_notification.py index 54c19ff0e..095482170 100644 --- a/test_opensearchpy/test_server/test_plugins/test_notification.py +++ b/test_opensearchpy/test_server/test_plugins/test_notification.py @@ -14,42 +14,51 @@ class TestNotificationPlugin(OpenSearchTestCase): - async def test_create_channel_notification(self) -> None: - content = { - "config_id": "sample-id", - "name": "sample-name", - "config": { - "name": "Sample Slack Channel", - "description": "This ialerting.create_destination(dummy_destination)s a Slack channel", - "config_type": "slack", - "is_enabled": True, - "slack": {"url": "https://sample-slack-webhook"}, - }, - } - response = self.client.plugins.notifications.create_config(content) + CONTENT = { + "config_id": "sample-id", + "name": "sample-name", + "config": { + "name": "Sample Slack Channel", + "description": "This ialerting.create_destination(dummy_destination)s a Slack channel", + "config_type": "slack", + "is_enabled": True, + "slack": {"url": "https://sample-slack-webhook"}, + }, + } + + def test_create_channel_notification(self) -> None: + response = self.client.plugins.notifications.create_config(self.CONTENT) self.assertNotIn("errors", response) self.assertIn("config_id", response) - async def test_list_all_channel_configurations(self) -> None: + def test_list_all_channel_configurations(self) -> None: + self.test_create_channel_notification() + response = self.client.plugins.notifications.list_features() self.assertNotIn("errors", response) self.assertIn("config_id", response) - async def test_list_all_notification_configurations(self) -> None: + def test_list_all_notification_configurations(self) -> None: + self.test_create_channel_notification() + response = self.client.plugins.notifications.get_config() self.assertNotIn("errors", response) self.assertIn("config_id", response) - async def test_get_channel_configuration(self) -> None: + def test_get_channel_configuration(self) -> None: + self.test_create_channel_notification() + response = self.client.plugins.notifications.get_config(config_id="sample-id") self.assertNotIn("errors", response) self.assertIn("config_id", response) - async def test_update_channel_configuration(self) -> None: + def test_update_channel_configuration(self) -> None: + self.test_create_channel_notification() + response = self.client.plugins.notifications.update_config( config_id="sample-id" ) @@ -57,8 +66,9 @@ async def test_update_channel_configuration(self) -> None: self.assertNotIn("errors", response) self.assertIn("config_id", response) - async def test_delete_channel_configuration(self) -> None: - # Try fetching the destination + def test_delete_channel_configuration(self) -> None: + self.test_create_channel_notification() + response = self.client.plugins.notifications.delete_config( config_id="sample-id" ) From 324054050e623a4666fadcfe07e4eac96f078544 Mon Sep 17 00:00:00 2001 From: AbitraryYu Date: Sun, 28 Apr 2024 16:45:28 +0800 Subject: [PATCH 4/5] Fix test errors. Rename function names and rewrite assertion tests. Signed-off-by: AbitraryYu --- .../test_plugins/test_notification.py | 89 ++++++++++++++----- 1 file changed, 68 insertions(+), 21 deletions(-) diff --git a/test_opensearchpy/test_server/test_plugins/test_notification.py b/test_opensearchpy/test_server/test_plugins/test_notification.py index 095482170..34875e2f0 100644 --- a/test_opensearchpy/test_server/test_plugins/test_notification.py +++ b/test_opensearchpy/test_server/test_plugins/test_notification.py @@ -10,10 +10,17 @@ from __future__ import unicode_literals +import unittest + +from opensearchpy.helpers.test import OPENSEARCH_VERSION + +from opensearchpy.exceptions import NotFoundError + from .. import OpenSearchTestCase class TestNotificationPlugin(OpenSearchTestCase): + CONFIG_ID = "sample-id" CONTENT = { "config_id": "sample-id", "name": "sample-name", @@ -26,52 +33,92 @@ class TestNotificationPlugin(OpenSearchTestCase): }, } - def test_create_channel_notification(self) -> None: + @unittest.skipUnless( + (OPENSEARCH_VERSION) and (OPENSEARCH_VERSION >= (2, 0, 0)), + "Plugin not supported for opensearch version", + ) + def test_create_config(self) -> None: response = self.client.plugins.notifications.create_config(self.CONTENT) self.assertNotIn("errors", response) self.assertIn("config_id", response) - def test_list_all_channel_configurations(self) -> None: - self.test_create_channel_notification() + @unittest.skipUnless( + (OPENSEARCH_VERSION) and (OPENSEARCH_VERSION >= (2, 0, 0)), + "Plugin not supported for opensearch version", + ) + def test_list_channel_config(self) -> None: + self.test_create_config() response = self.client.plugins.notifications.list_features() self.assertNotIn("errors", response) - self.assertIn("config_id", response) + self.assertIn("allowed_config_type_list", response) - def test_list_all_notification_configurations(self) -> None: - self.test_create_channel_notification() + @unittest.skipUnless( + (OPENSEARCH_VERSION) and (OPENSEARCH_VERSION >= (2, 0, 0)), + "Plugin not supported for opensearch version", + ) + def test_list_all_config(self) -> None: + self.test_create_config() - response = self.client.plugins.notifications.get_config() + response = self.client.plugins.notifications.get_configs() self.assertNotIn("errors", response) - self.assertIn("config_id", response) + self.assertIn("config_list", response) - def test_get_channel_configuration(self) -> None: - self.test_create_channel_notification() + @unittest.skipUnless( + (OPENSEARCH_VERSION) and (OPENSEARCH_VERSION >= (2, 0, 0)), + "Plugin not supported for opensearch version", + ) + def test_get_config(self) -> None: + self.test_create_config() - response = self.client.plugins.notifications.get_config(config_id="sample-id") + response = self.client.plugins.notifications.get_config(config_id=self.CONFIG_ID) self.assertNotIn("errors", response) - self.assertIn("config_id", response) - - def test_update_channel_configuration(self) -> None: - self.test_create_channel_notification() - + self.assertIn("config_list", response) + self.assertEqual(response["config_list"][0]["config_id"], self.CONFIG_ID) + + @unittest.skipUnless( + (OPENSEARCH_VERSION) and (OPENSEARCH_VERSION >= (2, 0, 0)), + "Plugin not supported for opensearch version", + ) + def test_update_config(self) -> None: + # Create configuration + self.test_create_config() + + # Fetch the configuration + response = self.client.plugins.notifications.get_config(self.CONFIG_ID) + + channel_content = self.CONTENT.copy() + channel_content["config"]["name"] = "Slack Channel" + channel_content["config"]["description"] = "This is an updated channel configuration" + channel_content["config"]["config_type"] = "slack" + channel_content["config"]["is_enabled"] = True + channel_content["config"]["slack"]["url"] = "https://hooks.slack.com/sample-url" + + # Test to updat configuration response = self.client.plugins.notifications.update_config( - config_id="sample-id" + config_id=self.CONFIG_ID, body=channel_content ) self.assertNotIn("errors", response) self.assertIn("config_id", response) - def test_delete_channel_configuration(self) -> None: - self.test_create_channel_notification() + @unittest.skipUnless( + (OPENSEARCH_VERSION) and (OPENSEARCH_VERSION >= (2, 0, 0)), + "Plugin not supported for opensearch version", + ) + def test_delete_config(self) -> None: + self.test_create_config() response = self.client.plugins.notifications.delete_config( - config_id="sample-id" + config_id=self.CONFIG_ID ) self.assertNotIn("errors", response) - self.assertIn("config_id", response) + + # Try fetching the policy + with self.assertRaises(NotFoundError): + response = self.client.plugins.notifications.get_config(self.CONFIG_ID) From 891c250f63c5c578dd468cd984aecc11f14f3b85 Mon Sep 17 00:00:00 2001 From: AbitraryYu Date: Tue, 30 Apr 2024 14:42:59 +0800 Subject: [PATCH 5/5] Fix formatting errors. Added typings to CONTENT. Signed-off-by: AbitraryYu --- .../test_server/test_plugins/test_notification.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test_opensearchpy/test_server/test_plugins/test_notification.py b/test_opensearchpy/test_server/test_plugins/test_notification.py index 34875e2f0..6782b4275 100644 --- a/test_opensearchpy/test_server/test_plugins/test_notification.py +++ b/test_opensearchpy/test_server/test_plugins/test_notification.py @@ -11,17 +11,17 @@ from __future__ import unicode_literals import unittest - -from opensearchpy.helpers.test import OPENSEARCH_VERSION +from typing import Any, Dict from opensearchpy.exceptions import NotFoundError +from opensearchpy.helpers.test import OPENSEARCH_VERSION from .. import OpenSearchTestCase class TestNotificationPlugin(OpenSearchTestCase): CONFIG_ID = "sample-id" - CONTENT = { + CONTENT: Dict[str, Any] = { "config_id": "sample-id", "name": "sample-name", "config": { @@ -74,7 +74,9 @@ def test_list_all_config(self) -> None: def test_get_config(self) -> None: self.test_create_config() - response = self.client.plugins.notifications.get_config(config_id=self.CONFIG_ID) + response = self.client.plugins.notifications.get_config( + config_id=self.CONFIG_ID + ) self.assertNotIn("errors", response) self.assertIn("config_list", response) @@ -93,7 +95,9 @@ def test_update_config(self) -> None: channel_content = self.CONTENT.copy() channel_content["config"]["name"] = "Slack Channel" - channel_content["config"]["description"] = "This is an updated channel configuration" + channel_content["config"][ + "description" + ] = "This is an updated channel configuration" channel_content["config"]["config_type"] = "slack" channel_content["config"]["is_enabled"] = True channel_content["config"]["slack"]["url"] = "https://hooks.slack.com/sample-url"