Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Updated opensearch-py to reflect the latest OpenSearch API spec #33

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/update_api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Update API
on:
workflow_dispatch:
schedule:
- cron: "30 3 * * *"
jobs:
update-api:
if: ${{ github.repository == 'saimedhi/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.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
run: |
python3.7 -m pip install nox
- name: Generate API
run: nox -s generate
- name: Update CHANGELOG
run: |
start_line=$(grep -n '## \[Unreleased\]' CHANGELOG.md | cut -d: -f1)
end_line=$(awk '/^## \[/ {print NR; exit}' CHANGELOG.md || wc -l < CHANGELOG.md)
sed -i "${start_line},${end_line}s/### Updated APIs/### Updated APIs\n- Updated opensearch-py to reflect the latest OpenSearch API spec./" CHANGELOG.md
- 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/[email protected]
with:
app_id: ${{ secrets.CI_APP_ID }}
private_key: ${{ secrets.CI_APP_PRIVATE_KEY }}
- 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/saimedhi/opensearch-py) to reflect the latest [OpenSearch API spec](https://github.com/saimedhi/opensearch-api-specification/blob/main/OpenSearch.openapi.json)
Date: ${{ steps.date.outputs.date }}
branch: automated-api-update
base: main
signoff: true
labels: |
autocut
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ 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
### Security
### Dependencies
- Bumps `pytest-asyncio` from <=0.21.1 to <=0.23.4
Expand All @@ -35,6 +36,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fix `TypeError` on `parallel_bulk` ([#601](https://github.com/opensearch-project/opensearch-py/pull/601))
- Fix Amazon OpenSearch Serverless integration with LangChain ([#603](https://github.com/opensearch-project/opensearch-py/pull/603))
- Fix type of `Field.__setattr__` ([604](https://github.com/opensearch-project/opensearch-py/pull/604))
### Updated APIs
### Security

## [2.4.1]
Expand Down Expand Up @@ -218,4 +220,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
[2.2.0]: https://github.com/opensearch-project/opensearch-py/compare/v2.1.1...v2.2.0
[2.1.1]: https://github.com/opensearch-project/opensearch-py/compare/v2.1.0...v2.1.1
[2.1.0]: https://github.com/opensearch-project/opensearch-py/compare/v2.0.1...v2.1.0
[2.0.1]: https://github.com/opensearch-project/opensearch-py/compare/v2.0.0...v2.0.1
[2.0.1]: https://github.com/opensearch-project/opensearch-py/compare/v2.0.0...v2.0.1
5 changes: 1 addition & 4 deletions opensearchpy/_async/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,7 @@ async def delete_decommission_awareness(

"""
return await self.transport.perform_request(
"DELETE",
"/_cluster/decommission/awareness/",
params=params,
headers=headers,
"DELETE", "/_cluster/decommission/awareness", params=params, headers=headers
)

@query_params()
Expand Down
2 changes: 1 addition & 1 deletion opensearchpy/_async/client/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async def get_action_groups(
"""
return await self.transport.perform_request(
"GET",
"/_plugins/_security/api/actiongroups/",
"/_plugins/_security/api/actiongroups",
params=params,
headers=headers,
)
Expand Down
5 changes: 1 addition & 4 deletions opensearchpy/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,7 @@ def delete_decommission_awareness(

"""
return self.transport.perform_request(
"DELETE",
"/_cluster/decommission/awareness/",
params=params,
headers=headers,
"DELETE", "/_cluster/decommission/awareness", params=params, headers=headers
)

@query_params()
Expand Down
2 changes: 1 addition & 1 deletion opensearchpy/client/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def get_action_groups(
"""
return self.transport.perform_request(
"GET",
"/_plugins/_security/api/actiongroups/",
"/_plugins/_security/api/actiongroups",
params=params,
headers=headers,
)
Expand Down
Loading