From 8f11c2d4b3887f281c2b205910ad73aafa419a26 Mon Sep 17 00:00:00 2001 From: Vacha Shah Date: Mon, 23 Oct 2023 08:07:36 -0700 Subject: [PATCH] [Backport 2.x] Backporting commits to 2.x (#400) * tannerjones4075- update developer guide (#385) * Updating DEVELOPER_GUIDE.md file to include docker build instructions Signed-off-by: Tanner Jones * Updating DEVELOPER_GUIDE.md file to include docker build instructions Signed-off-by: Tanner Jones * Updating DEVELOPER_GUIDE.md file and CHANGELOG Signed-off-by: Tanner Jones * Removed link from localhost:9200 Signed-off-by: Tanner Jones --------- Signed-off-by: Tanner Jones Signed-off-by: Vacha Shah * Bump github.com/aws/aws-sdk-go from 1.45.20 to 1.45.24 (#387) * Bump github.com/aws/aws-sdk-go from 1.45.20 to 1.45.24 Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.45.20 to 1.45.24. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.45.20...v1.45.24) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update changelog Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] * Bump github.com/aws/aws-sdk-go-v2 from 1.21.0 to 1.21.1 (#388) * Bump github.com/aws/aws-sdk-go-v2 from 1.21.0 to 1.21.1 Bumps [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) from 1.21.0 to 1.21.1. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.21.0...v1.21.1) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update changelog Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] * Bump github.com/aws/aws-sdk-go-v2/config from 1.18.43 to 1.18.44 (#389) * Bump github.com/aws/aws-sdk-go-v2/config from 1.18.43 to 1.18.44 Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.18.43 to 1.18.44. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.18.43...config/v1.18.44) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update changelog Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] * Bump golang.org/x/net from 0.7.0 to 0.17.0 (#391) * Bump golang.org/x/net from 0.7.0 to 0.17.0 Bumps [golang.org/x/net](https://github.com/golang/net) from 0.7.0 to 0.17.0. - [Commits](https://github.com/golang/net/compare/v0.7.0...v0.17.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] * Update changelog Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] * Update DEVELOPER_GUID, Add Coverage + go ling to Makefile, Run CI tests on all branches (#392) * .github: run test workflows for all branches, test against 2.9,2.10 Signed-off-by: Jakob Hahn * Makefile: use docker golangci-lint, run integration test on `.` folder, change coverage generation Signed-off-by: Jakob Hahn * Update DEVELOPER_GUIDE Signed-off-by: Jakob Hahn --------- Signed-off-by: Jakob Hahn Signed-off-by: Vacha Shah * Updated linter version to 1.54.2 (#394) * Updated linter version to 1.54.2 Signed-off-by: Tanner Jones * Updated CHANGELOG.md Signed-off-by: Tanner Jones * Updated CHANGELOG.md Signed-off-by: Tanner Jones * Updated CHANGELOG.md - moved linter update to Dependencies Bumps Signed-off-by: Tanner Jones --------- Signed-off-by: Tanner Jones Signed-off-by: Daniel (dB.) Doubrovkine Co-authored-by: Daniel (dB.) Doubrovkine Signed-off-by: Vacha Shah * Deprecate legacy API (#390) * deprecated legacy REST API /_template Signed-off-by: Tanner Jones * deprecated legacy REST API /_template Signed-off-by: Tanner Jones * removed deprecated header at the top of the doc Signed-off-by: Tanner Jones * added deprecated notes to the CHANGELOG.md Signed-off-by: Tanner Jones * Corrected deprecation statement Signed-off-by: Tanner Jones * Update CHANGELOG.md Co-authored-by: Jakob Signed-off-by: Tanner Jones <78619684+tannerjones4075@users.noreply.github.com> * Updated deprecated message on api.indices.put_template.go Signed-off-by: Tanner Jones * Added deprecated message on api.indices.exists_template.go Signed-off-by: Tanner Jones * Added deprecated message on api.indices.delete_template.go Signed-off-by: Tanner Jones * Added deprecated message on api.indices.get_template.go Signed-off-by: Tanner Jones * Updated deprecated message on api.indices.exists_template.go and added back in IndicesExistsTemplate that was delete by mistake Signed-off-by: Tanner Jones --------- Signed-off-by: Tanner Jones Signed-off-by: Tanner Jones <78619684+tannerjones4075@users.noreply.github.com> Co-authored-by: Jakob Signed-off-by: Vacha Shah * Bump github.com/aws/aws-sdk-go-v2/config from 1.18.44 to 1.19.0 (#398) * Bump github.com/aws/aws-sdk-go-v2/config from 1.18.44 to 1.19.0 Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.18.44 to 1.19.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/v1.19.0/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.18.44...v1.19.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update changelog Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] * Bump github.com/aws/aws-sdk-go from 1.45.24 to 1.45.26 (#397) * Bump github.com/aws/aws-sdk-go from 1.45.24 to 1.45.26 Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.45.24 to 1.45.26. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.45.24...v1.45.26) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update changelog Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] * Bump client version to 2.4.0 Signed-off-by: Vacha Shah --------- Signed-off-by: Tanner Jones Signed-off-by: Vacha Shah Signed-off-by: dependabot[bot] Signed-off-by: Jakob Hahn Signed-off-by: Daniel (dB.) Doubrovkine Signed-off-by: Tanner Jones <78619684+tannerjones4075@users.noreply.github.com> Co-authored-by: Tanner Jones <78619684+tannerjones4075@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] Co-authored-by: Jakob Co-authored-by: Daniel (dB.) Doubrovkine --- .github/workflows/links.yml | 9 +-- .github/workflows/lint.yml | 10 +-- .github/workflows/test-compatibility.yml | 4 +- .github/workflows/test-integration.yml | 16 ++--- .github/workflows/test-unit.yml | 8 +-- CHANGELOG.md | 13 +++- DEVELOPER_GUIDE.md | 55 +++++++++++++-- Makefile | 25 +++++-- go.mod | 8 +-- go.sum | 70 ++++++++++++-------- internal/build/go.mod | 2 +- internal/version/version.go | 2 +- opensearchapi/api.indices.delete_template.go | 15 ++++- opensearchapi/api.indices.exists_template.go | 29 ++++---- opensearchapi/api.indices.get_template.go | 30 +++++---- opensearchapi/api.indices.put_template.go | 31 +++++---- opensearchapi/test/go.mod | 2 +- 17 files changed, 204 insertions(+), 125 deletions(-) diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index a0dbc727c..f757583e9 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -1,11 +1,6 @@ name: Link Checker -on: - push: - branches: - - "*" - pull_request: - branches: - - "*" + +on: [push, pull_request] jobs: linkchecker: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 04ffe52db..95423cfe8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,12 +1,6 @@ name: Lint check -on: - push: - branches: - - "*" - pull_request: - branches: - - "*" +on: [push, pull_request] env: GITHUB_ACTIONS: true @@ -23,7 +17,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.53.3 + version: v1.54.2 args: -v -c .golangci.yml only-new-issues: true diff --git a/.github/workflows/test-compatibility.yml b/.github/workflows/test-compatibility.yml index 041e5dab2..2892b8d52 100644 --- a/.github/workflows/test-compatibility.yml +++ b/.github/workflows/test-compatibility.yml @@ -3,7 +3,7 @@ name: Integration for Compatibility on: [push, pull_request] jobs: - integration-test-compatibility: + integ-test-compat: runs-on: ubuntu-latest strategy: fail-fast: false @@ -22,6 +22,8 @@ jobs: - { opensearch_version: 2.6.0 } - { opensearch_version: 2.7.0 } - { opensearch_version: 2.8.0 } + - { opensearch_version: 2.9.0 } + - { opensearch_version: 2.10.0 } steps: - uses: actions/checkout@v3 with: { fetch-depth: 1 } diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 6a7c7f9dd..54e6df6a2 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -1,12 +1,6 @@ name: Integration -on: - push: - branches: - - "*" - pull_request: - branches: - - "*" +on: [push, pull_request] env: GITHUB_ACTIONS: true @@ -30,6 +24,9 @@ jobs: - name: Launch OpenSearch cluster run: | make cluster.clean cluster.build cluster.start + for attempt in `seq 25`; do sleep 5; \ + if curl -s localhost:9200; \ + then echo '=====> ready'; break; fi; if [ $attempt == 25 ]; then exit 1; fi; echo '=====> waiting...'; done - run: make test-integ race=true - uses: codecov/codecov-action@v1 with: @@ -57,4 +54,7 @@ jobs: - name: Launch OpenSearch cluster run: | make cluster.clean cluster.build cluster.start - - run: make test-integ-secure \ No newline at end of file + for attempt in `seq 25`; do sleep 5; \ + if curl -s -ku admin:admin https://localhost:9200; \ + then echo '=====> ready'; break; fi; if [ $attempt == 25 ]; then exit 1; fi; echo '=====> waiting...'; done + - run: make test-integ-secure diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index e5f4904f9..d09f8f376 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -1,12 +1,6 @@ name: Unit -on: - push: - branches: - - "*" - pull_request: - branches: - - "*" +on: [push, pull_request] env: GITHUB_ACTIONS: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c59174fe..e7256a0ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,12 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Dependencies -- Bumps `github.com/aws/aws-sdk-go` from 1.44.180 to 1.45.20 -- Bumps `github.com/aws/aws-sdk-go-v2` from 1.17.4 to 1.21.0 -- Bumps `github.com/aws/aws-sdk-go-v2/config` from 1.18.8 to 1.18.43 +- Bumps `github.com/aws/aws-sdk-go` from 1.44.180 to 1.45.26 +- Bumps `github.com/aws/aws-sdk-go-v2` from 1.17.4 to 1.21.1 +- Bumps `github.com/aws/aws-sdk-go-v2/config` from 1.18.8 to 1.19.0 - Bumps `github.com/stretchr/testify` from 1.8.1 to 1.8.4 +- Bumps `golang.org/x/net` from 0.7.0 to 0.17.0 +- Bumps `github.com/golangci/golangci-lint-action` from 1.53.3 to 1.54.2 ### Added @@ -41,9 +43,14 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Read, close and replace the http Reponse Body ([#300](https://github.com/opensearch-project/opensearch-go/pull/300)) - Updated and adjusted golangci-lint, solve linting complains for signer ([#352](https://github.com/opensearch-project/opensearch-go/pull/352)) - Solve linting complains for opensearchtransport ([#353](https://github.com/opensearch-project/opensearch-go/pull/353)) +- Updated Developer guide to include docker build instructions ([#385](https://github.com/opensearch-project/opensearch-go/pull/385) +- Test against version 2.9.0,2.10.0, run tests in all branches, change intergration tests to wait for OpenSearch to start ([#392](https://github.com/opensearch-project/opensearch-go/pull/392)) +- Makefile: use docker golangci-lint, run integration test on `.` folder, change coverage generation ([#392](https://github.com/opensearch-project/opensearch-go/pull/392)) ### Deprecated +- Deprecate legacy API /_template ([#151](https://github.com/opensearch-project/opensearch-go/issues/151)) + ### Removed - Removes info call before performing every request ([#219](https://github.com/opensearch-project/opensearch-go/pull/219)) diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index b0a897e21..843cfee8f 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -7,11 +7,15 @@ - [Windows](#windows) - [Unit Testing](#unit-testing) - [Integration Testing](#integration-testing) + - [Composing an OpenSearch Docker Container](#composing-an-opensearch-docker-container) - [Execute integration tests from your terminal](#execute-integration-tests-from-your-terminal) - - [Lint](#lint) - - [Markdown lint](#markdown-lint) + - [Lint](#lint) + - [Markdown lint](#markdown-lint) + - [Go lint](#go-lint) + - [Coverage](#coverage) - [Use an Editor](#use-an-editor) - [GoLand](#goland) + - [Vim](#vim) # Developer Guide @@ -25,9 +29,9 @@ Fork [opensearch-project/opensearch-go](https://github.com/opensearch-project/op ### Install Prerequisites -#### Go 1.11 +#### Go 1.15 -OpenSearch Go Client builds using [Go](https://golang.org/doc/install) 1.11 at a minimum. +OpenSearch Go Client builds using [Go](https://golang.org/doc/install) 1.15 at a minimum. #### Docker @@ -37,7 +41,7 @@ OpenSearch Go Client builds using [Go](https://golang.org/doc/install) 1.11 at a To build the project on Windows, use [WSL2](https://learn.microsoft.com/en-us/windows/wsl/install), the compatibility layer for running Linux applications. -Install ```make``` +Install `make` ``` sudo apt install make ``` @@ -61,6 +65,18 @@ go test -v -run TestName; In order to test opensearch-go client, you need a running OpenSearch cluster. You can use Docker to accomplish this. The [Docker Compose file](.ci/opensearch/docker-compose.yml) supports the ability to run integration tests for the project in local environments. If you have not installed docker-compose, you can install it from this [link](https://docs.docker.com/compose/install/). +### Composing an OpenSearch Docker Container + +Ensure that Docker is installed on your local machine. You can check by running `docker --version`. Next, navigate to your local opensearch-go repository. Run the following command to build and start the OpenSearch docker container. + +``` +make cluster.build cluster.start +``` + +This command will start the OpenSearch container using the `docker-compose.yaml` configuration file. During the build process, the necessary dependencies and files will be downloaded, which may take some time depending on your internet connection and system resources. + +Once the container is built and running, you can open a web browser and navigate to localhost:9200 to access the OpenSearch docker container. + In order to differentiate unit tests from integration tests, Go has a built-in mechanism for allowing you to logically separate your tests with [build tags](https://pkg.go.dev/cmd/go#hdr-Build_constraints). The build tag needs to be placed as close to the top of the file as possible, and must have a blank line beneath it. Hence, create all integration tests with build tag 'integration'. #### Execute integration tests from your terminal @@ -90,6 +106,30 @@ To check the markdown files, run the following command: make lint.markdown ``` +### Go lint + +To check all go files, run the following command: + +``` +make linters +``` + +## Coverage + +To get the repository test coverage, run the following command: + +For the results to be display in your terminal: + +``` +make coverage +``` + +For the results to be display in your browser: + +``` +make coverage-html +``` + ## Use an Editor ### GoLand @@ -100,3 +140,8 @@ You can import the OpenSearch project into GoLand as follows: 2. In the subsequent dialog navigate to the ~/go/src/opensearch-go and click **Open** After you have opened your project, you need to specify the location of the Go SDK. You can either specify a local path to the SDK or download it. To set the Go SDK, navigate to **Go | GOROOT** and set accordingly. + +### Vim + +To improve your vim experience with Go, you might want to check out [fatih/vim-go](https://github.com/fatih/vim-go). +For example it correctly formats the file and validates it on save. diff --git a/Makefile b/Makefile index 137db3fd3..65483b95f 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ endif gotestsum --format=short-verbose --junitfile=tmp/integration-report.xml -- $(testintegargs) "./opensearchtransport" "./opensearchapi" "./opensearchutil"; \ else \ echo "go test -v" $(testintegargs) "."; \ - go test -v $(testintegargs) "./opensearchtransport" "./opensearchapi" "./opensearchutil"; \ + go test -v $(testintegargs) "." "./opensearchtransport" "./opensearchapi" "./opensearchutil"; \ fi; test-integ-secure: ##Run secure integration tests @@ -48,11 +48,24 @@ test-bench: ## Run benchmarks @printf "\033[2m→ Running benchmarks...\033[0m\n" go test -run=none -bench=. -benchmem ./... -test-coverage: ## Generate test coverage report +coverage: ## Print test coverage report + @make gen-coverage + @go tool cover -func=$(PWD)/tmp/total.cov + @printf "\033[0m--------------------------------------------------------------------------------\n\033[0m" + +coverage-html: ## Open test coverage report in browser + @make gen-coverage + @go tool cover -html $(PWD)/tmp/total.cov + +gen-coverage: ## Generate test coverage report @printf "\033[2m→ Generating test coverage report...\033[0m\n" - @go tool cover -html=tmp/unit.cov -o tmp/coverage.html - @go tool cover -func=tmp/unit.cov | 'grep' -v 'opensearchapi/api\.' | sed 's/github.com\/opensearch-project\/opensearch-go\///g' - @printf "\033[0m--------------------------------------------------------------------------------\nopen tmp/coverage.html\n\n\033[0m" + @rm -rf tmp + @mkdir tmp + @mkdir tmp/unit + @mkdir tmp/integration + @go test -cover ./... -args -test.gocoverdir="$(PWD)/tmp/unit" + @go test -cover -tags='integration' ./... -args -test.gocoverdir="$(PWD)/tmp/integration" + @go tool covdata textfmt -i=$(PWD)/tmp/unit,$(PWD)/tmp/integration -o $(PWD)/tmp/total.cov ##@ Development lint: ## Run lint on the package @@ -205,7 +218,7 @@ cluster.clean: ## Remove unused Docker volumes and networks docker system prune --volumes --force linters: - ./bin/golangci-lint run ./... --timeout=5m + docker run -t --rm -v $$(pwd):/app -v ~/.cache/golangci-lint/v1.53.3:/root/.cache -w /app golangci/golangci-lint:v1.53.3 golangci-lint run --timeout=5m workflow: ## Run all github workflow commands here sequentially diff --git a/go.mod b/go.mod index bd2e0b745..83e83ab5b 100644 --- a/go.mod +++ b/go.mod @@ -3,10 +3,10 @@ module github.com/opensearch-project/opensearch-go/v2 go 1.15 require ( - github.com/aws/aws-sdk-go v1.45.20 - github.com/aws/aws-sdk-go-v2 v1.21.0 - github.com/aws/aws-sdk-go-v2/config v1.18.43 + github.com/aws/aws-sdk-go v1.45.26 + github.com/aws/aws-sdk-go-v2 v1.21.2 + github.com/aws/aws-sdk-go-v2/config v1.19.0 github.com/kinbiko/jsonassert v1.1.1 github.com/stretchr/testify v1.8.4 - golang.org/x/net v0.7.0 // indirect + golang.org/x/net v0.17.0 // indirect ) diff --git a/go.sum b/go.sum index 0152d022c..1c9c6004f 100644 --- a/go.sum +++ b/go.sum @@ -1,29 +1,29 @@ -github.com/aws/aws-sdk-go v1.45.20 h1:U/wLZEwqVB6o2XlcJ7um8kczx+A1X2MgO2y4wdKDQTs= -github.com/aws/aws-sdk-go v1.45.20/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go-v2 v1.21.0 h1:gMT0IW+03wtYJhRqTVYn0wLzwdnK9sRMcxmtfGzRdJc= -github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M= -github.com/aws/aws-sdk-go-v2/config v1.18.43 h1:IgdUtTRvUDC6eiJBqU6vh7bHFNAEBjQ8S+qJ7zVhDOs= -github.com/aws/aws-sdk-go-v2/config v1.18.43/go.mod h1:NiFev8qlgg8MPzw3fO/EwzMZeZwlJEKGwfpjRPA9Nvw= -github.com/aws/aws-sdk-go-v2/credentials v1.13.41 h1:dgbKq1tamtboYAKSXWbqL0lKO9rmEzEhbZFh9JQW/Bg= -github.com/aws/aws-sdk-go-v2/credentials v1.13.41/go.mod h1:cc3Fn7DkKbJalPtQnudHGZZ8ml9+hwtbc1CJONsYYqk= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 h1:uDZJF1hu0EVT/4bogChk8DyjSF6fof6uL/0Y26Ma7Fg= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11/go.mod h1:TEPP4tENqBGO99KwVpV9MlOX4NSrSLP8u3KRy2CDwA8= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 h1:22dGT7PneFMx4+b3pz7lMTRyN8ZKH7M2cW4GP9yUS2g= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41/go.mod h1:CrObHAuPneJBlfEJ5T3szXOUkLEThaGfvnhTf33buas= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 h1:SijA0mgjV8E+8G45ltVHs0fvKpTj8xmZJ3VwhGKtUSI= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35/go.mod h1:SJC1nEVVva1g3pHAIdCp7QsRIkMmLAgoDquQ9Rr8kYw= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.43 h1:g+qlObJH4Kn4n21g69DjspU0hKTjWtq7naZ9OLCv0ew= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.43/go.mod h1:rzfdUlfA+jdgLDmPKjd3Chq9V7LVLYo1Nz++Wb91aRo= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35 h1:CdzPW9kKitgIiLV1+MHobfR5Xg25iYnyzWZhyQuSlDI= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35/go.mod h1:QGF2Rs33W5MaN9gYdEQOBBFPLwTZkEhRwI33f7KIG0o= -github.com/aws/aws-sdk-go-v2/service/sso v1.15.0 h1:vuGK1vHNP9zx0PfOrtPumbwR2af0ATQ1Z2H6p75AgRQ= -github.com/aws/aws-sdk-go-v2/service/sso v1.15.0/go.mod h1:fIAwKQKBFu90pBxx07BFOMJLpRUGu8VOzLJakeY+0K4= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.1 h1:8lKOidPkmSmfUtiTgtdXWgaKItCZ/g75/jEk6Ql6GsA= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.1/go.mod h1:yygr8ACQRY2PrEcy3xsUI357stq2AxnFM6DIsR9lij4= -github.com/aws/aws-sdk-go-v2/service/sts v1.23.0 h1:pyvfUqkNLMipdKNAtu7OVbRxUrR2BMaKccIPpk/Hkak= -github.com/aws/aws-sdk-go-v2/service/sts v1.23.0/go.mod h1:VC7JDqsqiwXukYEDjoHh9U0fOJtNWh04FPQz4ct4GGU= -github.com/aws/smithy-go v1.14.2 h1:MJU9hqBGbvWZdApzpvoF2WAIJDbtjK2NDJSiJP7HblQ= -github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/aws-sdk-go v1.45.26 h1:PJ2NJNY5N/yeobLYe1Y+xLdavBi67ZI8gvph6ftwVCg= +github.com/aws/aws-sdk-go v1.45.26/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go-v2 v1.21.2 h1:+LXZ0sgo8quN9UOKXXzAWRT3FWd4NxeXWOZom9pE7GA= +github.com/aws/aws-sdk-go-v2 v1.21.2/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM= +github.com/aws/aws-sdk-go-v2/config v1.19.0 h1:AdzDvwH6dWuVARCl3RTLGRc4Ogy+N7yLFxVxXe1ClQ0= +github.com/aws/aws-sdk-go-v2/config v1.19.0/go.mod h1:ZwDUgFnQgsazQTnWfeLWk5GjeqTQTL8lMkoE1UXzxdE= +github.com/aws/aws-sdk-go-v2/credentials v1.13.43 h1:LU8vo40zBlo3R7bAvBVy/ku4nxGEyZe9N8MqAeFTzF8= +github.com/aws/aws-sdk-go-v2/credentials v1.13.43/go.mod h1:zWJBz1Yf1ZtX5NGax9ZdNjhhI4rgjfgsyk6vTY1yfVg= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 h1:PIktER+hwIG286DqXyvVENjgLTAwGgoeriLDD5C+YlQ= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13/go.mod h1:f/Ib/qYjhV2/qdsf79H3QP/eRE4AkVyEf6sk7XfZ1tg= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 h1:nFBQlGtkbPzp/NjZLuFxRqmT91rLJkgvsEQs68h962Y= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43/go.mod h1:auo+PiyLl0n1l8A0e8RIeR8tOzYPfZZH/JNlrJ8igTQ= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 h1:JRVhO25+r3ar2mKGP7E0LDl8K9/G36gjlqca5iQbaqc= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37/go.mod h1:Qe+2KtKml+FEsQF/DHmDV+xjtche/hwoF75EG4UlHW8= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 h1:hze8YsjSh8Wl1rYa1CJpRmXP21BvOBuc76YhW0HsuQ4= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45/go.mod h1:lD5M20o09/LCuQ2mE62Mb/iSdSlCNuj6H5ci7tW7OsE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 h1:WWZA/I2K4ptBS1kg0kV1JbBtG/umed0vwHRrmcr9z7k= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37/go.mod h1:vBmDnwWXWxNPFRMmG2m/3MKOe+xEcMDo1tanpaWCcck= +github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 h1:JuPGc7IkOP4AaqcZSIcyqLpFSqBWK32rM9+a1g6u73k= +github.com/aws/aws-sdk-go-v2/service/sso v1.15.2/go.mod h1:gsL4keucRCgW+xA85ALBpRFfdSLH4kHOVSnLMSuBECo= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 h1:HFiiRkf1SdaAmV3/BHOFZ9DjFynPHj8G/UIO1lQS+fk= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3/go.mod h1:a7bHA82fyUXOm+ZSWKU6PIoBxrjSprdLoM8xPYvzYVg= +github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 h1:0BkLfgeDjfZnZ+MhB3ONb01u9pwFYTCZVhlsSSBvlbU= +github.com/aws/aws-sdk-go-v2/service/sts v1.23.2/go.mod h1:Eows6e1uQEsc4ZaHANmsPRzAKcVDrcmjjWiih2+HUUQ= +github.com/aws/smithy-go v1.15.0 h1:PS/durmlzvAFpQHDs4wi4sNNP9ExsqZh6IlfdHXgKK8= +github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -48,15 +48,20 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -64,19 +69,26 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/build/go.mod b/internal/build/go.mod index 33f9a8097..37d7f66c0 100644 --- a/internal/build/go.mod +++ b/internal/build/go.mod @@ -7,7 +7,7 @@ replace github.com/opensearch-project/opensearch-go/v2 => ../../ require ( github.com/alecthomas/chroma v0.8.2 github.com/kr/pretty v0.1.0 // indirect - github.com/opensearch-project/opensearch-go/v2 v2.2.0 + github.com/opensearch-project/opensearch-go/v2 v2.4.0 github.com/spf13/cobra v1.6.1 golang.org/x/crypto v0.1.0 golang.org/x/tools v0.1.12 diff --git a/internal/version/version.go b/internal/version/version.go index fb3f8c713..035b413aa 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -28,4 +28,4 @@ package version // Client returns the client version as a string. // -const Client = "2.2.0" +const Client = "2.4.0" diff --git a/opensearchapi/api.indices.delete_template.go b/opensearchapi/api.indices.delete_template.go index 7a9b2cadb..60ddd624a 100644 --- a/opensearchapi/api.indices.delete_template.go +++ b/opensearchapi/api.indices.delete_template.go @@ -33,6 +33,7 @@ import ( "time" ) +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use newIndicesDeleteIndexTemplateFunc instead func newIndicesDeleteTemplateFunc(t Transport) IndicesDeleteTemplate { return func(name string, o ...func(*IndicesDeleteTemplateRequest)) (*Response, error) { var r = IndicesDeleteTemplateRequest{Name: name} @@ -47,11 +48,12 @@ func newIndicesDeleteTemplateFunc(t Transport) IndicesDeleteTemplate { // IndicesDeleteTemplate deletes an index template. // -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesDeleteIndexTemplate instead type IndicesDeleteTemplate func(name string, o ...func(*IndicesDeleteTemplateRequest)) (*Response, error) // IndicesDeleteTemplateRequest configures the Indices Delete Template API request. // +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesDeleteIndexTemplateRequest instead type IndicesDeleteTemplateRequest struct { Name string @@ -71,6 +73,7 @@ type IndicesDeleteTemplateRequest struct { // Do executes the request and returns response or error. // +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesDeleteIndexTemplateRequest instead func (r IndicesDeleteTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -161,6 +164,7 @@ func (r IndicesDeleteTemplateRequest) Do(ctx context.Context, transport Transpor // WithContext sets the request context. // +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesDeleteIndexTemplate instead func (f IndicesDeleteTemplate) WithContext(v context.Context) func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { r.ctx = v @@ -171,6 +175,7 @@ func (f IndicesDeleteTemplate) WithContext(v context.Context) func(*IndicesDelet // // Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. // +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesDeleteIndexTemplate instead func (f IndicesDeleteTemplate) WithMasterTimeout(v time.Duration) func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { r.MasterTimeout = v @@ -179,6 +184,7 @@ func (f IndicesDeleteTemplate) WithMasterTimeout(v time.Duration) func(*IndicesD // WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. // +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesDeleteIndexTemplate instead func (f IndicesDeleteTemplate) WithClusterManagerTimeout(v time.Duration) func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { r.ClusterManagerTimeout = v @@ -187,6 +193,7 @@ func (f IndicesDeleteTemplate) WithClusterManagerTimeout(v time.Duration) func(* // WithTimeout - explicit operation timeout. // +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesDeleteIndexTemplate instead func (f IndicesDeleteTemplate) WithTimeout(v time.Duration) func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { r.Timeout = v @@ -195,6 +202,7 @@ func (f IndicesDeleteTemplate) WithTimeout(v time.Duration) func(*IndicesDeleteT // WithPretty makes the response body pretty-printed. // +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesDeleteIndexTemplate instead func (f IndicesDeleteTemplate) WithPretty() func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { r.Pretty = true @@ -203,6 +211,7 @@ func (f IndicesDeleteTemplate) WithPretty() func(*IndicesDeleteTemplateRequest) // WithHuman makes statistical values human-readable. // +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesDeleteIndexTemplate instead func (f IndicesDeleteTemplate) WithHuman() func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { r.Human = true @@ -211,6 +220,7 @@ func (f IndicesDeleteTemplate) WithHuman() func(*IndicesDeleteTemplateRequest) { // WithErrorTrace includes the stack trace for errors in the response body. // +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesDeleteIndexTemplate instead func (f IndicesDeleteTemplate) WithErrorTrace() func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { r.ErrorTrace = true @@ -219,6 +229,7 @@ func (f IndicesDeleteTemplate) WithErrorTrace() func(*IndicesDeleteTemplateReque // WithFilterPath filters the properties of the response body. // +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesDeleteIndexTemplate instead func (f IndicesDeleteTemplate) WithFilterPath(v ...string) func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { r.FilterPath = v @@ -227,6 +238,7 @@ func (f IndicesDeleteTemplate) WithFilterPath(v ...string) func(*IndicesDeleteTe // WithHeader adds the headers to the HTTP request. // +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesDeleteIndexTemplate instead func (f IndicesDeleteTemplate) WithHeader(h map[string]string) func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { if r.Header == nil { @@ -240,6 +252,7 @@ func (f IndicesDeleteTemplate) WithHeader(h map[string]string) func(*IndicesDele // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. // +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesDeleteIndexTemplate instead func (f IndicesDeleteTemplate) WithOpaqueID(s string) func(*IndicesDeleteTemplateRequest) { return func(r *IndicesDeleteTemplateRequest) { if r.Header == nil { diff --git a/opensearchapi/api.indices.exists_template.go b/opensearchapi/api.indices.exists_template.go index 89e60498b..a5595a114 100644 --- a/opensearchapi/api.indices.exists_template.go +++ b/opensearchapi/api.indices.exists_template.go @@ -34,6 +34,7 @@ import ( "time" ) +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use newIndicesExistsIndexTemplateFunc instead func newIndicesExistsTemplateFunc(t Transport) IndicesExistsTemplate { return func(name []string, o ...func(*IndicesExistsTemplateRequest)) (*Response, error) { var r = IndicesExistsTemplateRequest{Name: name} @@ -47,12 +48,11 @@ func newIndicesExistsTemplateFunc(t Transport) IndicesExistsTemplate { // ----- API Definition ------------------------------------------------------- // IndicesExistsTemplate returns information about whether a particular index template exists. -// -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesExistsIndexTemplate instead type IndicesExistsTemplate func(name []string, o ...func(*IndicesExistsTemplateRequest)) (*Response, error) +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesExistsIndexTemplateRequest instead // IndicesExistsTemplateRequest configures the Indices Exists Template API request. -// type IndicesExistsTemplateRequest struct { Name []string @@ -73,6 +73,7 @@ type IndicesExistsTemplateRequest struct { // Do executes the request and returns response or error. // +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesExistsIndexTemplateRequest instead func (r IndicesExistsTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -166,7 +167,7 @@ func (r IndicesExistsTemplateRequest) Do(ctx context.Context, transport Transpor } // WithContext sets the request context. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesExistsIndexTemplate instead func (f IndicesExistsTemplate) WithContext(v context.Context) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.ctx = v @@ -174,7 +175,7 @@ func (f IndicesExistsTemplate) WithContext(v context.Context) func(*IndicesExist } // WithFlatSettings - return settings in flat format (default: false). -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesExistsIndexTemplate instead func (f IndicesExistsTemplate) WithFlatSettings(v bool) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.FlatSettings = &v @@ -182,7 +183,7 @@ func (f IndicesExistsTemplate) WithFlatSettings(v bool) func(*IndicesExistsTempl } // WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesExistsIndexTemplate instead func (f IndicesExistsTemplate) WithLocal(v bool) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.Local = &v @@ -192,7 +193,7 @@ func (f IndicesExistsTemplate) WithLocal(v bool) func(*IndicesExistsTemplateRequ // WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. // // Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesExistsIndexTemplate instead func (f IndicesExistsTemplate) WithMasterTimeout(v time.Duration) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.MasterTimeout = v @@ -200,7 +201,7 @@ func (f IndicesExistsTemplate) WithMasterTimeout(v time.Duration) func(*IndicesE } // WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesExistsIndexTemplate instead func (f IndicesExistsTemplate) WithClusterManagerTimeout(v time.Duration) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.ClusterManagerTimeout = v @@ -208,7 +209,7 @@ func (f IndicesExistsTemplate) WithClusterManagerTimeout(v time.Duration) func(* } // WithPretty makes the response body pretty-printed. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesExistsIndexTemplate instead func (f IndicesExistsTemplate) WithPretty() func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.Pretty = true @@ -216,7 +217,7 @@ func (f IndicesExistsTemplate) WithPretty() func(*IndicesExistsTemplateRequest) } // WithHuman makes statistical values human-readable. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesExistsIndexTemplate instead func (f IndicesExistsTemplate) WithHuman() func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.Human = true @@ -224,7 +225,7 @@ func (f IndicesExistsTemplate) WithHuman() func(*IndicesExistsTemplateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesExistsIndexTemplate instead func (f IndicesExistsTemplate) WithErrorTrace() func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.ErrorTrace = true @@ -232,7 +233,7 @@ func (f IndicesExistsTemplate) WithErrorTrace() func(*IndicesExistsTemplateReque } // WithFilterPath filters the properties of the response body. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesExistsIndexTemplate instead func (f IndicesExistsTemplate) WithFilterPath(v ...string) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { r.FilterPath = v @@ -240,7 +241,7 @@ func (f IndicesExistsTemplate) WithFilterPath(v ...string) func(*IndicesExistsTe } // WithHeader adds the headers to the HTTP request. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesExistsIndexTemplate instead func (f IndicesExistsTemplate) WithHeader(h map[string]string) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { if r.Header == nil { @@ -253,7 +254,7 @@ func (f IndicesExistsTemplate) WithHeader(h map[string]string) func(*IndicesExis } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesExistsIndexTemplate instead func (f IndicesExistsTemplate) WithOpaqueID(s string) func(*IndicesExistsTemplateRequest) { return func(r *IndicesExistsTemplateRequest) { if r.Header == nil { diff --git a/opensearchapi/api.indices.get_template.go b/opensearchapi/api.indices.get_template.go index 67eb1517b..1fb2c90d9 100644 --- a/opensearchapi/api.indices.get_template.go +++ b/opensearchapi/api.indices.get_template.go @@ -34,6 +34,8 @@ import ( "time" ) +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use newIndicesGetIndexTemplateFunc instead + func newIndicesGetTemplateFunc(t Transport) IndicesGetTemplate { return func(o ...func(*IndicesGetTemplateRequest)) (*Response, error) { var r = IndicesGetTemplateRequest{} @@ -48,11 +50,12 @@ func newIndicesGetTemplateFunc(t Transport) IndicesGetTemplate { // IndicesGetTemplate returns an index template. // -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesGetIndexTemplate instead type IndicesGetTemplate func(o ...func(*IndicesGetTemplateRequest)) (*Response, error) // IndicesGetTemplateRequest configures the Indices Get Template API request. // +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesGetIndexTemplateRequest instead type IndicesGetTemplateRequest struct { Name []string @@ -73,6 +76,7 @@ type IndicesGetTemplateRequest struct { // Do executes the request and returns response or error. // +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesGetIndexTemplateRequest instead func (r IndicesGetTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -168,7 +172,7 @@ func (r IndicesGetTemplateRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesGetIndexTemplate instead func (f IndicesGetTemplate) WithContext(v context.Context) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.ctx = v @@ -176,7 +180,7 @@ func (f IndicesGetTemplate) WithContext(v context.Context) func(*IndicesGetTempl } // WithName - the comma separated names of the index templates. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesGetIndexTemplate instead func (f IndicesGetTemplate) WithName(v ...string) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.Name = v @@ -184,7 +188,7 @@ func (f IndicesGetTemplate) WithName(v ...string) func(*IndicesGetTemplateReques } // WithFlatSettings - return settings in flat format (default: false). -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesGetIndexTemplate instead func (f IndicesGetTemplate) WithFlatSettings(v bool) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.FlatSettings = &v @@ -192,7 +196,7 @@ func (f IndicesGetTemplate) WithFlatSettings(v bool) func(*IndicesGetTemplateReq } // WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false). -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesGetIndexTemplate instead func (f IndicesGetTemplate) WithLocal(v bool) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.Local = &v @@ -202,7 +206,7 @@ func (f IndicesGetTemplate) WithLocal(v bool) func(*IndicesGetTemplateRequest) { // WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. // // Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesGetIndexTemplate instead func (f IndicesGetTemplate) WithMasterTimeout(v time.Duration) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.MasterTimeout = v @@ -210,7 +214,7 @@ func (f IndicesGetTemplate) WithMasterTimeout(v time.Duration) func(*IndicesGetT } // WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesGetIndexTemplate instead func (f IndicesGetTemplate) WithClusterManagerTimeout(v time.Duration) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.ClusterManagerTimeout = v @@ -218,7 +222,7 @@ func (f IndicesGetTemplate) WithClusterManagerTimeout(v time.Duration) func(*Ind } // WithPretty makes the response body pretty-printed. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesGetIndexTemplate instead func (f IndicesGetTemplate) WithPretty() func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.Pretty = true @@ -226,7 +230,7 @@ func (f IndicesGetTemplate) WithPretty() func(*IndicesGetTemplateRequest) { } // WithHuman makes statistical values human-readable. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesGetIndexTemplate instead func (f IndicesGetTemplate) WithHuman() func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.Human = true @@ -234,7 +238,7 @@ func (f IndicesGetTemplate) WithHuman() func(*IndicesGetTemplateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesGetIndexTemplate instead func (f IndicesGetTemplate) WithErrorTrace() func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.ErrorTrace = true @@ -242,7 +246,7 @@ func (f IndicesGetTemplate) WithErrorTrace() func(*IndicesGetTemplateRequest) { } // WithFilterPath filters the properties of the response body. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesGetIndexTemplate instead func (f IndicesGetTemplate) WithFilterPath(v ...string) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { r.FilterPath = v @@ -250,7 +254,7 @@ func (f IndicesGetTemplate) WithFilterPath(v ...string) func(*IndicesGetTemplate } // WithHeader adds the headers to the HTTP request. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesGetIndexTemplate instead func (f IndicesGetTemplate) WithHeader(h map[string]string) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { if r.Header == nil { @@ -263,7 +267,7 @@ func (f IndicesGetTemplate) WithHeader(h map[string]string) func(*IndicesGetTemp } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesGetIndexTemplate instead func (f IndicesGetTemplate) WithOpaqueID(s string) func(*IndicesGetTemplateRequest) { return func(r *IndicesGetTemplateRequest) { if r.Header == nil { diff --git a/opensearchapi/api.indices.put_template.go b/opensearchapi/api.indices.put_template.go index 34a3a6b8f..71b4ab01b 100644 --- a/opensearchapi/api.indices.put_template.go +++ b/opensearchapi/api.indices.put_template.go @@ -35,6 +35,7 @@ import ( "time" ) +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use newIndicesPutIndexTemplateFunc instead func newIndicesPutTemplateFunc(t Transport) IndicesPutTemplate { return func(name string, body io.Reader, o ...func(*IndicesPutTemplateRequest)) (*Response, error) { var r = IndicesPutTemplateRequest{Name: name, Body: body} @@ -48,12 +49,11 @@ func newIndicesPutTemplateFunc(t Transport) IndicesPutTemplate { // ----- API Definition ------------------------------------------------------- // IndicesPutTemplate creates or updates an index template. -// -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesPutSettings instead type IndicesPutTemplate func(name string, body io.Reader, o ...func(*IndicesPutTemplateRequest)) (*Response, error) // IndicesPutTemplateRequest configures the Indices Put Template API request. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesPutSettingsRequest instead type IndicesPutTemplateRequest struct { Body io.Reader @@ -75,7 +75,7 @@ type IndicesPutTemplateRequest struct { } // Do executes the request and returns response or error. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesPutSettingsRequest instead func (r IndicesPutTemplateRequest) Do(ctx context.Context, transport Transport) (*Response, error) { var ( method string @@ -173,7 +173,7 @@ func (r IndicesPutTemplateRequest) Do(ctx context.Context, transport Transport) } // WithContext sets the request context. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesPutSettings instead func (f IndicesPutTemplate) WithContext(v context.Context) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.ctx = v @@ -181,7 +181,7 @@ func (f IndicesPutTemplate) WithContext(v context.Context) func(*IndicesPutTempl } // WithCreate - whether the index template should only be added if new or can also replace an existing one. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesPutSettings instead func (f IndicesPutTemplate) WithCreate(v bool) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.Create = &v @@ -189,9 +189,8 @@ func (f IndicesPutTemplate) WithCreate(v bool) func(*IndicesPutTemplateRequest) } // WithMasterTimeout - explicit operation timeout for connection to cluster-manager node. -// // Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesPutSettings instead func (f IndicesPutTemplate) WithMasterTimeout(v time.Duration) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.MasterTimeout = v @@ -199,7 +198,7 @@ func (f IndicesPutTemplate) WithMasterTimeout(v time.Duration) func(*IndicesPutT } // WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesPutSettings instead func (f IndicesPutTemplate) WithClusterManagerTimeout(v time.Duration) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.ClusterManagerTimeout = v @@ -207,7 +206,7 @@ func (f IndicesPutTemplate) WithClusterManagerTimeout(v time.Duration) func(*Ind } // WithOrder - the order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers). -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesPutSettings instead func (f IndicesPutTemplate) WithOrder(v int) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.Order = &v @@ -215,7 +214,7 @@ func (f IndicesPutTemplate) WithOrder(v int) func(*IndicesPutTemplateRequest) { } // WithPretty makes the response body pretty-printed. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesPutSettings instead func (f IndicesPutTemplate) WithPretty() func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.Pretty = true @@ -223,7 +222,7 @@ func (f IndicesPutTemplate) WithPretty() func(*IndicesPutTemplateRequest) { } // WithHuman makes statistical values human-readable. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesPutSettings instead func (f IndicesPutTemplate) WithHuman() func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.Human = true @@ -231,7 +230,7 @@ func (f IndicesPutTemplate) WithHuman() func(*IndicesPutTemplateRequest) { } // WithErrorTrace includes the stack trace for errors in the response body. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesPutSettings instead func (f IndicesPutTemplate) WithErrorTrace() func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.ErrorTrace = true @@ -239,7 +238,7 @@ func (f IndicesPutTemplate) WithErrorTrace() func(*IndicesPutTemplateRequest) { } // WithFilterPath filters the properties of the response body. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesPutSettings instead func (f IndicesPutTemplate) WithFilterPath(v ...string) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { r.FilterPath = v @@ -247,7 +246,7 @@ func (f IndicesPutTemplate) WithFilterPath(v ...string) func(*IndicesPutTemplate } // WithHeader adds the headers to the HTTP request. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesPutSettings instead func (f IndicesPutTemplate) WithHeader(h map[string]string) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { if r.Header == nil { @@ -260,7 +259,7 @@ func (f IndicesPutTemplate) WithHeader(h map[string]string) func(*IndicesPutTemp } // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. -// +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndicesPutSettings instead func (f IndicesPutTemplate) WithOpaqueID(s string) func(*IndicesPutTemplateRequest) { return func(r *IndicesPutTemplateRequest) { if r.Header == nil { diff --git a/opensearchapi/test/go.mod b/opensearchapi/test/go.mod index edf66123e..a9058fbc7 100644 --- a/opensearchapi/test/go.mod +++ b/opensearchapi/test/go.mod @@ -5,7 +5,7 @@ go 1.11 replace github.com/opensearch-project/opensearch-go/v2 => ../../ require ( - github.com/opensearch-project/opensearch-go/v2 v2.2.0 + github.com/opensearch-project/opensearch-go/v2 v2.4.0 gopkg.in/yaml.v2 v2.4.0 )